示例#1
0
 /**
  * Fetches the user-groups and returns them
  * @return array  The groups or void array on error/not found
  */
 private function groupsGet()
 {
     try {
         $manager = new \Babesk\System\UserGroupsManager($this->_pdo, $this->_logger);
         if ($manager->groupsLoad()) {
             $userGroup = $manager->userGroupGet();
             return $manager->flatGroupsGet();
         } else {
             throw new \Exception('General error occured');
         }
     } catch (\Exception $e) {
         $this->_logger->log('Error loading the groups', 'Notice', Null, json_encode(array('msg' => $e->getMessage())));
         $this->_interface->showError(_g('Could not load the user-' . 'groups. Adding new users to groups is disabled!'));
         return array();
     }
 }
示例#2
0
文件: User.php 项目: Auwibana/babesk
 /**
  * Returns all existing usergroups
  * @return Group  The root-user-group with all other groups as childs
  */
 protected function usergroupsGet()
 {
     $gMng = new \Babesk\System\UserGroupsManager($this->_pdo, $this->_logger);
     $gMng->groupsLoad();
     return $gMng->userGroupGet();
 }