예제 #1
0
function getGroupNames(&$smarty)
{
    /* return number indexed(starting from 0... not group_id) array of group_names 
        on error an empty array is returned and a message is set in smart object
      */
    $group_names_req = new ListGroups();
    list($success, $groups) = $group_names_req->send();
    if ($success) {
        return $groups;
    } else {
        $smarty->set_page_error($admins->getErrorMsgs());
        return array();
    }
}
예제 #2
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);
}