예제 #1
0
파일: Roles.php 프로젝트: valizr/MMA
 public static function isAdmin($roleId)
 {
     //find resource
     $resourceAdmin = new Default_Model_Role();
     $selectA = $resourceAdmin->getMapper()->getDbTable()->select()->where('isAdmin = ?', '1')->where('id = ?', $roleId);
     $resourceAdmin->fetchRow($selectA);
     if ($resourceAdmin->getId() != null) {
         return true;
     }
     return false;
 }
예제 #2
0
파일: Role.php 프로젝트: valizr/MMA
 public function delete(Default_Model_Role $value)
 {
     $auth = Zend_Auth::getInstance();
     $authAccount = $auth->getStorage()->read();
     if (null != $authAccount) {
         if (null != $authAccount->getId()) {
             $user = new Default_Model_Users();
             $user->find($authAccount->getId());
             $id = $value->getId();
             $data = array('deleted' => '1');
             $this->getDbTable()->update($data, array('id = ?' => $id));
             return $id;
         }
     }
 }