本文整理汇总了PHP中Bs_IniHandler::loadString方法的典型用法代码示例。如果您正苦于以下问题:PHP Bs_IniHandler::loadString方法的具体用法?PHP Bs_IniHandler::loadString怎么用?PHP Bs_IniHandler::loadString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bs_IniHandler
的用法示例。
在下文中一共展示了Bs_IniHandler::loadString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: statusof
function statusof()
{
$appname = $_GET["statusof"];
$file = dirname(__FILE__) . "/ressources/install/{$appname}.ini";
$ini = new Bs_IniHandler();
if (file_exists($file)) {
$data = file_get_contents($file);
$ini->loadString($data);
$pourc = $ini->_params["INSTALL"]["STATUS"];
$text_info = $ini->_params["INSTALL"]["INFO"];
if (strlen($text_info) > 0) {
$text_info = "<span style='color:white;font-size:10px'>{$text_info}...</span>";
}
} else {
$pourc = 0;
}
$color = "#5DD13D";
if ($pourc == "110") {
$color = "#CC4B1C";
$pourc = "100";
}
$html = "\n\t<input type='hidden' id='int-progress' value='{$pourc}'>\n\t<div style='width:{$pourc}%;text-align:center;color:white;padding-top:3px;padding-bottom:3px;background-color:{$color}'>\n\t\t<strong style='color:#BCF3D6;font-size:12px;font-weight:bold'>{$pourc}% {$text_info}</strong></center>\n\t</div>\n";
$tpl = new templates();
echo $tpl->_ENGINE_parse_body($html);
}
示例2: refresh_service_status
function refresh_service_status()
{
if (!$GLOBALS["VERBOSE"]) {
if (GET_CACHED(__FILE__, __FUNCTION__, md5($_GET["refresh-service-status"]), false, 1)) {
return;
}
}
$refresh["C-ICAP"] = "APP_C_ICAP";
if (preg_match("#SERVICE-STATUS-ROUND-(.+)#", $_GET["refresh-service-status"], $re)) {
$tpl = new templates();
$key = $re[1];
if ($GLOBALS["VERBOSE"]) {
echo "Prod: {$key}\n<br>";
}
$content = GetIniContent($key);
if ($content == null) {
if (!is_file("ressources/logs/global.status.ini")) {
return;
}
$bsini = new Bs_IniHandler("ressources/logs/global.status.ini");
} else {
$bsini = new Bs_IniHandler();
$bsini->loadString($content);
}
if ($bsini->_params[$key]["service_name"] == null) {
return null;
}
$prod = $bsini->_params[$key]["service_name"];
$status = DAEMON_STATUS_ROUND($key, $bsini);
$html = $tpl->_ENGINE_parse_body($status);
SET_CACHED(__FILE__, __FUNCTION__, md5($_GET["refresh-service-status"]), $html);
echo $html;
}
}
示例3: LaunchScan
function LaunchScan($host){
$debug=$_GET["D"];
if(strpos($host,'$')==0){$host=$host.'$';}
events("LaunchScan(): Scanning $host");
$computer=new computers($host);
$ini=new Bs_IniHandler();
$ini->loadString($computer->KasperkyAVScanningDatas);
$commandline=BuildOptionCommandLine($ini,$computer->ComputerRealName);
$ini=new Bs_IniHandler();
$ini->loadString($computer->ComputerCryptedInfos);
$username=$ini->_params["ACCOUNT"]["USERNAME"];
$password=$ini->_params["ACCOUNT"]["PASSWORD"];
$ping=new ping($computer->ComputerIP);
if(!$ping->Isping()){
events("LaunchScan(): unable to ping computer...");
return false;
}
events("LaunchScan(): to ping computer OK...");
if(smbmount($computer->ComputerIP,$username,$password,$commandline)){
}else{
events("LaunchScan(): unable to mount $computer->ComputerIP");
}
}
示例4: lighttpd_status
function lighttpd_status()
{
$ini = new Bs_IniHandler();
$sock = new sockets();
$tpl = new templates();
$page = CurrentPageName();
$ini->loadString(base64_decode($sock->getFrameWork('services.php?lighttpd-status=yes')));
$LIGHTTPD = DAEMON_STATUS_ROUND("LIGHTTPD", $ini, null, 1);
$LIGHTTPD_PID = $ini->_params["LIGHTTPD"]["master_pid"];
$FRAMEWORK = DAEMON_STATUS_ROUND("FRAMEWORK", $ini, null, 1);
$FRAMEWORK_PID = $ini->_params["FRAMEWORK"]["master_pid"];
$php_cgi_array = unserialize(base64_decode($sock->getFrameWork('services.php?php-cgi-array=yes')));
$LIGHTTPD_AR[] = "<table style='width:99%' class=form>";
while (list($pid, $array) = each($php_cgi_array[$LIGHTTPD_PID])) {
$RSS = FormatBytes($array["RSS"]);
$VM = FormatBytes($array["VM"]);
$TTL = $array["TTL"];
$LIGHTTPD_AR[] = "<tr>\n\t\t<td><strong style='font-size:12px'>PID:{$pid}</strong></td>\n\t\t<td><strong style='font-size:12px'>RSS:{$RSS}</strong></td>\n\t\t<td><strong style='font-size:12px'>VM:{$VM}</strong></td>\n\t\t<td><strong style='font-size:12px'>TTL:{$TTL}</strong></td>\n\t\t</tr>\n\t\t";
}
$LIGHTTPD_AR[] = "</table>";
$LIGHTTPDF_AR[] = "<table style='width:99%' class=form>";
while (list($pid, $array) = each($php_cgi_array[$FRAMEWORK_PID])) {
$RSS = FormatBytes($array["RSS"]);
$VM = FormatBytes($array["VM"]);
$TTL = $array["TTL"];
$LIGHTTPDF_AR[] = "<tr>\n\t\t<td><strong style='font-size:12px'>PID:{$pid}</strong></td>\n\t\t<td><strong style='font-size:12px'>RSS:{$RSS}</strong></td>\n\t\t<td><strong style='font-size:12px'>VM:{$VM}</strong></td>\n\t\t<td><strong style='font-size:12px'>TTL:{$TTL}</strong></td>\n\t\t</tr>\n\t\t";
}
$LIGHTTPDF_AR[] = "</table>";
$html = "<table style='width:99%' class=form>\n\t<tr>\n\t\t<td>{$LIGHTTPD} " . @implode("\n", $LIGHTTPD_AR) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td><hr></td>\n\t</tr>\n\t<tr>\n\t\t<td>{$FRAMEWORK}" . @implode("\n", $LIGHTTPDF_AR) . "</td>\n\t</tr>\n\t</table>\t\n\t";
echo $tpl->_ENGINE_parse_body($html);
}
示例5: export_ou_http
function export_ou_http($ou, $session)
{
$sock = new sockets();
$ldap = new clladp();
$path = "/root";
echo "Exporting meta informations session {$session} for ou=`{$ou}`\n";
export($ou, $path);
$sock = new sockets();
$ini = new Bs_IniHandler();
echo "Reading session {$session} for ou=`{$ou}`\n";
if ($ou == null) {
echo "Failed, no such ou set....\n";
die;
}
$ini->loadString($sock->GET_INFO($session));
$filepath = "{$path}/{$ou}.gz";
if (!is_file($filepath)) {
echo "{$filepath} no such file";
}
echo "Uploading to https://{$ini->_params["CONF"]["servername"]}:{$ini->_params["CONF"]["port"]}\n";
$uri = "https://{$ini->_params["CONF"]["servername"]}:{$ini->_params["CONF"]["port"]}/cyrus.murder.listener.php";
$command = "?export-ou=yes&admin={$ini->_params["CONF"]["username"]}&pass={$ini->_params["CONF"]["password"]}&original-suffix={$ldap->suffix}";
//lic.users.import.php
$http = new httpget();
$http->uploads["EXPORT-OU"] = "{$filepath}";
$body = $http->send("https://{$ini->_params["CONF"]["servername"]}:{$ini->_params["CONF"]["port"]}/cyrus.murder.listener.php", "post", array("AUTH" => base64_encode(serialize($ini->_params["CONF"])), "ORG" => $ou));
@unlink($filepath);
echo $body;
}
示例6: ParseEvents
function ParseEvents()
{
$path = "/var/log/artica-postfix/events";
$f = new filesClasses();
$hash = $f->DirListTable($path);
if (!is_array($hash)) {
return null;
}
echo date('Y-m-d h:i:s') . " " . count($hash) . " file(s) notifications...\n";
$mysql = new mysql();
while (list($num, $file) = each($hash)) {
$text = null;
$processname = null;
$date = null;
$context = null;
$subject = null;
$recipient = null;
$bigtext = @file_get_contents($path . '/' . $file);
echo date('Y-m-d h:i:s') . " Parsing {$file} " . strlen($bigtext) . " bytes text\n";
$ini = new Bs_IniHandler();
if (preg_match("#<text>(.+?)</text>#is", $bigtext, $re)) {
$text = $re[1];
if (strlen($text) > 0) {
$bigtext = str_replace($re[0], '', $bigtext);
}
}
if (preg_match("#<attachedfiles>(.+?)</attachedfiles>#is", $bigtext, $re)) {
$files_text = addslashes($re[1]);
}
$ini->loadString($bigtext);
$processname = $ini->_params["LOG"]["processname"];
$date = $ini->_params["LOG"]["date"];
$context = $ini->_params["LOG"]["context"];
$context = addslashes($context);
if (strlen($text) < 2) {
$text = $ini->_params["LOG"]["text"];
}
$text = addslashes($text);
$subject = $ini->_params["LOG"]["subject"];
$recipient = $ini->_params["LOG"]["recipient"];
$subject = addslashes($subject);
echo date('Y-m-d h:i:s') . " Parsing subject {$subject} " . strlen($text) . " bytes text\n";
writelogs("New notification: {$subject} (" . strlen($text) . " bytes)", __FUNCTION__, __FILE__, __LINE__);
$sql = "INSERT INTO events (zDate,hostname,\n \tprocess,text,context,content,attached_files,recipient) VALUES(\n \t'{$date}',\n \t'{$mysql->hostname}',\n \t'{$processname}',\n \t'{$subject}',\n \t'{$context}','{$text}','{$files_text}','{$recipient}')";
echo date('Y-m-d h:i:s') . " run mysql query\n";
if ($mysql->QUERY_SQL($sql, 'artica_events')) {
unlink($path . '/' . $file);
} else {
error_log("Mysql error keep {$path}/{$file};");
error_log("{$mysql->mysql_error}");
if (preg_match("#Unknown column#", $mysql->mysql_error)) {
error_log("->BuildTables()");
$mysql->BuildTables();
}
}
}
if (count($hash) > 0) {
events(count($hash) . " events queue parsed...");
}
}
示例7: popup_status
function popup_status(){
$ini=new Bs_IniHandler();
$sock=new sockets();
$ini->loadString(base64_decode($sock->getFrameWork('cmd.php?backuppc-ini-status=yes')));
$status=DAEMON_STATUS_ROUND("APP_BACKUPPC",$ini);
$page=CurrentPageName();
$html="
<table style='width:100%'>
<tr>
<td valign='top'>
<img src='img/backuppc-128.png'>
<hr>
</td>
<td valign='top'>
$status
</td>
</tr>
</table>
<div style='font-size:14px'>
{APP_BACKUPPC_TEXT}
</div>
<div id='users-backuppc-table'></div>
<script>
//LoadAjax('users-backuppc-table','$page?popup-users=yes');
</script>
";
$tpl=new templates();
echo $tpl->_ENGINE_parse_body($html);
}
示例8: iscsi_status
function iscsi_status(){
$sock=new sockets();
$tpl=new templates();
$ini=new Bs_IniHandler();
$ini->loadString(base64_decode($sock->getFrameWork("cmd.php?iscsi-status=yes")));
$status=DAEMON_STATUS_ROUND("APP_IETD",$ini,null,0);
echo $tpl->_ENGINE_parse_body($status);
}
示例9: page
function page()
{
$users = new usersMenus();
$ini = new Bs_IniHandler();
$page = CurrentPageName();
$tpl = new templates();
$sock = new sockets();
$ini->loadString($sock->getFrameWork("cmd.php?SmtpNotificationConfigRead=yes"));
if ($ini->_params["SMTP"]["smtp_server_port"] == null) {
$ini->_params["SMTP"]["smtp_server_port"] = 25;
}
if ($ini->_params["SMTP"]["smtp_sender"] == null) {
$users = new usersMenus();
$ini->_params["SMTP"]["smtp_sender"] = "artica@{$users->fqdn}";
}
$t = time();
$UfdbguardSMTPNotifs = unserialize(base64_decode($sock->GET_INFO("UfdbguardSMTPNotifs")));
if (!isset($UfdbguardSMTPNotifs["ENABLED"])) {
$UfdbguardSMTPNotifs["ENABLED"] = 0;
}
if (!is_numeric($UfdbguardSMTPNotifs["ENABLED"])) {
$UfdbguardSMTPNotifs["ENABLED"] = 0;
}
$UseRemoteUfdbguardService = $sock->GET_INFO("UseRemoteUfdbguardService");
if (!is_numeric($UseRemoteUfdbguardService)) {
$UseRemoteUfdbguardService = 0;
}
if (!isset($UfdbguardSMTPNotifs["smtp_server_name"])) {
$UfdbguardSMTPNotifs["smtp_server_name"] = $ini->_params["SMTP"]["smtp_server_name"];
}
if (!isset($UfdbguardSMTPNotifs["smtp_server_port"])) {
$UfdbguardSMTPNotifs["smtp_server_port"] = $ini->_params["SMTP"]["smtp_server_port"];
}
if (!isset($UfdbguardSMTPNotifs["smtp_sender"])) {
$UfdbguardSMTPNotifs["smtp_server_port"] = $ini->_params["SMTP"]["smtp_sender"];
}
if (!isset($UfdbguardSMTPNotifs["smtp_dest"])) {
$UfdbguardSMTPNotifs["smtp_dest"] = $ini->_params["SMTP"]["smtp_dest"];
}
if (!isset($UfdbguardSMTPNotifs["smtp_auth_user"])) {
$UfdbguardSMTPNotifs["smtp_dest"] = $ini->_params["SMTP"]["smtp_auth_user"];
}
if (!isset($UfdbguardSMTPNotifs["smtp_auth_passwd"])) {
$UfdbguardSMTPNotifs["smtp_auth_passwd"] = $ini->_params["SMTP"]["smtp_auth_passwd"];
}
if (!isset($UfdbguardSMTPNotifs["tls_enabled"])) {
$UfdbguardSMTPNotifs["tls_enabled"] = $ini->_params["SMTP"]["tls_enabled"];
}
if (!isset($UfdbguardSMTPNotifs["ssl_enabled"])) {
$UfdbguardSMTPNotifs["ssl_enabled"] = $ini->_params["SMTP"]["ssl_enabled"];
}
if (!is_numeric($UfdbguardSMTPNotifs["smtp_server_port"])) {
$UfdbguardSMTPNotifs["smtp_server_port"] = 25;
}
//Switchdiv
$html = "\n\t<div class=explain style='font-size:14px'>{smtp_ufdbguard_notifications_text}</div>\n\t<div id='notif1-{$t}'></div>\n\n\t<table style='width:99%' class=form id='main-form-{$t}'>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:14px'>{smtp_enabled}:</strong></td>\n\t\t<td>" . Field_checkbox("ENABLED", 1, $UfdbguardSMTPNotifs["ENABLED"], "SMTPNotifArticaEnableSwitch{$t}()") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:14px'>{smtp_server_name}:</strong></td>\n\t\t<td>" . Field_text('smtp_server_name', trim($UfdbguardSMTPNotifs["smtp_server_name"]), 'font-size:14px;padding:3px;width:250px') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:14px'>{smtp_server_port}:</strong></td>\n\t\t<td>" . Field_text('smtp_server_port', trim($UfdbguardSMTPNotifs["smtp_server_port"]), 'font-size:14px;padding:3px;width:40px') . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:14px'>{smtp_sender}:</strong></td>\n\t\t<td>" . Field_text('smtp_sender', trim($UfdbguardSMTPNotifs["smtp_sender"]), 'font-size:14px;padding:3px;width:290px') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:14px'>{smtp_dest}:</strong></td>\n\t\t<td>" . Field_text('smtp_dest', trim($UfdbguardSMTPNotifs["smtp_dest"]), 'font-size:14px;padding:3px;width:290px') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:14px'>{smtp_auth_user}:</strong></td>\n\t\t<td>" . Field_text('smtp_auth_user', trim($UfdbguardSMTPNotifs["smtp_auth_user"]), 'font-size:14px;padding:3px;width:200px') . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:14px'>{smtp_auth_passwd}:</strong></td>\n\t\t<td>" . Field_password("smtp_auth_passwd-{$t}", trim($UfdbguardSMTPNotifs["smtp_auth_passwd"]), 'font-size:14px;padding:3px;width:100px') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:14px'>{tls_enabled}:</strong></td>\n\t\t<td>" . Field_checkbox("tls_enabled", 1, $UfdbguardSMTPNotifs["tls_enabled"]) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:14px'>{UseSSL}:</strong></td>\n\t\t<td>" . Field_checkbox("ssl_enabled", 1, $UfdbguardSMTPNotifs["ssl_enabled"]) . "</td>\n\t</tr>\t\t\t\t\t\n\t<tr>\n\t\t<td align='right' colspan=2>" . button('{apply}', "SaveArticaSMTPNotifValues{$t}();", 16) . "</td>\n\t</tr>\n\n\t</tr>\n</table>\n<script>\n\tvar x_SaveArticaSMTPNotifValues{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tdocument.getElementById('notif1-{$t}').innerHTML='';\n\t\tif(results.length>0){alert(results);}\n\t\tRefreshTab('main_ufdbguard_config');\n\t}\n\n\tfunction SaveArticaSMTPNotifValues{$t}(){\n\t\tvar UseRemoteUfdbguardService={$UseRemoteUfdbguardService};\n\t\tif(UseRemoteUfdbguardService==1){return;}\n\t\tvar XHR = new XHRConnection();\n\t\tvar pp=encodeURIComponent(document.getElementById('smtp_auth_passwd-{$t}').value);\n\t\tif(document.getElementById('ENABLED').checked){XHR.appendData('ENABLED',1);}else {XHR.appendData('ENABLED',0);}\n\t\tif(document.getElementById('tls_enabled').checked){XHR.appendData('tls_enabled',1);}else {XHR.appendData('tls_enabled',0);}\n\t\tif(document.getElementById('ssl_enabled').checked){XHR.appendData('ssl_enabled',1);}else {XHR.appendData('ssl_enabled',0);}\n\t\tXHR.appendData('smtp_server_name',document.getElementById('smtp_server_name').value);\n\t\tXHR.appendData('smtp_server_port',document.getElementById('smtp_server_port').value);\n\t\tXHR.appendData('smtp_sender',document.getElementById('smtp_sender').value);\n\t\tXHR.appendData('smtp_dest',document.getElementById('smtp_dest').value);\n\t\tXHR.appendData('smtp_auth_user',document.getElementById('smtp_auth_user').value);\n\t\tXHR.appendData('smtp_auth_passwd',pp);\n\t\tXHR.appendData('smtp_notifications','yes');\n\t\tAnimateDiv('notif1-{$t}');\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveArticaSMTPNotifValues{$t});\n\t}\n\t\n\tfunction SMTPNotifArticaEnableSwitch{$t}(){\n\t\tdocument.getElementById('smtp_auth_passwd-{$t}').disabled=true;\n\t\tdocument.getElementById('smtp_auth_user').disabled=true;\n\t\tdocument.getElementById('smtp_dest').disabled=true;\n\t\tdocument.getElementById('smtp_sender').disabled=true;\n\t\tdocument.getElementById('smtp_server_port').disabled=true;\n\t\tdocument.getElementById('smtp_server_name').disabled=true;\n\t\tdocument.getElementById('tls_enabled').disabled=true;\n\t\tdocument.getElementById('ssl_enabled').disabled=true;\n\t\t\n\t\t\n\t\t\n\t\tif(!document.getElementById('ENABLED').checked){return;}\n\t\t\n\t\tdocument.getElementById('smtp_auth_passwd-{$t}').disabled=false;\n\t\tdocument.getElementById('smtp_auth_user').disabled=false;\n\t\tdocument.getElementById('smtp_dest').disabled=false;\n\t\tdocument.getElementById('smtp_sender').disabled=false;\n\t\tdocument.getElementById('smtp_server_port').disabled=false;\n\t\tdocument.getElementById('smtp_server_name').disabled=false;\n\t\tdocument.getElementById('tls_enabled').disabled=false;\n\t\tdocument.getElementById('ssl_enabled').disabled=false;\t\n\t\tvar UseRemoteUfdbguardService={$UseRemoteUfdbguardService};\n\t\tif(UseRemoteUfdbguardService==1){\n\t\t\tDisableFieldsFromId('main-form-{$t}');\t\n\t\t}\t\t\n\t\t\n\t}\n\tSMTPNotifArticaEnableSwitch{$t}();\n</script>";
echo $tpl->_ENGINE_parse_body($html);
}
示例10: PROXY
function PROXY()
{
$ini = new Bs_IniHandler();
$sock = new sockets();
$ini->loadString($sock->GET_INFO("ArticaProxySettings"));
$ArticaProxyServerEnabled = $ini->_params["PROXY"]["ArticaProxyServerEnabled"];
$ArticaProxyServerName = $ini->_params["PROXY"]["ArticaProxyServerName"];
$ArticaProxyServerPort = $ini->_params["PROXY"]["ArticaProxyServerPort"];
$ArticaProxyServerUsername = $ini->_params["PROXY"]["ArticaProxyServerUsername"];
$ArticaProxyServerUserPassword = $ini->_params["PROXY"]["ArticaProxyServerUserPassword"];
$ArticaCompiledProxyUri = $ini->_params["PROXY"]["ArticaCompiledProxyUri"];
if (trim($ArticaProxyServerEnabled) != "yes") {
PROXY_DELETE();
return;
}
if (trim($ArticaProxyServerName == null)) {
PROXY_DELETE();
return;
}
if (trim($ArticaProxyServerPort == null)) {
$ArticaProxyServerPort = 80;
}
if (!is_numeric($ArticaProxyServerPort)) {
$ArticaProxyServerPort = 80;
}
if ($ArticaProxyServerUsername != null) {
$pattern = "{$ArticaProxyServerUsername}";
if ($ArticaProxyServerUserPassword != null) {
$pattern = $pattern . ":{$ArticaProxyServerUserPassword}";
}
$pattern = $pattern . "@";
}
echo "Starting......: " . date("H:i:s") . " Using proxy {$ArticaProxyServerName}:{$ArticaProxyServerPort}\n";
$proxypattern = "http://{$pattern}{$ArticaProxyServerName}:{$ArticaProxyServerPort}";
$f = explode("\n", @file_get_contents("/etc/environment"));
while (list($key, $line) = each($f)) {
if (preg_match("#^HTTP_PROXY#i", $line)) {
unset($f[$key]);
}
}
$f[] = "http_proxy={$proxypattern}";
if (is_dir("/etc/profile.d")) {
$t[] = "#!/bin/sh";
$t[] = "HTTP_PROXY={$proxypattern}";
$t[] = "for i in NEWSPOST_PROXY NEWSREPLY_PROXY NEWS_PROXY WAIS_PROXY SNEWSREPLY_PROXY FINGER_PROXY HTTPS_PROXY FTP_PROXY CSO_PROXY SNEWSPOST_PROXY NNTP_PROXY GOPHER_PROXY SNEWS_PROXY; do";
$t[] = "export \$i=\$HTTP_PROXY; done";
$t[] = "unset i";
@file_put_contents("/etc/profile.d/proxy-mycompany.sh", @implode("\n", $t));
@chmod("/etc/profile.d/proxy-mycompany.sh", 0755);
}
@file_put_contents("/root/.wgetrc", @implode("\n", $f));
@file_put_contents("/etc/profile.local", @implode("\n", $f));
@file_put_contents("/etc/environment", @implode("\n", $f));
if (is_dir("/etc/apt/apt.conf.d")) {
echo "Starting......: " . date("H:i:s") . " Using proxy with apt-get, apt-mirror...\n";
@file_put_contents("/etc/apt/apt.conf.d/proxy", "Acquire::http::Proxy \"{$proxypattern}\";");
}
}
示例11: cntlm_status
function cntlm_status()
{
$sock = new sockets();
$tpl = new templates();
$ini = new Bs_IniHandler();
$ini->loadString(base64_decode($sock->getFrameWork('cmd.php?cntlm-ini-status=yes')));
$APP_CNTLM = DAEMON_STATUS_ROUND("APP_CNTLM_PARENT", $ini, null, 0);
echo $tpl->_ENGINE_parse_body($APP_CNTLM);
}
示例12: FetchMailStatus
function FetchMailStatus(){
$tpl=new templates();
$ini=new Bs_IniHandler();
$sock=new sockets();
$datas=implode("\n",unserialize(base64_decode($sock->getFrameWork('cmd.php?fetchmail-status=yes'))));
$ini->loadString($datas);
$status=DAEMON_STATUS_ROUND("FETCHMAIL",$ini,null)."<br>".DAEMON_STATUS_ROUND("FETCHMAIL_LOGGER",$ini,null);
echo $tpl->_ENGINE_parse_body($status);
}
示例13: mysql_syslogs_service_status
function mysql_syslogs_service_status()
{
$tpl = new templates();
$sock = new sockets();
$ini = new Bs_IniHandler();
$ini->loadString(base64_decode($sock->getFrameWork('system.php?syslogdb-status=yes')));
$APP_SQUID_DB = DAEMON_STATUS_ROUND("APP_SYSLOG_DB", $ini, null, 1);
echo $tpl->_ENGINE_parse_body($APP_SQUID_DB);
}
示例14: GetUpdates
function GetUpdates(){
if(COUNT_REPOS()==0){INSERT_DEB_PACKAGES();}
$unix=new unix();
$tmpf=$unix->FILE_TEMP();
CheckSourcesList();
$sock=new sockets();
$ini=new Bs_IniHandler();
$configDisk=trim($sock->GET_INFO('ArticaAutoUpdateConfig'));
$ini->loadString($configDisk);
$AUTOUPDATE=$ini->_params["AUTOUPDATE"];
if(trim($AUTOUPDATE["auto_apt"])==null){$AUTOUPDATE["auto_apt"]="no";}
shell_exec("{$_GET["APT-GET"]} update >/dev/null 2>&1");
shell_exec("{$_GET["APT-GET"]} -f install --force-yes >/dev/null 2>&1");
shell_exec("{$_GET["APT-GET"]} upgrade -s >$tmpf 2>&1");
$datas=@file_get_contents($tmpf);
$tbl=explode("\n",$datas);
writelogs("Found ". strlen($datas)." bytes for apt",__FUNCTION__,__FILE__,__LINE__);
@unlink($tmpf);
while (list ($num, $val) = each ($tbl) ){
if($val==null){continue;}
if(preg_match("#^Inst\s+(.+?)\s+#",$val,$re)){
$packages[]=$re[1];
writelogs("Found {$re[1]} new package",__FUNCTION__,__FILE__,__LINE__);
//dpkg_configure_a();
}else{
if(preg_match("#dpkg was interrupted.+?dpkg --configure -a#",$val)){
writelogs("Error found ",__FUNCTION__,__FILE__,__LINE__);
}
writelogs("Garbage \"$val\"",__FUNCTION__,__FILE__,__LINE__);
}
}
$count=count($packages);
if($count>0){
@file_put_contents("/etc/artica-postfix/apt.upgrade.cache",implode("\n",$packages));
$text="You can perform upgrade of linux packages for\n".@file_get_contents("/etc/artica-postfix/apt.upgrade.cache");
send_email_events("new upgrade $count packages(s) ready",$text,"system");
THREAD_COMMAND_SET(LOCATE_PHP5_BIN()." /usr/share/artica-postfix/exec.admin.status.postfix.flow.php --services");
if($AUTOUPDATE["auto_apt"]=="yes"){
UPGRADE();
}
}else{
writelogs("No new packages...",__FUNCTION__,__FILE__,__LINE__);
@unlink("/etc/artica-postfix/apt.upgrade.cache");
}
}
示例15: status
function status()
{
$sock = new sockets();
$datas = base64_decode($sock->getFrameWork("cmd.php?squidguard-status=yes"));
$ini = new Bs_IniHandler();
$ini->loadString($datas);
$tpl = new templates();
$status = DAEMON_STATUS_ROUND("APP_SQUIDGUARD", $ini);
echo $tpl->_ENGINE_parse_body($status);
}