<?php require_once dirname(dirname(__FILE__)) . "/init.php"; require_once FS_ABS_PATH . "/php/html-utils.php"; global $show; if (!isset($show) || isset($_GET['show'])) { $show = true; fs_show_page(FS_ABS_PATH . "/php/tools/reset-password.php"); return; } ?> <div class="fwrap" style="width: 500px; margin: 0 auto; margin-bottom: 10px"> <h3><?php fs_e('Reset password'); ?> </h3> <?php $instructions = sprintf(fs_r("You can request an password reset email from here. If it does not work or you don't know your username or email, you can also change your password using the %s"), fs_link("tools.php?file_id=manage_users", fs_r('Emergency user management page'))) . "</br>"; echo '<div style="margin-bottom: 30px">'; if (isset($_POST['username'])) { echo $instructions; $username = $_POST['username']; $email = isset($_POST['email']) ? $_POST['email'] : ""; $user = fs_get_user_by_username_and_email($username, $email); if ($user === null) { echo "<div class='error'>" . fs_r("A user with this username and email was not found") . "</div>"; } else { if (is_object($user)) { $ok = fs_session_start();
<?php $enabled = false; require_once dirname(dirname(__FILE__)) . "/init.php"; require_once FS_ABS_PATH . "/php/html-utils.php"; if (!$enabled) { $msg = "<h3>" . fs_r("Message") . "</h3>"; $msg .= fs_r("This page will allow you to change the password of any user in FireStats.") . "<br/>"; $msg .= sprintf(fs_r("For security reasons, you must first edit the file %s"), "<b>" . __FILE__ . "</b>") . "<br/>"; $msg .= sprintf(fs_r("and change the line %s to %s and then refresh this page."), "<b>\$enabled = false;</b>", "<b>\$enabled = true;</b>") . "<br/>"; $msg .= fs_r("Don't forget to change it back when you are done.") . "<br/>"; fs_show_page($msg, false); } else { echo sprintf("%s Don't forget to change the line back to %s when you are done.", sprintf("<b>%s:</b>", fs_r("IMPORTANT")), "<b>\$enabled = false;</b>") . "<br/>"; $user = new stdClass(); $user->name = "Admin"; $user->id = 1; $user->security_level = SEC_ADMIN; fs_start_user_session($user); fs_show_page(FS_ABS_PATH . "/php/page-users.php"); }
} if ($show_db) { fs_dummy_auth(); fs_show_page(FS_ABS_PATH . '/php/page-database.php'); return; } // any other case, procceed with normal login screen. } else { if (fs_no_admin()) { fs_dummy_auth(); fs_show_page(FS_ABS_PATH . '/php/page-add-admin.php'); return; } } // to force login in DEMO mode, append ?login to the firestats url. if (defined('DEMO') && !isset($_GET['login'])) { $user = new stdClass(); $user->name = "Demo"; $user->id = 1; $user->security_level = SEC_USER; $res = fs_start_user_session($user); } else { $res = fs_resume_user_session(); } // if authenticated or database is not yet configured propertly, show main page (that will show db configuration or admin user creation pages) if ($res === true) { fs_show_page('php/tabbed-pane.php'); return; } else { fs_show_page(FS_ABS_PATH . '/login.php', true, true, true); }
<?php /** * This is a relativly clean hack to make files from some inner directory be relative to the root directory. */ $valid = false; if (isset($_REQUEST['file_id'])) { $valid = true; switch ($_REQUEST['file_id']) { case "import_bots": require_once dirname(__FILE__) . "/php/import-bots-list.php"; break; case "system_test": require_once dirname(__FILE__) . "/php/tools/system_test.php"; break; case "manage_users": require_once dirname(__FILE__) . "/php/tools/emergency-manage-users.php"; break; case "reset_password": require_once dirname(__FILE__) . "/php/tools/reset-password.php"; break; default: $valid = false; break; } } if (!$valid) { require_once dirname(__FILE__) . "/php/init.php"; require_once FS_ABS_PATH . "/php/html-utils.php"; fs_show_page(FS_ABS_PATH . "/php/tools-menu.php"); }