Exemplo n.º 1
0
function execute(){
	$pid=getmypid();
	$pidfile="/etc/artica-postfix/".basename(__FILE__).".pid";
	$unix=new unix();
	if($unix->process_exists($unix->get_pid_from_file($pidfile))){
		die();
	}
	
	file_put_contents($pidfile,$pid);
	build_conf();
	if(is_file("/etc/spamassassin/sa-learn-cyrus.conf")){
		exec("/usr/share/artica-postfix/bin/sa-learn-cyrus",$results);
		
	}
}
Exemplo n.º 2
0
function execute()
{
    $pid = getmypid();
    $pidfile = "/etc/artica-postfix/" . basename(__FILE__) . ".pid";
    $unix = new unix();
    if ($unix->process_exists($unix->get_pid_from_file($pidfile))) {
        die;
    }
    file_put_contents($pidfile, $pid);
    build_conf();
    if (is_file("/etc/spamassassin/sa-learn-cyrus.conf")) {
        exec("/usr/share/artica-postfix/bin/sa-learn-cyrus", $results);
        $unix->send_email_events("Junk learning successfully executed for {$GLOBALS["USERS_LIST_COUNT"]} user(s)", @implode("\n", $results), 'mailbox');
    }
}
Exemplo n.º 3
0
<?php

include_once dirname(__FILE__) . "/frame.class.inc";
include_once dirname(__FILE__) . "/class.unix.inc";
if (isset($_GET["build"])) {
    build_conf();
    exit;
}
if (isset($_GET["configuration-file"])) {
    get_conf();
    exit;
}
function build_conf()
{
    $unix = new unix();
    $nohup = $unix->find_program("nohup");
    $cmd = trim($nohup . " " . $unix->LOCATE_PHP5_BIN() . " /usr/share/artica-postfix/exec.ejabberd.php >/dev/null 2>&1 &");
    writelogs_framework("{$cmd}", __FUNCTION__, __FILE__, __LINE__);
    shell_exec($cmd);
}
function get_conf()
{
    echo "<articadatascgi>" . base64_encode(serialize(file("/etc/ejabberd/ejabberd.cfg"))) . "</articadatascgi>";
}
Exemplo n.º 4
0
function build()
{
    if ($GLOBALS["OUTPUT"]) {
        echo "Reconfigure...: " . date("H:i:s") . " [INIT]: Remove init.d scripts\n";
    }
    remove_init();
    $q = new mysql_squid_builder();
    $sql = "SELECT * FROM proxy_ports WHERE FTP=1 AND enabled=1";
    if ($GLOBALS["OUTPUT"]) {
        echo "Reconfigure...: " . date("H:i:s") . " [INIT]: Search parameters in MySQL Database\n";
    }
    $results = $q->QUERY_SQL($sql);
    while ($ligne = mysql_fetch_assoc($results)) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Reconfigure...: " . date("H:i:s") . " [INIT]: Building Port ID {$ligne["ID"]}\n";
        }
        build_conf($ligne);
        stop($ligne["ID"]);
        start($ligne["ID"]);
    }
}
Exemplo n.º 5
0
function build()
{
    remove_init();
    $q = new mysql_squid_builder();
    $sql = "SELECT * FROM proxy_ports WHERE FTP=1 AND enabled=1";
    $results = $q->QUERY_SQL($sql);
    while ($ligne = mysql_fetch_assoc($results)) {
        build_conf($ligne);
        stop($ligne["ID"]);
        start($ligne["ID"]);
    }
}