Ejemplo n.º 1
0
 /**
  * Manages all models.
  */
 public function actionAdmin()
 {
     $cur_user = Yii::app()->user->id;
     $user = User::Model()->findAllByAttributes(array('id' => $cur_user));
     if ($user[0]['superuser'] == 1) {
         $model = new Source('search');
         $model->unsetAttributes();
         // clear any default values
         if (isset($_GET['Source'])) {
             $model->attributes = $_GET['Source'];
         }
         $this->render('admin', array('model' => $model));
     } else {
         echo "!Error 504 Page Not Found";
     }
 }