Exemplo n.º 1
0
function GetUsersNumber()
{
    include_once dirname(__FILE__) . "/ressources/class.external.ad.inc";
    $ad = new external_ad_search();
    $users = $ad->NumUsers();
    echo "Users: {$users}\n";
}
Exemplo n.º 2
0
function status_users()
{
    $ldap = new clladp();
    $sock = new sockets();
    if ($ldap->IsKerbAuth()) {
        include_once dirname(__FILE__) . "/ressources/class.external.ad.inc";
        $ad = new external_ad_search();
        $users = $ad->NumUsers();
        return "<tr>\n\t<td width=1%><span id='AdSquidStatusLeft35'><img src='img/member-24.png'></span></td>\n\t<td class=legend nowrap style='font-size:12px'>{members}:</td>\n\t<td><div style='font-size:12px' nowrap>\n\t<a href=\"javascript:blur();\"\n\tOnClick=\"javascript:Loadjs('squid.adker.php',true);\"\n\tstyle='font-size:12px;font-weight:bold;text-decoration:underline'>{$users}</a></td>\n\t</tr>";
    }
    $EnableMacAddressFilter = $sock->GET_INFO("EnableMacAddressFilter");
    if (!is_numeric($EnableMacAddressFilter)) {
        $EnableMacAddressFilter = 1;
    }
    $q = new mysql_squid_builder();
    if ($EnableMacAddressFilter == 1) {
        $sql = "SELECT MAC FROM UserAutDB GROUP BY MAC";
        $results = $q->QUERY_SQL($sql);
        $users = mysql_num_rows($results);
        $js = "Loadjs('squid.UserAutDB.php?filterby=MAC',true);";
    } else {
        $sql = "SELECT ipaddr FROM UserAutDB GROUP BY ipaddr";
        $results = $q->QUERY_SQL($sql);
        $users = mysql_num_rows($results);
        $js = "Loadjs('squid.UserAutDB.php?filterby=ipaddr',true);";
    }
    return "<tr>\n\t<td width=1%><span id='AdSquidStatusLeft35'><img src='img/member-24.png'></span></td>\n\t<td class=legend nowrap style='font-size:12px'>{members}:</td>\n\t<td><div style='font-size:12px' nowrap>\n\t<a href=\"javascript:blur();\"\n\tOnClick=\"javascript:{$js}\"\n\tstyle='font-size:12px;font-weight:bold;text-decoration:underline'>{$users}</a></td>\n\t</tr>";
}