Skip to content

Commit 8414f38

Browse files
committed
Moved all the functions on top of the file.
1 parent b517b7c commit 8414f38

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

interface/web/login/index.php

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,34 +28,6 @@
2828
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
*/
3030

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-
5931
/**
6032
* @param app $app
6133
* @param $error
@@ -408,6 +380,34 @@ function is_login_as(app $app, $username, $password)
408380
return $loginAs;
409381
}
410382

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+
411411
//* Login Form was sent
412412
if (count($_POST) > 0) {
413413
process_login_request($app, $error, $conf, $module);

0 commit comments

Comments
 (0)