-
Notifications
You must be signed in to change notification settings - Fork 0
/
forget_password.php
52 lines (40 loc) · 1.42 KB
/
forget_password.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
require_once("global/library.php");
use FormTools\Accounts;
use FormTools\Administrator;
use FormTools\Core;
use FormTools\General;
use FormTools\Pages;
use FormTools\Settings;
use FormTools\Themes;
Core::init();
$settings = Settings::get();
$admin_info = Administrator::getAdminInfo();
$admin_email = $admin_info["email"];
$id = General::getLoginOverrideId();
$LANG = Core::$L;
// if trying to send password
$success = true;
$message = "";
if (isset($_POST) && !empty($_POST)) {
list ($success, $message) = Accounts::sendPassword($_POST);
}
$username = General::stripChars((isset($_POST["username"]) && !empty($_POST["username"])) ? $_POST["username"] : "");
$replacements = array("site_admin_email" => "<a href=\"mailto:$admin_email\">$admin_email</a>");
$head_js =<<<END
var rules = [];
rules.push("required,username,{$LANG['validation_no_username']}");
$(function() { document.forget_password.username.focus(); });
END;
$page_vars = array(
"text_forgot_password" => General::evalSmartyString($LANG["text_forgot_password"], $replacements),
"g_success" => $success,
"g_message" => $message,
"head_title" => $settings["program_name"],
"page" => "forgot_password",
"page_url" => Pages::getPageUrl("forgot_password"),
"settings" => $settings,
"username" => $username,
"head_js" => $head_js
);
Themes::displayPage("forget_password.tpl", $page_vars, Core::$user->getTheme(), Core::$user->getSwatch());