Example #1
0
function initialize()
{
    global $txt, $context, $smfInfo, $sourcedir, $forum_version, $db_show_debug, $db_last_error, $modSettings;
    // Set this to true so we get the correct forum value
    $ssi_gzip = true;
    $forum_version = get_file_versions(true);
    $smfInfo = !empty($modSettings['smfInfo']) ? $modSettings['smfInfo'] : '';
    if (empty($smfInfo) || allowedTo('admin_forum') && isset($_GET['regenerate'])) {
        generate_password();
    }
    // If the user isn't an admin or they don't have a password in the URL, or its incorrect, kick 'em out
    if (!allowedTo('admin_forum') && (!isset($_POST['pass']) || strcmp($_POST['pass'], $smfInfo) != 0)) {
        show_password_form();
    }
    // Either their an admin or have the right password
    require_once $sourcedir . '/Subs-Package.php';
    // Enable error reporting.
    error_reporting(E_ALL);
    @session_start();
    if ($context['user']['is_admin'] && isset($_GET['delete'])) {
        // This won't work on all servers...
        @unlink(__FILE__);
        // Now just redirect to the forum...
        redirectexit();
    }
}
Example #2
0
/**
 * Generate the fetch passsword or accept one so support can see the info
 */
function initialize()
{
    global $context, $elkinfo, $forum_version, $modSettings;
    $forum_version = get_file_versions(true);
    $elkinfo = !empty($modSettings['elkinfo']) ? $modSettings['elkinfo'] : '';
    if (empty($elkinfo) || allowedTo('admin_forum') && isset($_GET['regenerate'])) {
        generate_password();
    }
    // If the user isn't an admin or they don't have a password in the URL, or its incorrect, kick 'em out
    if (!allowedTo('admin_forum') && (!isset($_POST['pass']) || strcmp($_POST['pass'], $elkinfo) != 0)) {
        show_password_form();
    }
    // Either their an admin or have the right password
    require_once SUBSDIR . '/Package.subs.php';
    // Enable error reporting.
    error_reporting(E_ALL);
    @session_start();
    // Try to remove the info file
    if ($context['user']['is_admin'] && isset($_GET['delete'])) {
        // This won't work on all servers...
        @unlink(__FILE__);
        // Now just redirect to the forum...
        redirectexit();
    }
}