本文整理汇总了PHP中squidbee::SaveToLdap方法的典型用法代码示例。如果您正苦于以下问题:PHP squidbee::SaveToLdap方法的具体用法?PHP squidbee::SaveToLdap怎么用?PHP squidbee::SaveToLdap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类squidbee
的用法示例。
在下文中一共展示了squidbee::SaveToLdap方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: change_value
function change_value($key,$val){
$squid=new squidbee();
$squid->global_conf_array[$key]=$val;
$squid->SaveToLdap();
echo "Starting......: Squid change $key to $val (squid will be restarted)\n";
}
示例2: sizelimit_save
function sizelimit_save()
{
$squid = new squidbee();
$squid->global_conf_array["request_header_max_size"] = $_GET["request_header_max_size"];
$squid->global_conf_array["request_body_max_size"] = $_GET["request_body_max_size"];
$squid->global_conf_array["reply_body_max_size"] = $_GET["reply_body_max_size"];
$squid->SaveToLdap();
}
示例3: Save
function Save()
{
$squid = new squidbee();
$sock = new sockets();
$sock->SET_INFO("SquidMemoryPoolsLimit", $_POST["SquidMemoryPoolsLimit"]);
$sock->SET_INFO("SquidMemoryPoolsLimit", $_POST["SquidMemoryPoolsLimit"]);
if (is_numeric($_POST["cache_mem"])) {
$squid->global_conf_array["cache_mem"] = trim($_POST["cache_mem"]) . " MB";
}
$squid->SaveToLdap(true);
}
示例4: max_filedesc
function max_filedesc()
{
$squid = new squidbee();
if ($_POST["max_filedesc"] < 1024) {
$_POST["max_filedesc"] = 1024;
}
$squid->max_filedesc = $_POST["max_filedesc"];
$squid->SaveToLdap();
$sock = new sockets();
$key = base64_encode("fs.file-max");
$sock->getFrameWork("cmd.php?sysctl-setvalue={$_POST["fs_filemax"]}&key={$key}");
}
示例5: save
function save()
{
$sock = new sockets();
$sock->SET_INFO("CacheReplacementPolicy", $_POST["CacheReplacementPolicy"]);
$sock->SET_INFO("SquidDebugCacheProc", $_POST["SquidDebugCacheProc"]);
$sock->SET_INFO("ForceWindowsUpdateCaching", $_POST["ForceWindowsUpdateCaching"]);
$sock->SET_INFO("ProxyDedicateMicrosoftRules", $_POST["ProxyDedicateMicrosoftRules"]);
$squid = new squidbee();
$squid->global_conf_array["maximum_object_size"] = $_POST["maximum_object_size"] . " MB";
$squid->SaveToLdap(true);
$tpl = new templates();
echo $tpl->javascript_parse_text("{must_restart_proxy_settings}");
}
示例6: save
function save()
{
$sock = new sockets();
if ($_POST["SquidBinIpaddr"] == null) {
$_POST["SquidBinIpaddr"] = "0.0.0.0";
}
$sock->SET_INFO("SquidBinIpaddr", $_POST["SquidBinIpaddr"]);
if (isset($_POST["tcp_outgoing_address"])) {
$squid = new squidbee();
$squid->global_conf_array["tcp_outgoing_address"] = $_POST["tcp_outgoing_address"];
$squid->SaveToLdap(true);
}
}
示例7: xfiledesc
function xfiledesc()
{
$pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
$pidTime = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".time";
$unix = new unix();
$pid = @file_get_contents($pidfile);
if ($unix->process_exists($pid, basename(__FILE__))) {
squid_admin_mysql(0, "Cannot change file descriptors (PID {$pid} already executed)", null, __FILE__, __LINE__);
die;
}
@file_put_contents($pidfile, getmypid());
$TimePid = $unix->file_time_min($pidTime);
if ($TimePid < 5) {
squid_admin_mysql(0, "Cannot change file descriptors ( require 5mn, current {$TimePid}mn)", null, __FILE__, __LINE__);
die;
}
@unlink($pidTime);
@file_put_contents($pidTime, time());
$squid = new squidbee();
$sock = new sockets();
$sysctl = $unix->find_program("sysctl");
$t = time();
if (!is_numeric($squid->max_filedesc)) {
$squid->max_filedesc = 8192;
}
exec("{$sysctl} -n fs.file-max", $results);
$file_max = intval(trim(@implode("", $results)));
$file_max_org = $file_max;
$max_filedesc = intval($squid->max_filedesc);
if ($max_filedesc == 0) {
$max_filedesc = 8192;
}
$new_max_filedesc = $max_filedesc + 1000;
echo "Current System: {$file_max}, Proxy {$max_filedesc}\n";
if ($new_max_filedesc > $file_max - 100) {
$file_max = $file_max + 1000;
shell_exec("{$sysctl} -w fs.file-max={$file_max}");
$unix->sysctl("fs.file-max", $file_max);
}
$squid->max_filedesc = $new_max_filedesc;
$squid->SaveToLdap(true);
$php = $unix->LOCATE_PHP5_BIN();
shell_exec("{$php} /usr/share/artica-postfix/exec.squid.php --build --force");
squid_admin_mysql(0, "Restarting Proxy service to increase file descriptors from {$max_filedesc}/{$file_max_org} to {$new_max_filedesc}/{$file_max}", null, __FILE__, __LINE__);
shell_exec("/etc/init.d/squid restart --force");
}
示例8: time_save
function time_save(){
$tpl=new templates();
if($_GET["time_day"]==null){echo $tpl->_ENGINE_parse_body("{day}: Wrong!\n");exit;}
$squid=new squidbee();
$squid->acl_times["time:{$_GET["gpid"]}:{$_GET["ou"]}"][$_GET["time_day"]]="{$_GET["time_hour"]}:{$_GET["time_min"]}-{$_GET["end_time_hour"]}:{$_GET["end_time_min"]}";
$squid->SaveToLdap();
echo $tpl->_ENGINE_parse_body("{$_GET["time_hour"]}:{$_GET["time_min"]}-{$_GET["end_time_hour"]}:{$_GET["end_time_min"]}:{success}\n");
}
示例9: listen_port_save
function listen_port_save()
{
$squid = new squidbee();
$squid->listen_port = $_GET["listenport"];
if (!$squid->SaveToLdap()) {
echo $squid->ldap_error;
exit;
} else {
$tpl = new templates();
echo $tpl->_ENGINE_parse_body('Port:{success}');
}
}
示例10: SQUID_DELETE_CACHE
function SQUID_DELETE_CACHE($value)
{
$value = unserialize(base64_decode($value));
if (!is_array($value)) {
send_email_events("Failed to add/modify squid cache (not an array)", null, "CLOUD");
return true;
}
include_once dirname(__FILE__) . '/ressources/class.squid.inc';
$sock = new sockets();
$squid = new squidbee();
unset($squid->cache_list[$value["cache_directory"]]);
$squid->SaveToLdap();
$squid->SaveToServer();
$sock = new sockets();
$SquidCacheTasks = unserialize(base64_decode($sock->GET_INFO("SquidCacheTask")));
$SquidCacheTasks[$value["cache_directory"]] = $_GET;
$sock->SaveConfigFile(base64_encode(serialize($SquidCacheTasks)), "SquidCacheTask");
$sock->getFrameWork("cmd.php?squid-build-caches=yes");
send_email_events("Success removing squid cache \"{$value["cache_directory"]}\"", "Squid was scheduled to be reloaded.\n", "CLOUD");
return true;
}
示例11: enable_ftp_restrictions
function enable_ftp_restrictions()
{
$s = new squidbee();
$s->enable_ftp_restrictions = $_GET["enable_ftp_restrictions"];
$s->SaveToLdap();
}
示例12: enable_snmp
function enable_snmp(){
$squid=new squidbee();
$squid->snmp_enable=$_POST["enable_snmp"];
$squid->snmp_community=$_POST["snmp_community"];
$squid->snmp_port=$_POST["snmp_port"];
$squid->snmp_access_ip=$_POST["snmp_access_ip"];
$squid->SaveToLdap();
}
示例13: visible_hostname_save
function visible_hostname_save()
{
$page = CurrentPageName();
$tpl = new templates();
$squid = new squidbee();
$hostid = $_POST["hostid"];
$nodeid = $_POST["nodeid"];
$visible_hostname = $_POST["visible_hostname"];
$squid->nodes_names[$hostid] = $visible_hostname;
$squid->SaveToLdap(true);
$q = new blackboxes($hostid);
$q->reconfigure_squid();
}
示例14: proxy_behavior_save
function proxy_behavior_save()
{
$squid = new squidbee();
$sock = new sockets();
$exclusive_reverse_proxy = $_POST["exclusive_reverse_proxy"];
$exclusive_internet_proxy = $_POST["exclusive_internet_proxy"];
$mixed_mode = $_POST["mixed_mode"];
if ($exclusive_reverse_proxy == 1) {
$sock->SET_INFO("SquidActHasReverse", 1);
$sock->SET_INFO("SquidActHasReverseOnly", 1);
$sock->SET_INFO("SquidOldHTTPPort", $squid->listen_port);
$sock->SET_INFO("SquidOldHTTPPort2", $squid->second_listen_port);
$sock->SET_INFO("SquidOldSSLPort", $squid->ssl_port);
$squid->listen_port = 80;
$squid->second_listen_port = 0;
$squid->ICP_PORT = 0;
$squid->HTCP_PORT = 0;
$squid->ssl_port = 443;
if (!$squid->SaveToLdap()) {
echo $squid->ldap_error;
return;
}
return;
}
if ($exclusive_internet_proxy == 1) {
$SquidOldHTTPPort = $sock->GET_INFO("SquidOldHTTPPort");
$SquidOldSSLPort = $sock->GET_INFO("SquidOldSSLPort");
$SquidOldHTTPPort2 = $sock->GET_INFO("SquidOldHTTPPort2");
$sock->SET_INFO("SquidActHasReverse", 0);
$sock->SET_INFO("SquidActHasReverseOnly", 0);
if (is_numeric($SquidOldHTTPPort)) {
if ($SquidOldHTTPPort > 0) {
$squid->listen_port = $SquidOldHTTPPort;
}
}
if (is_numeric($SquidOldHTTPPort2)) {
if ($SquidOldHTTPPort2 > 0) {
$squid->second_listen_port = $SquidOldHTTPPort2;
}
}
if (is_numeric($SquidOldSSLPort)) {
if ($SquidOldSSLPort > 0) {
$squid->ssl_port = $SquidOldSSLPort;
}
}
if (!$squid->SaveToLdap()) {
echo $squid->ldap_error;
return;
}
return;
}
if ($mixed_mode == 1) {
$sock->SET_INFO("SquidActHasReverse", 1);
if ($squid->listen_port != 80) {
$sock->SET_INFO("SquidOldHTTPPort", $squid->listen_port);
$sock->SET_INFO("SquidOldHTTPPort2", $squid->second_listen_port);
$squid->second_listen_port = $squid->listen_port;
$squid->listen_port = 80;
}
if ($squid->ssl_port != 443) {
$sock->SET_INFO("SquidOldSSLPort", $squid->listen_port);
$squid->listen_port = 443;
}
if (!$squid->SaveToLdap()) {
echo $squid->ldap_error;
return;
}
}
$sock = new sockets();
$sock->getFrameWork("cmd.php?restart-apache-src=yes");
}
示例15: delete_cache
function delete_cache()
{
$cachedir = base64_decode($_POST["delete-cache"]);
$squid = new squidbee();
unset($squid->cache_list[$cachedir]);
$sock = new sockets();
$squid->SaveToLdap(true);
$squid->SaveToServer(true);
$sock->getFrameWork("squid.php?remove-cache={$_POST["delete-cache"]}");
}