| | |
| | | |
| | | if($username != '' and $passwort != '') { |
| | | $sql = "SELECT * FROM sys_user WHERE USERNAME = '$username' and ( PASSWORT = '".md5($passwort)."' or PASSWORT = password('$passwort') )"; |
| | | if($user = $app->db->queryOneRecord($sql)) { |
| | | $user = $app->db->queryOneRecord($sql); |
| | | if($user) { |
| | | if($user['active'] == 1) { |
| | | $user = $app->db->toLower($user); |
| | | $_SESSION = array(); |
| | | $_SESSION['s']['user'] = $user; |
| | | $_SESSION['s']['user']['theme'] = $user['app_theme']; |
| | | $_SESSION['s']['user']['theme'] = isset($user['app_theme']) ? $user['app_theme'] : 'default'; |
| | | $_SESSION['s']['language'] = $user['language']; |
| | | |
| | | //print_r($_SESSION); |
| | | if(is_file($_SESSION['s']['user']['startmodule'].'/lib/module.conf.php')) { |
| | | include_once($_SESSION['s']['user']['startmodule'].'/lib/module.conf.php'); |
| | | $_SESSION['s']['module'] = $module; |
| | | } |
| | | |
| | | // TODO: What is all this - pedro |
| | | //$site = $app->db->queryOneRecord("SELECT * FROM mb_sites WHERE name = '".$user["site_preset"]."'"); |
| | | //$_SESSION["s"]["site"] = $site; |
| | | |
| | |
| | | $error = $app->lng(1003); |
| | | } |
| | | } else { |
| | | // Username oder Passwort falsch |
| | | //* Incorrect login - Username and password incorrect |
| | | $error = $app->lng(1002); |
| | | if($app->db->errorMessage != '') $error .= '<br>'.$app->db->errorMessage != ''; |
| | | } |
| | | } else { |
| | | // Username oder Passwort leer |
| | | //* Username or password empty |
| | | $error = $app->lng(1001); |
| | | } |
| | | } |
| | | if($error != ''){ |
| | | $error = '<table width="100%" border="0" cellspacing="0" cellpadding="2"> |
| | | $error = '<table class="error"> |
| | | <tr> |
| | | <td class="error"><b>Error:</b><br>'.$error.'</td> |
| | | <td><strong>Error:</strong><br>'.$error.'</td> |
| | | </tr> |
| | | </table>'; |
| | | } |