Skip to content

Commit 05e71c7

Browse files
author
pedro_morgan
committed
* Made login/index class php5
* Also replaces " with '
1 parent 6bb8787 commit 05e71c7

File tree

1 file changed

+23
-24
lines changed

1 file changed

+23
-24
lines changed

interface/web/login/index.php

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,42 +32,41 @@
3232

3333
class login_index {
3434

35-
var $status = '';
36-
var $target = '';
35+
public $status = '';
36+
private $target = '';
3737

38-
function render() {
39-
40-
if(is_array($_SESSION["s"]["user"]) && is_array($_SESSION["s"]["module"])) {
41-
die('HEADER_REDIRECT:'.$_SESSION["s"]["module"]["startpage"]);
38+
public function render() {
39+
if(isset($_SESSION['s']['user']) && is_array($_SESSION['s']['user']) && is_array($_SESSION['s']['module'])) {
40+
die('HEADER_REDIRECT:'.$_SESSION['s']['module']['startpage']);
4241
}
4342

4443
global $app;
45-
4644
$app->uses('tpl');
47-
$app->tpl->newTemplate("form.tpl.htm");
45+
$app->tpl->newTemplate('form.tpl.htm');
46+
47+
$error = '';
4848

4949

50-
51-
// Login Formular wurde abgesandt
50+
//* Login Formular wurde abgesandt
5251
if(count($_POST) > 0) {
5352
//die('Hier');
5453
// importiere Variablen
55-
$username = $app->db->quote($_POST["username"]);
56-
$passwort = $app->db->quote($_POST["passwort"]);
54+
$username = $app->db->quote($_POST['username']);
55+
$passwort = $app->db->quote($_POST['passwort']);
5756

5857
if($username != '' and $passwort != '') {
5958
$sql = "SELECT * FROM sys_user WHERE USERNAME = '$username' and ( PASSWORT = '".md5($passwort)."' or PASSWORT = password('$passwort') )";
6059
if($user = $app->db->queryOneRecord($sql)) {
61-
if($user["active"] == 1) {
60+
if($user['active'] == 1) {
6261
$user = $app->db->toLower($user);
6362
$_SESSION = array();
64-
$_SESSION["s"]["user"] = $user;
65-
$_SESSION["s"]["user"]["theme"] = $user["app_theme"];
66-
$_SESSION["s"]["language"] = $user["language"];
63+
$_SESSION['s']['user'] = $user;
64+
$_SESSION['s']['user']['theme'] = $user['app_theme'];
65+
$_SESSION['s']['language'] = $user['language'];
6766

68-
if(is_file($_SESSION["s"]["user"]["startmodule"]."/lib/module.conf.php")) {
69-
include_once($_SESSION["s"]["user"]["startmodule"]."/lib/module.conf.php");
70-
$_SESSION["s"]["module"] = $module;
67+
if(is_file($_SESSION['s']['user']['startmodule'].'/lib/module.conf.php')) {
68+
include_once($_SESSION['s']['user']['startmodule'].'/lib/module.conf.php');
69+
$_SESSION['s']['module'] = $module;
7170
}
7271

7372
//$site = $app->db->queryOneRecord("SELECT * FROM mb_sites WHERE name = '".$user["site_preset"]."'");
@@ -83,7 +82,7 @@ function render() {
8382
//$this->target = 'admin:index';
8483
//return '';
8584

86-
echo 'HEADER_REDIRECT:'.$_SESSION["s"]["module"]["startpage"];
85+
echo 'HEADER_REDIRECT:'.$_SESSION['s']['module']['startpage'];
8786
//echo 'HEADER_REDIRECT:content.php?s_mod=admin&s_pg=index';
8887
exit;
8988
} else {
@@ -92,7 +91,7 @@ function render() {
9291
} else {
9392
// Username oder Passwort falsch
9493
$error = $app->lng(1002);
95-
if($app->db->errorMessage != '') $error .= "<br>".$app->db->errorMessage != '';
94+
if($app->db->errorMessage != '') $error .= '<br>'.$app->db->errorMessage != '';
9695
}
9796
} else {
9897
// Username oder Passwort leer
@@ -109,7 +108,7 @@ function render() {
109108

110109

111110

112-
$app->tpl->setVar('error',$error);
111+
$app->tpl->setVar('error', $error);
113112
$app->tpl->setInclude('content_tpl','login/templates/index.htm');
114113
$app->tpl_defaults();
115114
//$app->tpl->pparse();
@@ -118,8 +117,8 @@ function render() {
118117

119118
return $app->tpl->grab();
120119

121-
}
120+
} // << end function
122121

123-
}
122+
} // << end class
124123

125124
?>

0 commit comments

Comments
 (0)