$max_execution_time = ini_get('max_execution_time'); $GLOBALS["SESSIONS"] = unserialize(@file_get_contents("/etc/squid3/" . basename(__FILE__) . ".cache")); WLOG("[START]: Starting New process with KerbAuthInfos:" . count($GLOBALS["KerbAuthInfos"]) . " Parameters debug = {$GLOBALS["DEBUG_GROUPS"]} AdStatsGroupMethod={$GLOBALS["AdStatsGroupMethod"]}"); ConnectToLDAP(); $external_acl_squid_ldap = new external_acl_squid_ldap(); if ($argv[1] == "--groups") { $GLOBALS["VERBOSE"] = true; $GLOBALS["DEBUG_GROUPS"] = true; $GROUPZ = $external_acl_squid_ldap->GetGroupsFromMember($argv[2]); echo "********************* GROUPS ***********************\n"; echo count($GROUPZ) . "\n\n"; print_r($GROUPZ); echo "\n\n************************************************\n\n\n"; echo "********************* RECURSIVE ***********************\n"; $external_acl_squid_ldap->ADLdap_getgroups($argv[2]); $infos = $external_acl_squid_ldap->ADLdap_userinfos($argv[2]); echo "********************* INFOS ***********************\n"; echo "Organization: " . $external_acl_squid_ldap->GetUserOU($argv[2]) . "\n"; die; } while (!feof(STDIN)) { $content = trim(fgets(STDIN)); if ($content != null) { $AS_TAG = false; if ($GLOBALS["DEBUG_GROUPS"] > 0) { WLOG("receive content...\"{$content}\""); } $array = explode(" ", $content); $member = trim($array[0]); $member = str_replace("%20", " ", $member); $member = AccountDecode($member);
function parseTemplate_sendemail_js() { include_once dirname(__FILE__) . "/ressources/class.sockets.inc"; include_once dirname(__FILE__) . "/ressources/class.user.inc"; include_once dirname(__FILE__) . "/ressources/class.external_acl_squid_ldap.inc"; include_once dirname(__FILE__) . "/ressources/class.templates.inc"; $tpl = new templates(); $your_query_was_sent_to_administrator = $tpl->javascript_parse_text("{your_query_was_sent_to_administrator}", 0); $ARRAY = unserialize(base64_decode($_GET["serialize"])); $client_username = $ARRAY["clientname"]; $SquidGuardIPWeb = $ARRAY["SquidGuardIPWeb"]; $email = null; $t = time(); if ($client_username != null) { $sock = new sockets(); $EnableKerbAuth = intval($sock->GET_INFO("EnableKerbAuth")); if ($EnableKerbAuth == 1) { $ad = new external_acl_squid_ldap(); $array = $ad->ADLdap_userinfos($client_username); $email = $array[0]["mail"][0]; } else { $users = new user($client_username); if (count($users->email_addresses) > 0) { $email = $users->email_addresses[0]; } } } if ($email != null) { echo "\n\t\t// {$client_username}\n\t\tvar xSMTPNotifValues{$t}= function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>3){alert(results);}\n\t\t}\n\t\t\n\t\tfunction SMTPNotifValues{$t}(){\n\t\t\n\t\tvar jqxhr = \$.post( '{$SquidGuardIPWeb}',{'send-smtp-notif':'{$email}','MAIN_ARRAY':'{$_GET["serialize"]}'}, function(result) {\n\t\t\talert( '{$your_query_was_sent_to_administrator}' );\n\t\t})\n\t\t.done(function(result) {\n\t\talert('{$your_query_was_sent_to_administrator}' );\n\t\t})\n\t\t.fail(function() {\n\t\talert( '{$your_query_was_sent_to_administrator}' );\n\t\t})\n\t\t.always(function() {\n\t\t//alert( 'unknown' );\n\t\t});\n\t\t\n\t\t\n\t\t//\tvar XHR = new XHRConnection();\n\t\t//\tXHR.setLockOff();\n\t\t//\tXHR.appendData('send-smtp-notif','{$email}');\n\t\t//\tXHR.appendData('MAIN_ARRAY','{$_GET["serialize"]}');\n\t\t//\tXHR.sendAndLoad('{$SquidGuardIPWeb}', 'POST',xSMTPNotifValues{$t});\n\t\t}\n\t\tSMTPNotifValues{$t}();"; return; } $tpl = new templates(); $title = $tpl->javascript_parse_text("{give_your_email_address}"); echo " //{$client_username}\n\tvar xSMTPNotifValues{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);}\n\t}\n\t\n\tfunction SMTPNotifValues{$t}(){\n\t\tvar email=prompt('{$title}');\n\t\tif(!email){return;}\n\t\t\n\t\tvar jqxhr = \$.post( '{$SquidGuardIPWeb}',{'send-smtp-notif':email,'MAIN_ARRAY':'{$_GET["serialize"]}'}, function(result) {\n\t\t\talert( '{$your_query_was_sent_to_administrator}' );\n\t\t})\n\t\t.done(function(result) {\n\t\t\talert('{$your_query_was_sent_to_administrator}' );\n\t\t})\n\t\t.fail(function(xhr, textStatus, errorThrown){\n\t\t\t alert('{$your_query_was_sent_to_administrator}' +xhr.responseText);\n\t\t\t \t\t \n\t\t})\n\t\t.always(function() {\n\t\t //none\n\t\t});\n\t\t\n\t\t\n\t\t//var XHR = new XHRConnection();\n\t\t//XHR.appendData('send-smtp-notif',email);\n\t\t//XHR.appendData('MAIN_ARRAY','{$_GET["serialize"]}');\n\t\t//XHR.sendAndLoad('{$SquidGuardIPWeb}', 'POST',xSMTPNotifValues{$t});\n\t}\n\tSMTPNotifValues{$t}();"; return; }
<?php include_once dirname(__FILE__) . "/ressources/class.user.inc"; include_once dirname(__FILE__) . "/ressources/class.groups.inc"; include_once dirname(__FILE__) . "/ressources/class.ldap.inc"; include_once dirname(__FILE__) . "/ressources/class.system.network.inc"; include_once dirname(__FILE__) . "/ressources/class.dansguardian.inc"; include_once dirname(__FILE__) . "/ressources/class.squid.inc"; include_once dirname(__FILE__) . "/ressources/class.squidguard.inc"; include_once dirname(__FILE__) . "/ressources/class.mysql.inc"; include_once dirname(__FILE__) . "/ressources/class.compile.ufdbguard.inc"; include_once dirname(__FILE__) . "/ressources/class.compile.dansguardian.inc"; include_once dirname(__FILE__) . '/framework/class.unix.inc'; include_once dirname(__FILE__) . "/framework/frame.class.inc"; include_once dirname(__FILE__) . '/ressources/class.ufdbguard-tools.inc'; include_once dirname(__FILE__) . "/ressources/class.os.system.inc"; include_once dirname(__FILE__) . "/ressources/class.external_acl_squid_ldap.inc"; $GLOBALS["VERBOSE"] = true; ini_set('display_errors', 1); ini_set('error_reporting', E_ALL); ini_set('error_prepend_string', null); ini_set('error_append_string', null); $ad = new external_acl_squid_ldap(); $array = $ad->ADLdap_userinfos("david"); $email = $array[0]["mail"][0]; echo $email . "\n";