示例#1
0
                        unset($valid_mimetype);
                    } else {
                        if ($mime_types[$extension] != $each['type']) {
                            die('Prevented an unwanted file upload attempt!');
                        }
                    }
                }
                unset($file_info, $extension);
            }
        }
        unset($mime_types);
    }
}
$defender = new defender();
// Set admin login procedures
Authenticate::setAdminLogin();
$defender->debug_notice = FALSE;
// turn this off after beta.
$defender->sniff_token();
$dynamic = new dynamics();
$dynamic->boot();
$fusion_page_head_tags =& \PHPFusion\OutputHandler::$pageHeadTags;
$fusion_page_footer_tags =& \PHPFusion\OutputHandler::$pageFooterTags;
$fusion_jquery_tags =& \PHPFusion\OutputHandler::$jqueryTags;
// Set theme using $_GET as well.
// Set theme
if ($userdata['user_level'] == USER_LEVEL_SUPER_ADMIN && isset($_GET['themes']) && theme_exists($_GET['themes'])) {
    $newUserTheme = array("user_id" => $userdata['user_id'], "user_theme" => stripinput($_GET['themes']));
    dbquery_insert(DB_USERS, $newUserTheme, "update");
    redirect(clean_request("", array("themes"), FALSE));
}
/**
 * Check if admin password matches userdata
 * @param string $password
 * @return boolean
 */
function check_admin_pass($password)
{
    return Authenticate::validateAuthAdmin($password);
}
示例#3
0
    $db_user = (string) (stripinput(trim(filter_input(INPUT_POST, 'db_user'))) ?: $db_user);
    $db_pass = (string) (stripinput(filter_input(INPUT_POST, 'db_pass')) ?: $db_pass);
    $db_name = (string) (stripinput(trim(filter_input(INPUT_POST, 'db_name'))) ?: $db_name);
    $db_prefix = (string) (stripinput(trim(filter_input(INPUT_POST, 'db_prefix'))) ?: $db_prefix);
}
$locale_files = makefilelist("../locale/", ".svn|.|..", TRUE, "folders");
include_once INCLUDES . "dynamics/dynamics.inc.php";
DatabaseFactory::setDefaultDriver(intval($pdo_enabled) === 1 ? DatabaseFactory::DRIVER_PDO_MYSQL : DatabaseFactory::DRIVER_MYSQL);
require_once INCLUDES . "db_handlers/all_functions_include.php";
if (defined('DB_PREFIX')) {
    require_once INCLUDES . 'multisite_include.php';
    dbconnect($db_host, $db_user, $db_pass, $db_name, FALSE);
}
$settings = fusion_get_settings();
if ($settings) {
    $userdata = Authenticate::validateAuthUser();
    if (INSTALLATION_STEP != 8 and dbresult(dbquery('SELECT exists(SELECT * FROM ' . DB_PREFIX . 'users)'), 0) and intval($userdata['user_level']) !== USER_LEVEL_SUPER_ADMIN) {
        // TODO: handle this case better way
        exit('You are not superadmin.');
    }
}
$localeset = filter_input(INPUT_GET, 'localeset') ?: (isset($settings['locale']) ? $settings['locale'] : 'English');
define('LANGUAGE', is_dir(LOCALE . $localeset) ? $localeset : 'English');
define("LOCALESET", LANGUAGE . "/");
include LOCALE . LOCALESET . "setup.php";
require_once LOCALE . LOCALESET . 'global.php';
$dynamics = new dynamics();
$dynamics->boot();
$system_apps = array('articles' => $locale['articles']['title'], 'blog' => $locale['blog']['title'], 'downloads' => $locale['downloads']['title'], 'eshop' => $locale['eshop']['title'], 'faqs' => $locale['faqs']['title'], 'forums' => $locale['forums']['title'], 'news' => $locale['news']['title'], 'photos' => $locale['photos']['title'], 'polls' => $locale['polls']['title'], 'weblinks' => $locale['weblinks']['title']);
$buttons = array('next' => array('next', $locale['setup_0121']), 'finish' => array('next', $locale['setup_0123']), 'done' => array('done', $locale['setup_0120']), 'refresh' => array('next', $locale['setup_1105']), 'tryagain' => array('next', $locale['setup_0122']), 'back' => array('back', $locale['setup_0122']));
$buttonMode = NULL;
示例#4
0
 public static function setAdminLogin()
 {
     global $locale, $defender;
     if (isset($_GET['logout'])) {
         self::expireAdminCookie();
         redirect(BASEDIR . "index.php");
     }
     if (isset($_POST['admin_password'])) {
         $admin_password = form_sanitizer($_POST['admin_password'], '', 'admin_password');
         if ($defender->safe()) {
             if (\PHPFusion\Authenticate::validateAuthAdmin($admin_password)) {
                 if (Authenticate::setAdminCookie($admin_password)) {
                     redirect(FUSION_REQUEST);
                 } else {
                     addNotice("danger", $locale['cookie_error'], $locale['cookie_error_description']);
                 }
             } else {
                 addNotice("danger", $locale['password_invalid'], $locale['password_invalid_description']);
             }
         }
     }
     if (defined('ADMIN_PANEL') && !isset($_COOKIE[COOKIE_PREFIX . "admin"])) {
         addNotice("danger", $locale['cookie_title'], $locale['cookie_description']);
     }
 }