public function actionAccess($id)
 {
     $nodes = new RolesModel();
     $this->template->nodes = $nodes;
     $this->template->parents = $nodes->getChildNodes(NULL);
     $role = dibi::fetch('SELECT key_name, name FROM [' . TABLE_ROLES . '] WHERE id=%i;', $id);
     $this->template->role = $role->name;
     $access = new AccessModel(array($role));
     $this->template->access = $access->getAccess();
 }
Exemple #2
0
 public function actionAccess($id)
 {
     $nodes = new RolesModel();
     $this->template->nodes = $nodes;
     $this->template->parents = $nodes->getChildNodes(NULL);
     $user = dibi::fetchSingle('SELECT login FROM [' . TABLE_USERS . '] WHERE id=%i;', $id);
     $this->template->user_name = $user;
     $roles = dibi::fetchAll('SELECT r.key_name FROM [' . TABLE_ROLES . '] AS r
                                 RIGHT JOIN [' . TABLE_USERS_ROLES . '] AS ur ON r.id=ur.role_id
                                 WHERE ur.user_id=%i;', $id);
     $access = new AccessModel($roles);
     $this->template->access = $access->getAccess();
 }