Esempio n. 1
0
    return $query;
}
if (isset($_POST['username'])) {
    $a = $_POST['username'];
    $b = $_POST['password'];
    $va = trim($_POST['valore']);
    require_once "../GUI_MG/connessione.php";
    if ($va == "docente") {
        $nomecampo = "CF";
    } else {
        $nomecampo = "ID";
    }
    $q = mysql_query(query($va, $a, $nomecampo));
    $row = mysql_fetch_array($q, MYSQL_NUM);
    if ($row[0]) {
        $q = mysql_query(query2($va, $b));
        $row = mysql_fetch_array($q, MYSQL_NUM);
        if ($row[0]) {
            setcookie("id_utente", "{$a}", time() + 36000, "/Alumni/");
            setcookie("tipo_utente", "{$va}", time() + 36000, "/Alumni/");
            switch ($va) {
                case 'alumno':
                    header("location: ../GUI_CP/GUIAlumno.php#s");
                    break;
                case 'docente':
                    header("location: ../GUI_MG/GUIDocente.php#s");
                    break;
                case 'amministratore':
                    header("location: GUIAmministratore.php#s");
                    break;
                case 'moderatore':
Esempio n. 2
0
@file_put_contents($tmpfile, getmypid());
if ($argv[1] == "--query") {
    query();
    die;
}
if ($argv[1] == "--query2") {
    query2();
    die;
}
if ($argv[1] == "--queue") {
    PostQueue();
    die;
}
PostQueue();
query();
query2();
CleanTables();
function CleanTables()
{
    $unix = new unix();
    $tmpfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".time";
    $time = $unix->file_time_min($tmpfile);
    if ($time > 240) {
        @unlink($tmpfile);
        @file_put_contents($tmpfile, "#");
    } else {
        return;
    }
    $q = new mysql();
    $sql = "OPTIMIZE TABLE viptrack_connections";
    $q->QUERY_SQL($sql, "artica_events");