Пример #1
0
function notadmin_status()
{
    $curs = "OnMouseOver=\"this.style.cursor='pointer';\"\n\tOnMouseOut=\"this.style.cursor='auto'\"";
    include_once dirname(__FILE__) . "/ressources/class.user.inc";
    $users = new usersMenus();
    if (!$users->SQUID_INSTALLED) {
        $_SESSION["ACLS_PRIVILEGES"] = null;
    }
    $icon = "member-128.png";
    $ct = new user($_SESSION["uid"]);
    $squid_acls = null;
    if ($ct->AsActiveDirectoryMember) {
        include_once dirname(__FILE__) . "/ressources/class.external.ad.inc";
        $ad = new external_ad_search();
        $DN = $ad->GetDNFromUserid($_SESSION["uid"]);
        $groupsArray = $ad->GroupsOfMember($DN);
        $MyGroups = "\n\t\t\t<tr>\n\t\t\t<td style='font-size:30px;text-decoration:underline'\n\t\t\t\tOnClick=\"javascript:{$js}\" {$curs}>{$ct->mail}\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td style='font-size:18px;vertical-align:top'>{gidNumber} " . count($groupsArray) . " {groups2}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td style='font-size:18px;vertical-align:top'>{organization} <strong>{$ct->ou}</strong></td>\n\t\t</tr>\n\t\t";
    } else {
        $MEMBER_JS = "javascript:blur();";
        $OU_js = "javascript:blur();";
        $OU_decoration = "none";
        $OU_curs = null;
        if ($users->AllowChangeUserPassword) {
            $MEMBER_JS = MEMBER_JS($_SESSION["uid"]);
        }
        if (VerifyRights_ou()) {
            $OU_js = "javascript:Loadjs('domains.manage.org.index.php?js=yes&ou={$ct->ou}');";
            $OU_decoration = "underline";
            $OU_curs = $curs;
        }
        $MyGroups = "\n\t\t<tr>\n\t\t<td style='font-size:16px;text-decoration:underline'\n\t\tOnClick=\"{$MEMBER_JS}\" {$curs}>{myaccount}: {$ct->mail}\n\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td style='font-size:18px;vertical-align:top'>{my_organization} <strong OnClick=\"{$OU_js}\" {$curs} style='text-decoration:{$OU_decoration}'>{$ct->ou}</strong></td>\n\t\t</tr>\n\t\t";
    }
    if ($users->SQUID_INSTALLED) {
        if (!isset($_SESSION["ACLS_PRIVILEGES"])) {
            include_once dirname(__FILE__) . "/ressources/class.squid.acls.privileges.inc";
            $f = new squid_acls_privileges();
            $_SESSION["ACLS_PRIVILEGES"] = $f->build();
        }
        $squid_acls = $_SESSION["ACLS_PRIVILEGES"];
        if ($squid_acls != null) {
            $squid_acls = "<tr><td>{$squid_acls}</td></tr>";
        }
    }
    $html = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' style='width:128px'>\n\t<img src='img/{$icon}'>\n\t</td>\n\t<td style='width:99%'>\n\t<table style='width:100%'>\n\t<tr>\n\t<td style='font-size:30px;vertical-align:top'>{$ct->DisplayName}</td>\n\t</tr>\n\t{$MyGroups}\n\t{$squid_acls}\n\n\t</table>\n\t</td>\n\t</tr>\n\t</table>\n\t";
    $tpl = new templates();
    return $tpl->_ENGINE_parse_body($html);
}