Ejemplo n.º 1
0
function CLEAN_ALL_SESSIONS()
{
    $sock = new sockets();
    $unix = new unix();
    if ($GLOBALS["FORCE"]) {
        $force = true;
    }
    $TimeFile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".time";
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
    if ($GLOBALS["VERBOSE"]) {
        echo "{$TimeFile}\n";
    }
    if (!$force) {
        $pid = $unix->get_pid_from_file($pidfile);
        if ($unix->process_exists($pid, basename(__FILE__))) {
            $time = $unix->PROCCESS_TIME_MIN($pid);
            if ($GLOBALS["OUTPUT"]) {
                echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}: Already Artica task running PID {$pid} since {$time}mn\n";
            }
            return;
        }
    }
    @file_put_contents($pidfile, getmypid());
    $ArticaHotSpotInterface = $sock->GET_INFO("ArticaHotSpotInterface");
    if ($ArticaHotSpotInterface == null) {
        $ArticaHotSpotInterface = "eth0";
    }
    $NETWORK_ALL_INTERFACES = $unix->NETWORK_ALL_INTERFACES();
    $IPADDR = $NETWORK_ALL_INTERFACES[$ArticaHotSpotInterface]["IPADDR"];
    $ArticaHotSpotPort = intval($sock->GET_INFO("ArticaHotSpotPort"));
    $uri = "http://{$IPADDR}:{$ArticaHotSpotPort}/wifidog/";
    $ARRAY = TESTCONNECTION(true);
    while (list($MAC, $token) = each($ARRAY["SESSIONS"])) {
    }
}
Ejemplo n.º 2
0
<?php

include_once dirname(__FILE__) . '/ressources/class.main_cf.inc';
include_once dirname(__FILE__) . '/ressources/class.ldap.inc';
include_once dirname(__FILE__) . "/ressources/class.sockets.inc";
include_once dirname(__FILE__) . "/ressources/class.nfs.inc";
if (isset($_GET["TESTCONNECTION"])) {
    TESTCONNECTION();
    exit;
}
if (isset($_GET["LINKING"])) {
    LINKING();
    exit;
}
function TESTCONNECTION()
{
    echo "[MASTER]\n";
    $users = new usersMenus();
    if (!$users->NFS_SERVER_INSTALLED) {
        echo "ERROR=No filesystem installed\n";
        return false;
    }
    $nfs = new nfs();
    if (trim($nfs->SanClusterBasePath) == null) {
        echo "ERROR=No STORAGE configured\n";
        return false;
    }
    echo "ERROR=SUCCESS\n";
    echo "\n\n";
}
function LINKING()