Esempio n. 1
0
 public function registerPreValidateAction()
 {
     if ($this->request->isPost()) {
         if ($this->request->isAjax()) {
             $role_name = $this->request->getPost('roleName');
             $find = AclRoles::findFirstByName($role_name);
             if ($find === false) {
                 $payload = array('error' => 0);
             } else {
                 $payload = array('error' => 1, 'message' => _('This name is already assigned'));
             }
             return $this->sendAjax($payload);
         }
     }
 }
Esempio n. 2
0
 public function getRoles()
 {
     return AclRoles::find()->toArray();
 }
Esempio n. 3
0
 public function getRolesAction()
 {
     if ($this->request->isPost()) {
         if ($this->request->isAjax()) {
             $roles = AclRoles::find()->toArray();
             return $this->sendAjax($roles);
         }
     }
 }