本文整理汇总了PHP中Bs_IniHandler::saveFile方法的典型用法代码示例。如果您正苦于以下问题:PHP Bs_IniHandler::saveFile方法的具体用法?PHP Bs_IniHandler::saveFile怎么用?PHP Bs_IniHandler::saveFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bs_IniHandler
的用法示例。
在下文中一共展示了Bs_IniHandler::saveFile方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: restore
function restore($id, $target_resource, $db)
{
$sql = "SELECT * FROM dar_index where filekey='{$id}'";
$q = new mysql();
$ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_backup'));
$ressource = $ligne["mount_md5"];
$sourcefile = $ligne["filepath"];
if ($_GET["RESTORE_DIR"]) {
$sourcefile = dirname($sourcefile);
}
$ini = new Bs_IniHandler("/tmp/restore.{$id}.ini");
$ini->set('INFO', "backup_resource", $ressource);
$ini->set('INFO', "target_resource", $target_resource);
$ini->set('INFO', "database", $db);
$ini->set('INFO', "source_path", $sourcefile);
$ini->saveFile("/tmp/restore.{$id}.ini");
$ini = new Bs_IniHandler(dirname(__FILE__) . "/ressources/logs/exec.dar.find.restore.ini");
$ini->set("STATUS", "progress", 15);
$ini->set("STATUS", "text", "{Executing}...");
$ini->saveFile(dirname(__FILE__) . "/ressources/logs/exec.dar.find.restore.ini");
$cmd = "/usr/share/artica-postfix/bin/artica-backup --dar-restore-path /tmp/restore.{$id}.ini";
events($cmd);
system($cmd);
}
示例2: del_icon
function del_icon()
{
$uid = $_SESSION["uid"];
$tab = $_GET["delete_icon_tab"];
$icon = $_GET["delete_icon"];
$page = CurrentPageName();
$cache_tab_file = "ressources/profiles/{$uid}.{$tab}";
@unlink($cache_tab_file);
$ini = new Bs_IniHandler("ressources/profiles/{$uid}.tabs");
$icons = explode(",", $ini->_params[$tab]["icons"]);
while (list($num, $ligne) = each($icons)) {
if ($ligne == $icon) {
unset($icons[$num]);
}
}
$ini->_params[$tab]["icons"] = implode(",", $icons);
$ini->saveFile("ressources/profiles/{$uid}.tabs");
}
示例3: network_scanner_execute
function network_scanner_execute()
{
$tpl = new templates();
$net = new networkscanner();
$net->save();
$sock = new sockets();
$sock->getFrameWork("cmd.php?LaunchNetworkScanner=yes");
$box = $tpl->javascript_parse_text('{network_scanner_execute_background}', 1);
$ini = new Bs_IniHandler('ressources/logs/nmap.progress.ini');
$ini->set('NMAP', 'pourc', '10');
$ini->set('NMAP', 'text', '{scheduled}');
$ini->saveFile('ressources/logs/nmap.progress.ini');
echo $box;
}
示例4: ImportNets
function ImportNets()
{
$sock = new sockets();
$ini = new Bs_IniHandler();
$ini->loadString($sock->GET_INFO("ComputersImportArtica"));
if (!is_array($ini->_params)) {
writelogs("No artica masters defined", __FUNCTION__, __FILE__, __LINE__);
die;
}
if (count($ini->_params) == 0) {
writelogs("No artica masters defined", __FUNCTION__, __FILE__, __LINE__);
die;
}
while (list($ip, $array) = each($ini->_params)) {
if (trim($ip) == null) {
continue;
}
$curl = new ccurl("https://{$ip}:{$array["port"]}/exec.import-networks.php");
while (list($key, $value) = each($array)) {
$curl->parms[$key] = $value;
}
$curl->get();
$datas = $curl->data;
if (trim($datas) == null) {
continue;
}
$md5 = md5($datas);
import_vpn_remotes_sites($datas);
if (!$GLOBALS["FORCE"]) {
if ($array["md5"] != $md5) {
ImportDatas($datas);
}
} else {
ImportDatas($datas);
}
$ini->_params[$ip]["md5"] = $md5;
}
reset($ini->_params);
$ini->saveFile("/etc/artica-postfix/settings/Daemons/ComputersImportArtica");
}
示例5: WriteCOmputerBrowseProgress
function WriteCOmputerBrowseProgress($pourc,$text){
$ini=new Bs_IniHandler();
$ini->set('NMAP','pourc',$pourc);
$ini->set('NMAP','text',$text);
$ini->saveFile('/usr/share/artica-postfix/ressources/logs/nmap.progress.ini');
@chmod("/usr/share/artica-postfix/ressources/logs/nmap.progress.ini",0755);
}
示例6: UpdateUtility
//.........这里部分代码省略.........
$updateutility->MAIN_ARRAY["ComponentSettings"][$key] = "true";
}
if (!isset($updateutility->MAIN_ARRAY["ComponentSettings"]["DownloadAllDatabases"])) {
$updateutility->MAIN_ARRAY["ComponentSettings"]["DownloadAllDatabases"] = "true";
}
if (!isset($updateutility->MAIN_ARRAY["ComponentSettings"]["KasperskyAdministrationKit_8_0_2048_2090"])) {
$updateutility->MAIN_ARRAY["ComponentSettings"]["KasperskyAdministrationKit_8_0_2048_2090"] = "true";
}
if (!isset($updateutility->MAIN_ARRAY["ComponentSettings"]["KasperskySecurityCenter_9"])) {
$updateutility->MAIN_ARRAY["ComponentSettings"]["KasperskySecurityCenter_9"] = "true";
}
}
if ($UpdateUtilityOnlyForKav4Proxy == 1) {
system_admin_events("Kav4Proxy as been set...", __FUNCTION__, __FILE__, __LINE__, "update");
reset($updateutility->ALL_PKEYS);
while (list($key, $line) = each($updateutility->ALL_PKEYS)) {
$updateutility->MAIN_ARRAY["ComponentSettings"][$key] = "false";
}
$updateutility->MAIN_ARRAY["ComponentSettings"]["KasperskyAntiVirusProxyServer_5_5"] = "true";
$updateutility->MAIN_ARRAY["ComponentSettings"]["KasperskyAntiVirusProxyServer_5_5_41_51"] = "true";
$updateutility->MAIN_ARRAY["ComponentSettings"]["KasperskyAntiVirusProxyServer_5_5_62"] = "true";
$updateutility->MAIN_ARRAY["ComponentSettings"]["KasperskyAntiVirusProxyServer_5_5_62"] = "true";
$updateutility->MAIN_ARRAY["ComponentSettings"]["DownloadAllDatabases"] = "false";
}
$updateutility->MAIN_ARRAY["ShedulerSettings"]["LastUpdate"] = '@Variant(\\0\\0\\0\\x10\\0\\0\\0\\0\\xff\\xff\\xff\\xff\\xff)';
$updateutility->MAIN_ARRAY["ShedulerSettings"]["Time"] = '@Variant(\\0\\0\\0\\xf\\0\\0\\0\\0)';
$t = time();
$ini = new Bs_IniHandler();
$ini2 = new Bs_IniHandler();
$ini->_params = $updateutility->MAIN_ARRAY;
$ini->_params["DirectoriesSettings"]["UpdatesFolder"] = "{$UpdateUtilityStorePath}/databases";
$ini->_params["DirectoriesSettings"]["TempFolder"] = "{$UpdateUtilityStorePath}/TempFolder";
@mkdir("{$UpdateUtilityStorePath}/databases", 0755, true);
@mkdir("{$UpdateUtilityStorePath}/TempFolder", 0755, true);
$report_file = "/var/log/artica-postfix/UpdateUtility-report-" . time() . ".log";
$ini->_params["ConnectionSettings"]["UseSpecifiedProxyServerSettings"] = "false";
$ini->_params["ConnectionSettings"]["UseAuthenticationProxyServer"] = "false";
$ini->_params["ReportSettings"]["ReportFileName"] = "{$report_file}";
$datas = $sock->GET_INFO("ArticaProxySettings");
if (trim($datas) != null) {
$ini2->loadString($datas);
$ArticaProxyServerEnabled = $ini->_params["PROXY"]["ArticaProxyServerEnabled"];
$ArticaProxyServerName = $ini->_params["PROXY"]["ArticaProxyServerName"];
$ArticaProxyServerPort = $ini->_params["PROXY"]["ArticaProxyServerPort"];
$ArticaProxyServerUsername = trim($ini->_params["PROXY"]["ArticaProxyServerUsername"]);
$ArticaProxyServerUserPassword = $ini->_params["PROXY"]["ArticaProxyServerUserPassword"];
if ($ArticaProxyServerEnabled == "yes") {
$ini->_params["ConnectionSettings"]["UseSpecifiedProxyServerSettings"] = "true";
$ini->_params["ConnectionSettings"]["AddressProxyServer"] = $ArticaProxyServerName;
$ini->_params["ConnectionSettings"]["PortProxyServer"] = $ArticaProxyServerPort;
if ($ArticaProxyServerUsername != null) {
$ini->_params["ConnectionSettings"]["UseAuthenticationProxyServer"] = "true";
$ini->_params["ConnectionSettings"]["UserNameProxyServer"] = "{$ArticaProxyServerUsername}";
$ini->_params["ConnectionSettings"]["PasswordProxyServer"] = "{$ArticaProxyServerUserPassword}";
}
}
}
$ini->saveFile("/etc/UpdateUtility/updater.ini");
chdir("/etc/UpdateUtility");
@chmod("/etc/UpdateUtility/UpdateUtility-Console", 0755);
$cmd = "./UpdateUtility-Console -u -o /etc/UpdateUtility/updater.ini -r 2>&1";
$Restart1 = false;
writelogs("Running `{$cmd}`", __FUNCTION__, __FILE__, __LINE__);
exec("{$cmd}", $results);
while (list($key, $line) = each($results)) {
if (preg_match("#Total downloading:\\s+([0-9]+)", $line, $re)) {
$PERCT = $re[1];
}
if (preg_match("#Segmentation fault#", $line)) {
$text = @implode("\n", $results);
$Restart1 = true;
system_admin_events("Segmentation fault at {$PERCT}% on UpdateUtility restart again...\n{$text}", __FUNCTION__, __FILE__, __LINE__, "update");
$results = array();
break;
}
writelogs("{$line}", __FUNCTION__, __FILE__, __LINE__);
}
if ($Restart1) {
exec("{$cmd}", $results);
while (list($key, $line) = each($results)) {
if (preg_match("#Total downloading:\\s+([0-9]+)#", $line, $re)) {
$PERCT = $re[1];
}
if (preg_match("#Segmentation fault#", $line)) {
$text = @implode("\n", $results);
system_admin_events("Segmentation fault at {$PERCT}% on UpdateUtility Aborting...\n{$text}", __FUNCTION__, __FILE__, __LINE__, "update");
}
writelogs("{$line}", __FUNCTION__, __FILE__, __LINE__);
}
}
$t2 = time();
$timehuman = $unix->distanceOfTimeInWords($t, $t2);
$text = @implode("\n", $results);
system_admin_events("Executing UpdateUtility Success took {$timehuman}\n{$text}", __FUNCTION__, __FILE__, __LINE__, "update");
$nohup = $unix->find_program("nohup");
$php = $unix->LOCATE_PHP5_BIN();
shell_exec("{$nohup} {$php} " . dirname(__FILE__) . "/exec.freeweb.php --reconfigure-updateutility >/dev/null 2>&1 &");
ScanUpdateUtilityLogs(true);
UpdateUtilitySize(true);
}
示例7: progress
function progress($pourc, $text)
{
$file = "/usr/share/artica-postfix/ressources/logs/compile.iptables.progress";
$ini = new Bs_IniHandler();
$ini->set("PROGRESS", "pourc", $pourc);
$ini->set("PROGRESS", "text", $text);
$ini->saveFile($file);
chmod($file, 0777);
}
示例8: readlsfile
function readlsfile($path)
{
if (!preg_match('#-md-(.+?)\\.ls#', $path, $re)) {
events("Unable to determine source from this file " . basename($path));
return true;
} else {
$external_source = $re[1];
}
$file_name = basename($path);
$filename = $path;
$filesize = @filesize($filename);
events("Request for analyze file {$path} size {$filesize} bytes");
if ($filesize == 0) {
events("Obytes -> Abort but return true;");
return true;
}
if (preg_match('#(.+?)-md-.+?\\.[a-z0-9]+$#', $path, $re)) {
$database_path = $re[1];
}
$database_name = basename($database_path);
if (preg_match('#(.+?)\\-.+?\\-diff#', $database_name, $re)) {
$database_name = $re[1];
}
if ($filesize > 400) {
DeleteDatabase($database_name);
}
$source_path = GetSources($database_path);
if ($source_path == null) {
$source_path = GetSources($database_name);
}
$external_source_pattern = $_GET["STORAGES"][$external_source];
if ($external_source == null) {
events("Unable to find source for {$external_source} !!");
return false;
}
events("*********************************************************************");
events("Analyzing cache from {$filename}...");
events("MD5 source....: {$external_source}");
events("Pattern source: {$external_source_pattern}");
events("database name.: {$database_name}");
events("database Path.: {$database_path}");
events("Source Path...: {$source_path}");
events("*********************************************************************");
$content = file_get_contents($filename);
$md5 = md5($content);
$ini = new Bs_IniHandler("/etc/artica-postfix/dar.cache.ini");
if ($ini->_params["{$database_name}"]["md5"] == $md5) {
events("Analyzing {$database_name} cache:{$md5} already set");
return true;
}
$ini->set($database_name, "md5", $md5);
$ini->saveFile("/etc/artica-postfix/dar.cache.ini");
$filesize = @filesize($filename);
$filesize = round($filesize / 1024, 2) . " Ko";
events("Analyzing " . basename($filename) . " ({$filesize}) for database: {$database_name} cache:{$md5}");
if ($fd = @fopen($filename, "r")) {
while ($fd && !feof($fd)) {
$line = trim(fgets($fd, 4096));
if (preg_match("#^\\[.+?\\]\\s+\\[.*?\\]\\s+[a-z\\-]+\\s+[a-zA-Z0-9\\-\\_\\.]+\\s+[a-zA-Z0-9\\-\\_\\.]+\\s+([0-9]+)\\s+([a-zA-Z0-9\\s\\:]+)\\s+(.+)#", $line, $re)) {
if (!Insert($re[3], $re[1], $re[2], $source_path, $database_name, $external_source_pattern)) {
events("Failed line \"{$line}\" aborting process");
return false;
}
} else {
events("Failed line {$num} \"{$line}\" -> continue reading file...");
}
}
fclose($fd);
events("{$_GET["COUNT"][$database_name]} files added...");
events("Optimize table...");
$sql = "OPTIMIZE TABLE `dar_index`";
$q = new mysql();
$q->QUERY_SQL($sql, "artica_backup");
return true;
}
}
示例9: SambaAudit
function SambaAudit()
{
$sock = new sockets();
$EnableSambaXapian = $sock->GET_INFO("EnableSambaXapian");
$EnableScannedOnly = $sock->GET_INFO('EnableScannedOnly');
if ($EnableSambaXapian == null) {
$EnableSambaXapian = 1;
}
if ($EnableScannedOnly == null) {
$EnableScannedOnly = 1;
}
$users = new usersMenus();
if (!$users->XAPIAN_PHP_INSTALLED) {
$EnableSambaXapia = 0;
}
if (!$users->SCANNED_ONLY_INSTALLED) {
$EnableScannedOnly = 0;
}
$ini = new Bs_IniHandler("/etc/samba/smb.conf");
$write = true;
while (list($num, $ligne) = each($ini->_params)) {
if ($num != "homes") {
if ($ligne["path"] == null) {
continue;
}
}
if ($num == "profiles") {
continue;
}
if ($num == "printers") {
continue;
}
if ($num == "print\$") {
continue;
}
if ($num == "netlogon") {
continue;
}
$vfs_objects = $ligne["vfs object"];
if ($EnableSambaXapian == 1) {
if (!IsVfsExists($vfs_objects, "full_audit")) {
$ini->_params[$num]["vfs object"] = $ini->_params[$num]["vfs object"] . " full_audit";
$ini->_params[$num]["vfs object"] = VFSClean($ini->_params[$num]["vfs object"]);
$ini->_params[$num]["full_audit:prefix"] = "%u|%I|%m|%S|%P";
$ini->_params[$num]["full_audit:success"] = "rename unlink pwrite write";
$ini->_params[$num]["full_audit:failure"] = "none";
$ini->_params[$num]["full_audit:facility"] = "LOCAL7";
$ini->_params[$num]["full_audit:priority"] = "NOTICE";
$write = true;
}
} else {
if (IsVfsExists($vfs_objects, "full_audit")) {
$ini->_params[$num]["vfs object"] = str_replace("full_audit", "", $ini->_params[$num]["vfs object"]);
$ini->_params[$num]["vfs object"] = VFSClean($ini->_params[$num]["vfs object"]);
unset($ini->_params[$num]["full_audit:prefix"]);
unset($ini->_params[$num]["full_audit:success"]);
unset($ini->_params[$num]["full_audit:failure"]);
unset($ini->_params[$num]["full_audit:facility"]);
unset($ini->_params[$num]["full_audit:priority"]);
$write = true;
}
}
if ($EnableScannedOnly == 0) {
if (IsVfsExists($vfs_objects, "scannedonly")) {
$ini->_params[$num]["vfs object"] = str_replace("scannedonly", "", $ini->_params[$num]["vfs object"]);
$ini->_params[$num]["vfs object"] = VFSClean($ini->_params[$num]["vfs object"]);
$write = true;
}
}
}
if ($write) {
$ini->saveFile("/etc/samba/smb.conf");
}
}
示例10: NotifyClient
function NotifyClient($server)
{
$file = "/etc/artica-cluster/notify-{$server}";
$ini = new Bs_IniHandler();
$ini->loadFile($file);
$ini->_params["PARAMS"]["name"] = "{$server}";
$sock = new sockets();
$cyrus_id = $sock->getFrameWork("cmd.php?idofUser=cyrus");
$ini->_params["PARAMS"]["cyrus_id"] = $cyrus_id;
if (!function_exists("curl_init")) {
$ini->_params["PARAMS"]["notify"] = 0;
$ini->_params["PARAMS"]["error"] = 1;
$ini->_params["PARAMS"]["error_text"] = "{error_php_curl}";
$ini->_params["PARAMS"]["name"] = "{$server}";
$ini->_params["PARAMS"]["cyrus_id"] = $cyrus_id;
$ini->saveFile($file);
return null;
}
while (list($num, $ligne) = each($ini->_params["PARAMS"])) {
$curlPost .= '&' . $num . '=' . urlencode($ligne);
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://{$server}:9000/exec.gluster.php");
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
$data = curl_exec($ch);
$error = curl_errno($ch);
if ($error > 0) {
writelogs("Connect to {$server} error {$error}", __FUNCTION__, __FILE__, __LINE__);
}
switch ($error) {
case 6:
$ini->_params["PARAMS"]["notify"] = 0;
$ini->_params["PARAMS"]["error"] = 1;
$ini->_params["PARAMS"]["error_text"] = "{error_curl_resolve}";
$ini->saveFile($file);
curl_close($ch);
return null;
break;
default:
break;
}
if (curl_errno($ch) == false) {
if (preg_match("#404 Not Found#is", $data)) {
writelogs("Connect to {$server} error 404 Not Found", __FUNCTION__, __FILE__, __LINE__);
$ini->_params["PARAMS"]["notify"] = 0;
$ini->_params["PARAMS"]["error"] = 1;
$ini->_params["PARAMS"]["notified"] = 0;
$ini->_params["PARAMS"]["error_text"] = "{error_wrong_artica_version}";
$ini->saveFile($file);
curl_close($ch);
return null;
}
if (preg_match("#GLUSTER_NOT_INSTALLED#is", $data)) {
writelogs("Connect to {$server} error GLUSTER_NOT_INSTALLED", __FUNCTION__, __FILE__, __LINE__);
$ini->_params["PARAMS"]["notify"] = 0;
$ini->_params["PARAMS"]["error"] = 1;
$ini->_params["PARAMS"]["notified"] = 0;
$ini->_params["PARAMS"]["error_text"] = "{error_gluster_not_installed}";
$ini->saveFile($file);
curl_close($ch);
return null;
}
if (preg_match("#CURL_NOT_INSTALLED#is", $data)) {
writelogs("Connect to {$server} error CURL_NOT_INSTALLED", __FUNCTION__, __FILE__, __LINE__);
$ini->_params["PARAMS"]["notify"] = 0;
$ini->_params["PARAMS"]["error"] = 1;
$ini->_params["PARAMS"]["notified"] = 0;
$ini->_params["PARAMS"]["error_text"] = "{error_php_curl}";
$ini->saveFile($file);
curl_close($ch);
return null;
}
}
if (preg_match("#GLUSTER_OK#is", $data)) {
writelogs("Connect to {$server} success", __FUNCTION__, __FILE__, __LINE__);
$ini->_params["PARAMS"]["notify"] = 0;
$ini->_params["PARAMS"]["error"] = 0;
$ini->_params["PARAMS"]["notified"] = 1;
$ini->_params["PARAMS"]["error_text"] = "{success}";
writelogs("Set this server has notified", __FUNCTION__, __FILE__, __LINE__);
$ini->saveFile($file);
curl_close($ch);
return null;
}
//echo $data;
}
示例11: ASSP_QUAR
}
$count = $count + 1;
$ini = new Bs_IniHandler();
$ini->set("PROGRESS", "current", $count);
$ini->set("PROGRESS", "total", $max);
$ini->set("PROGRESS", "pid", $pid);
$ini->set("PROGRESS", "quarantine", "(spam)/virus *.gz,virus-");
$ini->saveFile("/usr/share/artica-postfix/ressources/logs/mailarchive-quarantine-progress.ini");
chmod("/usr/share/artica-postfix/ressources/logs/mailarchive-quarantine-progress.ini", 0755);
//if($count>50){break;}
}
$ini = new Bs_IniHandler();
$ini->set("PROGRESS", "pid", "0");
$date = date('H:i:s');
$ini->set("PROGRESS", "quarantine", "Finish {$date1} -> {$date}, next in 5mn");
$ini->saveFile("/usr/share/artica-postfix/ressources/logs/mailarchive-quarantine-progress.ini");
system('/bin/rm /var/virusmails/*.eml >/dev/null 2>&1');
ASSP_QUAR("/usr/share/assp/spam");
ASSP_QUAR("/usr/share/assp/discarded");
ASSP_QUAR("/usr/share/assp/quarantine");
ASSP_QUAR("/usr/share/assp/errors/notspam");
ASSP_QUAR("/usr/share/assp/errors/spam");
ASSP_QUAR("/var/spam-mails");
die;
function ASSP_QUAR($baseDir)
{
//""
if (!is_dir($baseDir)) {
return null;
}
$files = DirEML($baseDir);
示例12: point_events
function point_events($postfix_id=null,$smtp_sender=null,$from=null,$to=null,$error=null,$mailsize=0){
if($postfix_id==null){
if($GLOBALS["DebugArticaFilter"]==1){events("postfix_id is null",__FUNCTION__,__LINE__);}
return;
}
@mkdir("/var/log/artica-postfix/RTM",null,true);
$file="/var/log/artica-postfix/RTM/$postfix_id.msg";
if($GLOBALS["DebugArticaFilter"]==1){events("Loading monitor file $file",__FUNCTION__,__LINE__);}
$ini=new Bs_IniHandler($file);
if($GLOBALS["DebugArticaFilter"]==1){events("populate monitor file $file",__FUNCTION__,__LINE__);}
if($smtp_sender<>null){$ini->set("TIME","smtp_sender",$smtp_sender);}
if($from<>null){$ini->set("TIME","mailfrom",$from);}
$ini->set("TIME","mailto","$to");
$ini->set("TIME","time_end",date("Y-m-d H:i:s"));
$ini->set("TIME","message-id",$postfix_id);
$ini->set("TIME","mailsize",$mailsize);
if($error==null){
$ini->set("TIME","bounce_error","Success");
$ini->set("TIME","delivery_success","yes");
}else{
$ini->set("TIME","bounce_error","$error");
$ini->set("TIME","delivery_success","no");
}
if($GLOBALS["DebugArticaFilter"]==1){events("save monitor file $file",__FUNCTION__,__LINE__);}
$ini->saveFile($file);
}
示例13: progress
function progress($pourc, $text)
{
if ($GLOBALS["VERBOSE"]) {
echo "{$pourc}% {$text}\n";
}
$file = "/usr/share/artica-postfix/ressources/logs/compile.iptables.progress";
$ini = new Bs_IniHandler();
$ini->set("PROGRESS", "pourc", $pourc);
$ini->set("PROGRESS", "text", $text);
$ini->saveFile($file);
chmod($file, 0777);
}
示例14: CheckExistentDirectories
function CheckExistentDirectories(){
$change=false;
$sock=new sockets();
$ArticaMetaEnabled=$sock->GET_INFO("ArticaMetaEnabled");
if($ArticaMetaEnabled==null){$ArticaMetaEnabled=0;}
$ini=new Bs_IniHandler("/etc/artica-postfix/settings/Daemons/SambaSMBConf");
if(is_array($ini->_params)){
while (list ($index, $array) = each ($ini->_params) ){
if($index=="print$"){continue;}
if($index=="printers"){continue;}
if($index=="homes"){continue;}
if($index=="global"){continue;}
if($array["path"]==null){continue;}
if(is_link($array["path"])){continue;}
if(is_dir($array["path"])){continue;}else{if($ArticaMetaEnabled==1){@mkdir($array["path"],0755,true);continue;}}
unset($ini->_params[$index]);
$change=true;
continue;
}
}
$ini->saveFile("/etc/artica-postfix/settings/Daemons/SambaSMBConf");
}
示例15: mailboxes_flow
function mailboxes_flow()
{
$tpl = new Templates();
$users = new usersMenus();
$users->LoadModulesEnabled();
if ($users->EnableAmavisDaemon == 0) {
die;
}
if ($users->EnableMysqlFeatures == 0) {
die;
}
writelogs("user={$_SESSION['uid']}", __FUNCTION__, __FILE__);
$cachfile = "ressources/logs/{$_SESSION['uid']}_stat.ini";
if (!file_exists($cachfile)) {
$build = true;
} else {
$Diff = round((time() - filemtime($cachfile)) / 60, 0);
writelogs("{$cachfile}={$Diff} mn");
if ($Diff > 10) {
$build = true;
} else {
$build = false;
}
}
if ($build) {
$user = new user($_SESSION['uid']);
$AllMails = $user->aliases;
$AllMails[] = $user->mail;
while (list($num, $array) = each($AllMails)) {
if ($array == null) {
continue;
}
$recieve[] = "OR mails_events.rcpt_to='{$array}'";
}
$recieve[0] = str_replace("OR ", '', $recieve[0]);
$s = new mysql();
$sql = "SELECT count( spam ) as tspam FROM `mails_events` WHERE spam=1 AND (" . implode(" ", $recieve) . ")";
$ligne = @mysql_fetch_array($s->QUERY_SQL($sql, "artica_events"));
$spam = $ligne["tspam"];
writelogs("{$_SESSION['uid']} SPAM={$spam}", __FUNCTION__, __FILE__);
$sql = "SELECT count( infected ) as tinfected FROM `mails_events` WHERE infected=1 AND (" . implode(" ", $recieve) . ")";
$ligne = @mysql_fetch_array($s->QUERY_SQL($sql, "artica_events"));
$infected = $ligne["tinfected"];
$sql = "SELECT count( banned ) as tbanned FROM `mails_events` WHERE banned=1 AND (" . implode(" ", $recieve) . ")";
$ligne = @mysql_fetch_array($s->QUERY_SQL($sql, "artica_events"));
$banned = $ligne["tbanned"];
$sql = "SELECT count(ID) as tot FROM `mails_events` WHERE 1 AND (" . implode(" ", $recieve) . ")";
$ligne = @mysql_fetch_array($s->QUERY_SQL($sql, "artica_events"));
$total = $ligne["tot"];
$tot = $total - $banned - $spam - $infected;
$ini = new Bs_IniHandler();
$ini->_params["FLOW"]["SPAM"] = $spam;
$ini->_params["FLOW"]["INFECTED"] = $infected;
$ini->_params["FLOW"]["BANNED"] = $banned;
$ini->_params["FLOW"]["TOTAL"] = $tot;
$ini->saveFile($cachfile);
} else {
$ini = new Bs_IniHandler($cachfile);
$spam = $ini->_params["FLOW"]["SPAM"];
$infected = $ini->_params["FLOW"]["INFECTED"];
$banned = $ini->_params["FLOW"]["BANNED"];
$tot = $ini->_params["FLOW"]["TOTAL"];
}
if ($tot == 0) {
die;
}
$data = array($spam, $infected, $banned, $tot);
// Create the Pie Graph.
$graph = new PieGraph(350, 350, 'auto');
//$graph->SetShadow();
$graph->title->Set("{$total} messages");
$graph->title->SetFont(FF_FONT1, FS_BOLD);
// Create
$p1 = new PiePlot3D($data);
//$p1->SetLegends(array("SPAM","Virus","Bann","Clean"));
$p1->SetLabels(array("SPAM:{$spam}", "Virus:{$infected}", "Bann:{$banned}", "Clean:{$tot}"), 1);
$p1->SetEdge('black', 1);
$p1->SetAngle(75);
$p1->SetLabelMargin(2);
//$p1->SetCSIMTargets($targ,$alts);
// Use absolute labels
//$p1->SetLabelType(0);
//$p1->value->SetFormat("%d kr");
// Move the pie slightly to the left
$p1->SetCenter(0.4, 0.5);
$p1->ExplodeAll(10);
$graph->Add($p1);
$graph->SetFrame(false);
// Send back the HTML page which will call this script again
// to retrieve the image.
$graph->StrokeCSIM();
}