|
3 | 3 | require_once("../../global/library.php");
|
4 | 4 |
|
5 | 5 | use FormTools\Administrator;
|
| 6 | +use FormTools\General; |
6 | 7 | use FormTools\Modules;
|
7 | 8 | use FormTools\Settings;
|
8 | 9 | use FormTools\Modules\SubmissionAccounts\Admin;
|
| 10 | +use FormTools\Modules\SubmissionAccounts\Users; |
9 | 11 |
|
10 | 12 | $module = Modules::initModulePage();
|
11 | 13 |
|
|
24 | 26 | // now, if there's a form ID available (e.g. passed to the page via GET or POST), see if the form has been
|
25 | 27 | // configured with submission accounts and if so, use the theme associated with the form
|
26 | 28 | $form_id = Modules::loadModuleField("submission_accounts", "form_id", "form_id", "");
|
| 29 | + |
27 | 30 | $submission_account = array();
|
28 | 31 | if (!empty($form_id)) {
|
29 | 32 | $submission_account = Admin::getSubmissionAccount($form_id);
|
|
46 | 49 | }
|
47 | 50 |
|
48 | 51 | // if trying to send password
|
| 52 | +$success = true; |
| 53 | +$message = ""; |
49 | 54 | if (isset($_POST["send_password"])) {
|
50 |
| - list($g_success, $g_message) = sa_send_password($form_id, $_POST); |
| 55 | + list($success, $message) = Users::sendPassword($form_id, $_POST, $L); |
51 | 56 | }
|
52 | 57 |
|
53 | 58 | $admin_info = Administrator::getAdminInfo();
|
54 | 59 | $admin_email = $admin_info["email"];
|
55 | 60 |
|
56 | 61 | $replacements = array("site_admin_email" => "<a href=\"mailto:$admin_email\">$admin_email</a>");
|
57 | 62 |
|
58 |
| -$page_vars = array(); |
59 |
| -$page_vars["text_forgot_password"] = ft_eval_smarty_string($L["text_forgot_password"], $replacements); |
60 |
| -$page_vars["error"] = $error; |
61 |
| -$page_vars["submission_account"] = $submission_account; |
62 |
| -$page_vars["main_error"] = $main_error; // an error SO BAD it prevents the login form from appearing |
63 |
| -$page_vars["module_settings"] = $module_settings; |
| 63 | +$page_vars = array( |
| 64 | + "g_success" => $success, |
| 65 | + "g_message" => $message, |
| 66 | + "text_forgot_password" => General::evalSmartyString($L["text_forgot_password"], $replacements), |
| 67 | + "error" => $error, |
| 68 | + "submission_account" => $submission_account, |
| 69 | + "main_error" => $main_error, // an error SO BAD it prevents the login form from appearing |
| 70 | + "module_settings" => $module_settings |
| 71 | +); |
| 72 | + |
64 | 73 | $page_vars["head_js"] = <<< END
|
65 | 74 | var rules = [];
|
66 | 75 | rules.push("required,email,{$L["validation_no_email"]}");
|
67 | 76 | END;
|
68 | 77 |
|
69 |
| -ft_display_module_page("templates/forget_password.tpl", $page_vars, $g_theme, $g_swatch); |
| 78 | +$module->displayPage("templates/forget_password.tpl", $page_vars, $g_theme, $g_swatch); |
0 commit comments