function ShowOrganizations()
{
    $usersmenus = new usersMenus();
    if ($usersmenus->AsArticaAdministrator == true) {
        $orgs = ORGANISATIONS_LIST();
    } else {
        if ($usersmenus->AllowAddGroup == true && $usersmenus->AsArticaAdministrator == false) {
            $orgs = ORGANISTATION_FROM_USER();
        }
    }
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($orgs);
}
function GROUPS_LIST($OU)
{
    writelogs("startup ou={$OU}", __FUNCTION__, __FILE__);
    $page = CurrentPageName();
    $ou = $OU;
    if (is_base64_encoded($ou)) {
        $ou = base64_decode($ou);
    }
    writelogs("Encoded ou ? =\"{$ou}\" {$_SESSION["uid"]}", __FUNCTION__, __FILE__);
    $ldap = new clladp();
    $users = new usersMenus();
    if ($users->AsArticaAdministrator) {
        writelogs("AsArticaAdministrator privileges", __FUNCTION__, __FILE__);
        $org = $ldap->hash_get_ou(true);
        while (list($ou1, $ou2) = each($org)) {
            $orgs_encoded[base64_encode($ou1)] = $ou2;
        }
        //$orgs=Field_array_Hash($orgs_encoded,'SelectOuList',base64_encode($ou),"LoadGroupList()",null,0,'width:250px');
        $hash = $ldap->hash_groups($ou, 1);
        writelogs("AsArticaAdministrator:: Load " . count($hash) . " groups from ou {$ou}", __FUNCTION__, __FILE__);
    } else {
        $ou = ORGANISTATION_FROM_USER();
        //$orgs="<strong>$ou</strong><input type='hidden' name=SelectOuList id='SelectOuList' value='$ou'>";
        if (!$users->AsOrgAdmin) {
            $hash = $ldap->UserGetGroups($_SESSION["uid"], 1);
        }
        if ($users->AsOrgAdmin) {
            $hash = $ldap->hash_groups($ou, 1);
        }
    }
    if (is_array($hash)) {
        while (list($num, $line) = each($hash)) {
            if (strtolower($line) == 'default_group') {
                unset($hash["{$num}"]);
            }
            $tr[] = $num;
        }
    }
    $orgs = Field_hidden("SelectOuList", base64_encode($ou));
    writelogs("Load " . count($hash) . " groups from ou {$ou}", __FUNCTION__, __FILE__);
    $hash[null] = "{select_group}";
    reset($hash);
    $field = Field_array_Hash($hash, 'SelectGroupList', null, "LoadGroupSettings()", null, 0, 'width:250px');
    $html = "\n\t{$orgs}\n\t<table style='width:300px'>\n\t<td width=80%>{$field}</td>\n\t<td width=1%>" . imgtootltip('20-refresh.png', '{refresh}', "RefreshGroupList()") . "</td>\n\t<td width=1%>" . button("{add}", "Loadjs('{$page}?popup-add-group=yes&ou={$ou}')") . "</td>\n\t</tr>\n\t</table>\n\t\n\t<script>\n\tfunction RefreshGroupList(){\n\t\t\tLoadAjax('grouplist','{$page}?LoadGroupList={$ou}')\n\t\t\n\t\t}\n\t\n\tLoadGroupSettings('{$tr[0]}');\t\n\t</script>\n\t\n\t\n\t";
    $tpl = new templates();
    return $tpl->_ENGINE_parse_body($html);
}
function js_popup_old()
{
    $tpl = new templates();
    $ou = base64_decode($_GET["ou"]);
    $page = CurrentPageName();
    if ($ou == null) {
        $ou = ORGANISTATION_FROM_USER();
    }
    $title = $ou . ":&nbsp;{groups}";
    $users = new usersMenus();
    $sock = new sockets();
    $InternetDomainsAsOnlySubdomains = $sock->GET_INFO("InternetDomainsAsOnlySubdomains");
    if (!is_numeric($InternetDomainsAsOnlySubdomains)) {
        $InternetDomainsAsOnlySubdomains = 0;
    }
    $add_local_domain_form_text = $tpl->javascript_parse_text("{add_local_domain_form}");
    $POSTFIX_INSTALLED = $users->POSTFIX_INSTALLED;
    if ($users->ZARAFA_INSTALLED) {
        $users->cyrus_imapd_installed = true;
    }
    $add_local_domain = Paragraphe("64-localdomain-add.png", '{add_local_domain}', '{add_local_domain_text}', "javascript:AddLocalDomain_form()", "add_local_domain", 210);
    $add_remote_domain = Paragraphe("64-remotedomain-add.png", '{add_relay_domain}', '{add_relay_domain_text}', "javascript:AddRemoteDomain_form(\"{$ou}\",\"new domain\")", "add_relay_domain", 210);
    $local_js = "LoadAjax('LocalDomainsList','{$page}?organization-local-domain-list={$ou}');";
    $import_domains = Paragraphe("64-import.png", '{import_smtp_domains}', '{import_smtp_domains_text}', "javascript:Loadjs('domains.import.domains.php?ou={$_GET["ou"]}')", "{import_smtp_domains}", 210);
    $local_part = "<div id='LocalDomainsList' style='width:100%;overflow:auto'></div>";
    $remote_part = "<div id='RelayDomainsList' style='width:100%;overflow:auto'></div>";
    $remote_js = "LoadAjax('RelayDomainsList','{$page}?organization-relay-domain-list={$ou}');";
    if (!$POSTFIX_INSTALLED) {
        $add_remote_domain = "<p>&nbsp;</p>";
        $remote_part = null;
        $remote_js = null;
    }
    if (!$users->cyrus_imapd_installed) {
        $add_local_domain_warn = "<div class=explain>{no_backendmailbox_installed_explain}</div>";
    }
    $ouescape = urlencode($ou);
    $html = "\n\t<input type='hidden' id='inputbox delete' value=\"{are_you_sure_to_delete}\">\n\t<input type='hidden' id='add_local_domain_form' value=\"{add_local_domain_form}\">\n\t<input type='hidden' id='ou' value='{$ou}'>\t\t\n\t<div id='NavigationForms2'>{$add_local_domain_warn}\n\t{$local_part}\n\t<p>&nbsp;</p>\n\t{$remote_part}\n\t</div>\n\t<br>\n\t<center><table><tr><td>{$add_local_domain}</td><td>{$add_remote_domain}</td><td>{$import_domains}</td></tr></table></center>\n<script>\n\n\tvar x_AddLocalDomain_form= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);}\n\t\tLoadAjax('LocalDomainsList','{$page}?LocalDomainList=yes&ou={$ou}');\n\t}\n\n\nfunction AddLocalDomain_form(){\n\tvar InternetDomainsAsOnlySubdomains={$InternetDomainsAsOnlySubdomains};\n\tif(InternetDomainsAsOnlySubdomains==1){\n\t\tLoadjs('domains.add.localdomain.restricted.php?ou={$ouescape}');\n\t\treturn;\n\t}\n\tvar domain=prompt('{$add_local_domain_form_text}');\n\tif(domain){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('AddNewInternetDomain','{$ouescape}');\n\t\tXHR.appendData('AddNewInternetDomainDomainName',domain);\t\t\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_AddLocalDomain_form);\n\t\t}\n\t}\n\t{$local_js}\n\t{$remote_js}\n</script>\n\n";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Exemple #4
0
function ShowOrganizations()
{
    $usersmenus = new usersMenus();
    if ($usersmenus->AsArticaAdministrator == true) {
        ORGANISATIONS_LIST();
    } else {
        if ($usersmenus->AllowAddGroup == true && $usersmenus->AsArticaAdministrator == false) {
            ORGANISTATION_FROM_USER();
        }
    }
}
Exemple #5
0
function ShowOrganizations()
{
    $usersmenus = new usersMenus();
    if ($usersmenus->AsArticaAdministrator == true) {
        if ($GLOBALS["VERBOSE"]) {
            echo "ORGANISATIONS_LIST()<br>\n";
        }
        ORGANISATIONS_LIST();
    } else {
        if ($usersmenus->AllowAddGroup == true && $usersmenus->AsArticaAdministrator == false) {
            if ($GLOBALS["VERBOSE"]) {
                echo "ORGANISTATION_FROM_USER()<br>\n";
            }
            ORGANISTATION_FROM_USER();
        }
    }
}
if (!isset($_SESSION["uid"])) {
    die;
}
if ($_GET["ou"] == null) {
    if ($_COOKIE["SwitchOrgTabsOu"] != null) {
        $_GET["ou"] = $_COOKIE["SwitchOrgTabsOu"];
    }
}
$user = new usersMenus();
if ($_GET["ou"] == null) {
    if ($user->AsArticaAdministrator) {
        $ldap = new clladp();
        $hash = $ldap->hash_get_ou(false);
        $_GET["ou"] = $hash[0];
    } else {
        $_GET["ou"] = $hash[0] = ORGANISTATION_FROM_USER();
    }
}
if ($_GET["ou"] != null) {
    header("location:domains.manage.org.index.php?ou={$_GET["ou"]}");
} else {
    header("location:domains.index.php");
}
function ORGANISTATION_FROM_USER()
{
    $ldap = new clladp();
    $hash = $ldap->Hash_Get_ou_from_users($_SESSION["uid"], 1);
    if (is_array($hash)) {
        return $hash[0];
    }
}
function js_popup()
{
    $ou = base64_decode($_GET["ou"]);
    $page = CurrentPageName();
    if ($ou == null) {
        $ou = ORGANISTATION_FROM_USER();
    }
    $title = $ou . ":&nbsp;{groups}";
    $users = new usersMenus();
    $POSTFIX_INSTALLED = $users->POSTFIX_INSTALLED;
    if ($users->ZARAFA_INSTALLED) {
        $users->cyrus_imapd_installed = true;
    }
    $add_local_domain = Paragraphe("64-localdomain-add.png", '{add_local_domain}', '{add_local_domain_text}', "javascript:AddLocalDomain_form()", "add_local_domain", 210);
    $add_remote_domain = Paragraphe("64-remotedomain-add.png", '{add_relay_domain}', '{add_relay_domain_text}', "javascript:AddRemoteDomain_form(\"{$ou}\",\"new domain\")", "add_relay_domain", 210);
    $local_js = "LoadAjax('LocalDomainsList','{$page}?organization-local-domain-list={$ou}');";
    $local_part = "<div style='font-size:14px;font-weight:bolder;color:#005447;width:100%;border-bottom:1px solid #005447;margin-bottom:5px'>\n\t\t{local_domain_map}:\n\t</div>\n\t<div id='LocalDomainsList' style='width:100%;overflow:auto'></div>\n\t<br>\n\t<br>";
    $remote_part = "\n\t<div style='font-size:14px;font-weight:bolder;color:#005447;width:100%;border-bottom:1px solid #005447;margin-bottom:5px'>{relay_domain_map}:</h3>\n\t<div id='RelayDomainsList' style='width:100%;overflow:auto'></div>\n\t<br>";
    $remote_js = "LoadAjax('RelayDomainsList','{$page}?organization-relay-domain-list={$ou}');";
    if (!$POSTFIX_INSTALLED) {
        $add_remote_domain = "<p>&nbsp;</p>";
        $remote_part = null;
        $remote_js = null;
    }
    if (!$users->SAMBA_INSTALLED) {
        if (!$users->cyrus_imapd_installed) {
            $add_local_domain = null;
            $local_part = null;
            $local_js = null;
        }
    }
    $html = "\n\t<input type='hidden' id='inputbox delete' value=\"{are_you_sure_to_delete}\">\n\t<input type='hidden' id='add_local_domain_form' value=\"{add_local_domain_form}\">\n\t<input type='hidden' id='ou' value='{$ou}'>\t\t\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top'><br>\n\t{$local_part}\n\t{$remote_part}\n\t</td>\n\t<td valign='top' width=1%><br>{$add_local_domain}<br>{$add_remote_domain}</td>\n\t</tr>\n\t\n</table>\n<script>\n\t{$local_js}\n\t{$remote_js}\n</script>\n\n";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}