Example #1
0
function getAllGroupInfos()
{
    /*
    	returns (TRUE,group_infos) or (FALSE,$err_obj)
    	group_infos: a list of associative dictionaries containing all group informations
    */
    $group_infos = array();
    $group_names_request = new ListGroups();
    list($success, $group_names) = $group_names_request->send();
    if (!$success) {
        return array(FALSE, $group_names);
    }
    $group_info_request = new GetGroupInfo("");
    foreach ($group_names as $group_name) {
        $group_info_request->changeParam("group_name", $group_name);
        list($success, $group_info) = $group_info_request->send();
        if (!$success) {
            return array(FALSE, $group_info);
        }
        $group_infos[] = $group_info;
    }
    return array(TRUE, $group_infos);
}
Example #2
0
function getGroupInfoWithCache($group_name)
{
    /*
        return array($success,$group_info) of group with name $group_name
        of failuer $success is false, and second member of returned array is error message
    */
    global $group_info_cache;
    if (!isset($group_info_cache)) {
        $group_info_cache = array();
    }
    if (isset($group_info_cache[$group_name])) {
        return array(TRUE, $group_info_cache[$group_name]);
    } else {
        $req = new GetGroupInfo($group_name);
        $resp = $req->sendAndRecv();
        if ($resp->isSuccessful()) {
            $group_info_cache[$group_name] = $resp->getResult();
            return array(TRUE, $resp->getResult());
        } else {
            return array(FALSE, $resp->getError());
        }
    }
}
Example #3
0
 function getGroupAttrs($group_name)
 {
     $group_info_req = new GetGroupInfo($group_name);
     list($success, $group_info) = $group_info_req->send();
     if ($success) {
         return $group_info["attrs"];
     } else {
         $this->showEditInterface($group_info);
     }
 }