239c3a6f51df4de55f139de3cd3f91ad4a4abda2

Author: Jonathan Bradley

Date: 2009-07-23 00:34:32 -0400

added view for users

diff --git a/.gitignore b/.gitignore index d6fe828..931eccb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ plugins/debug_kit -config/database.php \ No newline at end of file +config/database.php +tmp/* \ No newline at end of file diff --git a/controllers/users_controller.php b/controllers/users_controller.php new file mode 100644 index 0000000..172257d --- /dev/null +++ b/controllers/users_controller.php @@ -0,0 +1,12 @@ +<?php + +class UsersController extends AppController { + + var $name = 'Users'; + + function index() { + $data = $this->User->getList(); + $this->set(compact('data')); + } +} +?> \ No newline at end of file diff --git a/models/user.php b/models/user.php index d42ac94..075e877 100644 --- a/models/user.php +++ b/models/user.php @@ -4,6 +4,12 @@ class User extends AppModel { var $name = 'User'; + function getList() { + return $this->find('all', array( + 'fields' => array('User.username', 'User.home', 'User.password', 'User.shell', 'User.type') + )); + } + function check($data) { return $this->find('count', array( 'conditions' => array( diff --git a/views/elements/menu.ctp b/views/elements/menu.ctp index 93637ce..faf3ac2 100644 --- a/views/elements/menu.ctp +++ b/views/elements/menu.ctp @@ -1,12 +1,12 @@ <div id="menu"> <ul id="navmenu-h"> <li><a href="/">Home</a></li> - <li><a href="#">Domains &raquo;</a> + <li><?php echo $html->link('Domains &raquo;', array('controller' => 'domains', 'action' => 'index'), null, null, false); ?> <ul> - <li><?php echo $html->link('Active List', array('controller' => 'domains', 'action' => 'index'), null, null, false); ?></li> - <li><?php echo $html->link('Registered', array('controller' => 'domains', 'action' => 'registered'), null, null, false); ?></li> + <li><?php echo $html->link('Registered Domains', array('controller' => 'domains', 'action' => 'registered'), null, null, false); ?></li> </ul> </li> + <li><?php echo $html->link('Users', array('controller' => 'users', 'action' => 'index'), null, null, false); ?></li> <!-- <li><a href="#">MySQL &raquo;</a> <ul> diff --git a/views/users/index.ctp b/views/users/index.ctp new file mode 100644 index 0000000..8c1ea92 --- /dev/null +++ b/views/users/index.ctp @@ -0,0 +1,21 @@ +<h2>Active Users</h2> +<? echo $html->link('Update From Dreamhost', array('controller' => 'crons', 'action' => 'users')); ?> +<table> + <tr> + <th>Username</th> + <th>Password</th> + <th>Server</th> + <th>Shell</th> + <th>Access</th> + </tr> + <?php foreach($data as $key => $value) { ?> + <tr> + <td><?php echo $value['User']['username']; ?></td> + <td><?php echo $value['User']['password']; ?></td> + <td><?php echo $value['User']['home']; ?></td> + <td><?php echo $value['User']['shell']; ?></td> + <td><?php echo $value['User']['type']; ?></td> + </tr> + <?php } ?> +</table> +