Ejemplo n.º 1
0
 public function serverGroups()
 {
     Logger::debug('main', 'USERSGROUP::serversGroups (for id=' . $this->getUniqueID() . ')');
     $ApplicationsGroupDB = ApplicationsGroupDB::getInstance();
     $groups = Abstract_Liaison::load('UsersGroupServersGroup', $this->getUniqueID(), NULL);
     if (!is_array($groups)) {
         Logger::error('main', 'USERSGROUP::serversGroups (for id=' . $this->getUniqueID() . ') result query is false');
         return NULL;
     }
     $result = array();
     foreach ($groups as $UGAG_liaison) {
         $g = Abstract_ServersGroup::load($UGAG_liaison->group);
         if (is_object($g)) {
             $result[$UGAG_liaison->group] = $g;
         }
     }
     return $result;
 }
Ejemplo n.º 2
0
 public function servers_group_publication_remove($users_group_id_, $servers_group_id_)
 {
     $this->check_authorized('managePublications');
     $usersGroupDB = UserGroupDB::getInstance();
     $usersgroup = $usersGroupDB->import($users_group_id_);
     if (!is_object($usersgroup)) {
         Logger::error('api', sprintf("Importing usergroup '%s' failed", $users_group_id_));
         return false;
     }
     $serversgroup = Abstract_ServersGroup::load($servers_group_id_);
     if (!is_object($serversgroup)) {
         Logger::error('api', sprintf("Import of servers group '%s' failed", $servers_group_id_));
         return false;
     }
     $ret = Abstract_Liaison::delete('UsersGroupServersGroup', $usersgroup->getUniqueID(), $serversgroup->id);
     return $ret;
 }