23 include(
"inc/common.php");
28 header(
"Location: home.php");
36 $username =
sanitize(trim($_POST[
"username"]));
37 $password = trim($_POST[
"password"]);
55 if($userdetails[
"active"]==0) {
57 }
else if($userdetails[
"active"]==-1) {
59 }
else if($userdetails[
"active"]==2) {
73 if($entered_pass != $userdetails[
"password"]) {
78 $errors[] =
"Die E-Mail-Adresse wurde noch nicht verifiziert.";
85 $loggedInUser->email = $userdetails[
"email"];
86 $loggedInUser->userId = $userdetails[
"id"];
87 $loggedInUser->passwordHash = $userdetails[
"password"];
88 $loggedInUser->title = $userdetails[
"title"];
89 $loggedInUser->username = $userdetails[
"username"];
93 $loggedInUser->updateLastActivity();
94 $loggedInUser->setStoredSession();
95 $_SESSION[
"userCakeUser"] = $loggedInUser;
103 if(isset($_GET[
'ref'])) {
104 $path =
"Location: ".$_GET[
'ref'];
118 if (!empty($_SERVER[
'HTTP_REFERER'])) {
119 $url = explode(
'/',$_SERVER[
'HTTP_REFERER']);
120 $url = $url[
sizeof($url)-1];
123 if (isset($pages[$url])) {
125 $url = str_replace(array(
'logout',
'login'),
'home', $url);
126 $smarty->assign(
'ref',
'?ref='.$url);