Exemplo n.º 1
0
    dump($CONFIG);
    exit(0);
}
$msgToShow = "";
if (isset($_GET['m2s'])) {
    $msgToShow = $_GET['m2s'];
}
$patches = parsePatches();
$toPatch = array();
$_patchs = ias_safedb_query("SELECT * FROM `{$CONFIG['TABLE_PREFIX']}patch`");
if (!$_patchs) {
    $toPatch[] = $patches[0];
} else {
    mysql_free_result($_patchs);
    foreach ($patches as $patch) {
        $_patchs = ias_safedb_query("SELECT * FROM `{$CONFIG['TABLE_PREFIX']}patch` WHERE `id` = {$patch['id']}");
        $_p = ias_db_fetch_row($_patchs);
        mysql_free_result($_patchs);
        if (!$_p) {
            $toPatch[] = $patch;
        }
    }
}
if (count($toPatch) < 1) {
    header("Location: production.php");
    exit(0);
}
?>
<html>
<head>
<title> :: <?php 
Exemplo n.º 2
0
    } else {
        $hdr_ip = $raw_ip;
    }
}
if (!preg_match('/^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$/', $raw_ip)) {
    $raw_ip = '0.0.0.0';
}
if (!preg_match('/^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$/', $hdr_ip)) {
    $hdr_ip = '0.0.0.0';
}
// Constants used by the ias_die function
define('INFORMATION', 1);
define('ERROR', 2);
define('CRITICAL_ERROR', 3);
($CONFIG['LINK_ID'] = ias_db_connect()) || die('<b>IAS critical error</b>:<br />Unable to connect to database !<br /><br />MySQL said: <b>' . mysql_error() . '</b>');
$_options = ias_safedb_query("SELECT * FROM `{$CONFIG['TABLE_PREFIX']}options` ORDER BY `id`");
if ($_options) {
    $options = ias_db_fetch_rowset($_options);
    mysql_free_result($_options);
    foreach ($options as $_option) {
        $CONFIG[$_option['name']] = $_option['value'];
    }
}
/**************************************************************************
   Database functions
 **************************************************************************/
// Connect to the database
/**
 * ias_db_connect()
 *
 * Connect to the database
Exemplo n.º 3
0
                } else {
                    echo "<div style=\"color:red\">" . mysql_error() . "</div>";
                }
            }
            ias_db_query("INSERT INTO {$CONFIG['TABLE_PREFIX']}patch(id, descr, ptime) VALUES ('" . $patches[0]['id'] . "', '" . $patches[0]['description'] . "', now())");
            foreach ($statements as $stat) {
                ias_db_query("INSERT INTO `patchoper`(id, patch, ptype, descr) VALUES(null, " . $patches[0]['id'] . ", 'S', '" . $stat['description'] . "')");
            }
        } else {
            if ($id - 1 < 0) {
            } else {
                $patch = $patches[$id - 1];
                $statements = $patch['statements'];
                if ($statements != NULL) {
                    foreach ($statements as $stat) {
                        $result = ias_safedb_query($stat['operation']);
                        if ($result) {
                            echo "<div style=\"color:green\">Patching Successfull</div>";
                        } else {
                            echo "<div style=\"color:red\">" . mysql_error() . "</div>";
                        }
                        if ($result) {
                            ias_db_query("INSERT INTO `patchoper`(id, patch, ptype, descr) VALUES(null, " . $patch['id'] . ", 'S', '" . $stat['description'] . "')");
                        }
                    }
                    ias_db_query("INSERT INTO {$CONFIG['TABLE_PREFIX']}patch(id, descr, ptime) VALUES ('" . $patch['id'] . "', '" . $patch['description'] . "', now())");
                }
            }
        }
    }
} else {