Make startup phase smoother: less reloading of pages and less text messages to the...
[e-DoKo.git] / include / user.php
index d85dac50179d39d1e9e7af9fc6a40fcef36edf6b..65544f56fc020999d9b0c29d576d9c9dbc8515ab 100644 (file)
@@ -25,11 +25,15 @@ if(!isset($HOST))
   exit;
 
 /* test id and password, should really be done in one step */
   exit;
 
 /* test id and password, should really be done in one step */
-if(isset($_SESSION['name']))
+if(isset($_SESSION['id']))
   {
   {
-    $name = $_SESSION['name'];
-    $email     = DB_get_email('name',$name);
-    $password  = DB_get_passwd_by_name($name);
+    $myid = $_SESSION['id'];
+    $r = DB_query_array("SELECT email,password FROM User WHERE id=".DB_quote_smart($myid)."");
+    if($r)
+      {
+       $email     = $r[0];
+       $password  = $r[1];
+      };
   };
 
 global  $ADMIN_NAME;
   };
 
 global  $ADMIN_NAME;
@@ -46,6 +50,8 @@ if(myisset('forgot'))
 
     if($ok)
       {
 
     if($ok)
       {
+       set_language($myid,'uid');
+
        /* check how many entries in recovery table */
        $number = DB_get_number_of_passwords_recovery($myid);
 
        /* check how many entries in recovery table */
        $number = DB_get_number_of_passwords_recovery($myid);
 
@@ -154,7 +160,7 @@ else
                           " G.session".
                           " FROM Hand".
                           " LEFT JOIN Game G ON G.id=Hand.game_id".
                           " G.session".
                           " FROM Hand".
                           " LEFT JOIN Game G ON G.id=Hand.game_id".
-                          " WHERE user_id='$myid'".
+                          " WHERE user_id=".DB_quote_smart($myid).
                           " ORDER BY G.session,G.create_date" );
 
        /* sort into active and passive sessions */
                           " ORDER BY G.session,G.create_date" );
 
        /* sort into active and passive sessions */