示例#1
0
// remove the last slash if any in $set->url
$set->url = rtrim($set->url, "/");
include MAI_ROOT . "lib/mysql.class.php";
include MAI_ROOT . "lib/plugin.class.php";
include MAI_ROOT . "lib/template.class.php";
include MAI_ROOT . "lang/index.php";
include MAI_ROOT . "lib/functions.php";
// make $lang an object
$lang = (object) $lang;
// template object
$tpl = new Tpl();
// version
$set->version = '1.0.6 BETA';
// db connection
$db = new dbConn($set->db_host, $set->db_user, $set->db_pass, $set->db_name);
$set->sinfo = $db->get_row("SELECT * FROM `" . MAI_PREFIX . "settings`");
if (!$set->sinfo) {
    header("Location: install.php");
    exit;
}
// check if we have any cookie saved
if ($_COOKIE['pass'] == $set->sinfo->admin_pass) {
    $_SESSION['adminpass'] = $set->sinfo->admin_pass;
}
// get the settings for plugins
if (!is_array(unserialize($set->sinfo->active_plugins))) {
    $set->sinfo->active_plugins = serialize(array());
}
$_PS = $db->select("SELECT `name`,`value` FROM `" . MAI_PREFIX . "plugins_settings`");
if ($_PS) {
    foreach ($_PS as $__PS) {