Exemplo n.º 1
0
 /**
  * User management list test.
  */
 public function testIndex()
 {
     $this->open('/administration/users');
     $users = User::model()->findAll();
     foreach ($users as $user) {
         /* @var $user application\models\User */
         $this->assertTextPresent($user->id);
         $this->assertTextPresent($user->username);
         $this->assertTextPresent($user->fullName);
     }
 }
Exemplo n.º 2
0
 /**
  * 验证激活
  * @return boolean 激活成功返回true
  */
 protected function active()
 {
     $model = UserActive::model();
     $active = $model->fetchUidByCode($this->code);
     if ($active) {
         unset($model);
         $model = User::model();
         $user = $model->findByPk($active->id);
         if ($user && $user->email == $this->email) {
             $user->status = User::STATUS_ENABLE;
             return $user->save();
         }
     }
     return false;
 }
Exemplo n.º 3
0
 /**
  * User list display action.
  * 
  * This page will display list of users along with actions for user
  * management.
  */
 public function actionIndex()
 {
     $dataProvider = new \CActiveDataProvider(User::model(), array('criteria' => array('scopes' => array(User::SCOPE_SELECT_LABELS, User::SCOPE_ORDER_NEWEST)), 'pagination' => array()));
     $this->render('index', array('dataProvider' => $dataProvider));
 }