X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=include%2Fuser.php;h=551e7d57038aa44c5ffe03c0b6cbfb7d81e249d5;hp=e8d38f7c3770026b7915b444222101058d157e91;hb=aeb9ef98850e762291bc6a1d39b31d1ac4db4817;hpb=21f25368b52c73be131cf3ad2d0cb7d1a567eb2a diff --git a/include/user.php b/include/user.php index e8d38f7..551e7d5 100644 --- a/include/user.php +++ b/include/user.php @@ -1,5 +1,5 @@ +/* Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012 Arun Persaud * * This file is part of e-DoKo. * @@ -25,12 +25,7 @@ if(!isset($HOST)) exit; /* test id and password, should really be done in one step */ -if(!isset($_SESSION['name'])) - { - $email = $_REQUEST['email']; - $password = $_REQUEST['password']; - } -else +if(isset($_SESSION['name'])) { $name = $_SESSION['name']; $email = DB_get_email('name',$name); @@ -75,8 +70,7 @@ if(myisset('forgot')) "to log into the server. The new password is valid for 24h, so make\n". "sure you reset your password to something new. Your old password will\n". "also still be valid until you set a new one.\n"; - $subject = 'Recovery'; - mymail($myid,$subject,$message); + mymail($myid,0, GAME_RECOVERY, $message); /* we save these in the database */ DB_set_recovery_password($myid,md5($newpw)); @@ -107,12 +101,14 @@ else { /* normal user page */ /* verify password and email */ - if(strlen($password)!=32) - $password = md5($password); - $ok = 1; - $myid = DB_get_userid('email-password',$email,$password); - if(!$myid) + if(isset($email, $password)) + { + $myid = DB_get_userid('email-password',$email,$password); + if(!$myid) + $ok = 0; + } + else $ok = 0; if($ok) @@ -122,6 +118,9 @@ else $_SESSION['name'] = $myname; $PREF = DB_get_PREF($myid); + /* set language chosen in preferences, will become active on the next reload (see index.php)*/ + $_SESSION['language'] = $PREF['language']; + set_language($PREF['language']); DB_update_user_timestamp($myid); @@ -139,12 +138,12 @@ else " Between $vac_start and $vac_stop other users will see the following message: $vac_comment.

\n"; } - echo '

'._('These are all your games').":

\n"; + echo '

'._('These are your games').":

\n"; /* output legend */ - echo '

'._('Games').": \n"; - echo '   = '._('pre-game phase'); - echo '   = '._('game in progess'); - echo 'N = '._('game over (N people played the same hand)').'
'; + echo "

\n"; + echo '    '._('pre-game phase'); + echo '    '._('game in progess'); + echo ' N  '._('game over (N people played this hand)').'
'; echo ' '._("Reminder: canceling a game can't be reversed!"); echo "

\n";