コード例 #1
0
ファイル: Phanquyenquantri.php プロジェクト: BanNT/xechieuve
 public static function getALlAdminId()
 {
     $admins = Phanquyenquantri::model()->findAll();
     $adm = array();
     foreach ($admins as $admin) {
         array_push($adm, $admin->ma_qtv);
     }
     return $adm;
 }
コード例 #2
0
 /**
  * Deletes a particular model.
  * If deletion is successful, the browser will be redirected to the 'admin' page.
  * @param integer $id the ID of the model to be deleted
  */
 public function actionDelete($id)
 {
     $this->_checkAccess('delete');
     Phanquyenquantri::model()->deleteAllByAttributes(array('ma_qtv' => $id));
     $this->loadModel($id)->delete();
     // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
     if (!isset($_GET['ajax'])) {
         $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));
     }
 }
コード例 #3
0
 /**
  * Specifies the access control rules.
  * This method is used by the 'accessControl' filter.
  * @return array access control rules
  */
 public function accessRules()
 {
     return array(array('allow', 'users' => Phanquyenquantri::getALlAdminByRole(Phanquyenquantri::CUSTOMER_NEWS_TYPE)), array('deny', 'users' => array('*')));
 }
コード例 #4
0
ファイル: SiteController.php プロジェクト: BanNT/xechieuve
 /**
  * Specifies the access control rules.
  * This method is used by the 'accessControl' filter.
  * @return array access control rules
  */
 public function accessRules()
 {
     return array(array('allow', 'users' => Phanquyenquantri::getALlAdminId()), array('deny', 'users' => array('*')));
 }