BUGFIX: store canceled games, don't delete them
[e-DoKo.git] / include / login.php
index 346c71e53e53b79173f9a64b1ec75ae1f43530db..c1a0e42029c6e1b5ffd2579524082a6a365c703d 100644 (file)
@@ -1,33 +1,36 @@
 <?php
-/* make sure that we are not called from outside the scripts, 
+/* make sure that we are not called from outside the scripts,
  * use a variable defined in config.php to check this
  */
 if(!isset($HOST))
   exit;
 
-if(!myisset("email","password"))
+/* check if login information is present */
+if(!myisset('email','password'))
   {
-    "can't log you in";
+    echo "can't log you in... missing login information.";
   }
 else
   {
-    $email     = $_REQUEST["email"];
-    $password  = $_REQUEST["password"];
+    $email     = $_REQUEST['email'];
+    $password  = $_REQUEST['password'];
 
     /* verify password and email */
     if(strlen($password)!=32)
       $password = md5($password);
-    
+
     $ok  = 1;
     $myid = DB_get_userid('email-password',$email,$password);
     if(!$myid)
       $ok = 0;
-    
+
     if($ok)
       {
-       /* user information is ok */
+       /* user information is ok, set session variabel */
        $myname = DB_get_name('email',$email);
-       $_SESSION["name"] = $myname;
+       $_SESSION['name'] = $myname;
+       $_SESSION['id']   = $myid;
+       $_SESSION['pass'] = $password;
       }
   }
 ?>
\ No newline at end of file