Beispiel #1
0
 public function action_index()
 {
     $role = $this->request->param('id');
     $users = new Model_User();
     $data['users'] = $users->getUsers($role);
     $this->template->content = View::factory('admin/admUsers', array('data' => $data, 'user' => $this->user));
 }
Beispiel #2
0
 public function listAction()
 {
     $currentUsers = Model_User::getUsers();
     if ($currentUsers->count() > 0) {
         $this->view->users = $currentUsers;
     } else {
         $this->view->users = null;
     }
 }
Beispiel #3
0
 public function action_getUsers()
 {
     $this->auto_render = FALSE;
     $users = Model_User::getUsers("", "");
     $final['data'] = array();
     //
     foreach ($users as $val) {
         $final['data'][] = $val;
     }
     //
     print json_encode($final);
 }
Beispiel #4
0
 public function testCanCreateUsers()
 {
     Model_User::create($this->username, $this->password);
     $users = Model_User::getUsers();
     $this->assertArrayHasKey($this->username, $users);
     $user = new Model_User();
     $user->username = '******';
     $user->password = '******';
     $user->save();
     $users = Model_User::getUsers();
     $this->assertArrayHasKey('myuser', $users);
 }