-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathlogin.processor.php
More file actions
59 lines (47 loc) · 1.26 KB
/
login.processor.php
File metadata and controls
59 lines (47 loc) · 1.26 KB
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
53
54
55
56
57
58
59
<?php
if (!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
header('HTTP/1.0 404 Not Found');
exit;
}
define('IN_MANAGER_MODE', 'true');
define('MODX_API_MODE', true);
ini_set('display_errors', '1');
include_once '../../index.php';
include_once(MODX_BASE_PATH . 'manager/includes/document.parser.class.inc.php');
$modx = new DocumentParser;
$modx->getSettings();
include_once(__DIR__ . '/login.processor.functions.php');
$modx->config['login_by'] = 'username,email';
checkSafedUri();
if (!validateLoginInput()) {
return;
}
$_SESSION['safeMode'] = input('safeMode');
if (!sessionv('SystemAlertMsgQueque')) {
$_SESSION['SystemAlertMsgQueque'] = [];
}
$modx->SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
OnBeforeManagerLogin();
if (isBlockedUser()) {
@session_destroy();
session_unset();
jsAlert(alert()->errors[902]);
}
if (!checkAllowedIp() || !checkAllowedDays()) {
return;
}
evo()->loadExtension('ManagerAPI');
// invoke OnManagerAuthentication event
if (!OnManagerAuthentication()) {
if (!validPassword(input('password'), user('password'))) {
jsAlert(alert()->errors[901]);
failedLogin();
return;
}
if (!checkCaptcha()) {
return;
}
}
managerLogin();
OnManagerLogin();
redirectAfterLogin();