|
28 | 28 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 | 29 | */ |
30 | 30 |
|
31 | | -require_once '../../lib/config.inc.php'; |
32 | | -require_once '../../lib/app.inc.php'; |
33 | | - |
34 | | -include_once '../common.php'; |
35 | | - |
36 | | -// Check if we have an active users session and no login_as. |
37 | | -if ($_SESSION['s']['user']['active'] == 1 && @$_POST['login_as'] != 1) { |
38 | | - header('Location: /index.php'); |
39 | | - die(); |
40 | | -} |
41 | | - |
42 | | -$app->uses('tpl'); |
43 | | -$app->tpl->newTemplate('main_login.tpl.htm'); |
44 | | -$app->tpl->setInclude('content_tpl', 'templates/index.htm'); |
45 | | - |
46 | | -$error = ''; |
47 | | - |
48 | | -$app->load_language_file('web/login/lib/lang/'.$conf["language"].'.lng'); |
49 | | - |
50 | | -// Maintenance mode |
51 | | -$maintenance_mode = false; |
52 | | -$maintenance_mode_error = ''; |
53 | | -$server_config_array = $app->getconf->get_global_config('misc'); |
54 | | -if ($app->is_under_maintenance()) { |
55 | | - $maintenance_mode = true; |
56 | | - $maintenance_mode_error = $app->lng('error_maintenance_mode'); |
57 | | -} |
58 | | - |
59 | 31 | /** |
60 | 32 | * @param app $app |
61 | 33 | * @param $error |
@@ -408,6 +380,34 @@ function is_login_as(app $app, $username, $password) |
408 | 380 | return $loginAs; |
409 | 381 | } |
410 | 382 |
|
| 383 | +require_once '../../lib/config.inc.php'; |
| 384 | +require_once '../../lib/app.inc.php'; |
| 385 | + |
| 386 | +include_once '../common.php'; |
| 387 | + |
| 388 | +// Check if we have an active users session and no login_as. |
| 389 | +if ($_SESSION['s']['user']['active'] == 1 && @$_POST['login_as'] != 1) { |
| 390 | + header('Location: /index.php'); |
| 391 | + die(); |
| 392 | +} |
| 393 | + |
| 394 | +$app->uses('tpl'); |
| 395 | +$app->tpl->newTemplate('main_login.tpl.htm'); |
| 396 | +$app->tpl->setInclude('content_tpl', 'templates/index.htm'); |
| 397 | + |
| 398 | +$error = ''; |
| 399 | + |
| 400 | +$app->load_language_file('web/login/lib/lang/'.$conf["language"].'.lng'); |
| 401 | + |
| 402 | +// Maintenance mode |
| 403 | +$maintenance_mode = false; |
| 404 | +$maintenance_mode_error = ''; |
| 405 | +$server_config_array = $app->getconf->get_global_config('misc'); |
| 406 | +if ($app->is_under_maintenance()) { |
| 407 | + $maintenance_mode = true; |
| 408 | + $maintenance_mode_error = $app->lng('error_maintenance_mode'); |
| 409 | +} |
| 410 | + |
411 | 411 | //* Login Form was sent |
412 | 412 | if (count($_POST) > 0) { |
413 | 413 | process_login_request($app, $error, $conf, $module); |
|
0 commit comments