<?php
-/* Copyright 2006, 2007, 2008, 2009, 2010 Arun Persaud <arun@nubati.net>
+/* Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Arun Persaud <arun@nubati.net>
*
* This file is part of e-DoKo.
*
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);
$hash = md5('Anewpassword'.$email.$TIME);
$newpw = substr($hash,1,8);
- $message = "Someone (hopefully you) requested a new password. \n".
- "You can use this email and the following password: \n".
- " $newpw \n".
+ $message = sprintf( _("Someone (hopefully you) requested a new password.\n".
+ "You can use this email and the following password:\n".
+ " %s\n".
"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);
+ "also still be valid until you set a new one.\n"), $newpw);
+ mymail($myid,0, GAME_RECOVERY, $message);
/* we save these in the database */
DB_set_recovery_password($myid,md5($newpw));
{ /* 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)
$_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);
" Between $vac_start and $vac_stop other users will see the following message: $vac_comment.</p>\n";
}
- echo '<h4>'._('These are all your games').":</h4>\n";
+ echo '<h4>'._('These are your games').":</h4>\n";
/* output legend */
- echo '<p>'._('Games').": \n";
- echo '<span class="gamestatuspre"> </span> = '._('pre-game phase');
- echo '<span class="gamestatusplay"> </span> = '._('game in progess');
- echo '<span class="gamestatusover "><a>N</a> </span> = '._('game over (N people played the same hand)').' <br />';
+ echo "<p>\n";
+ echo ' <span class="gamestatuspre"> </span> '._('pre-game phase');
+ echo ' <span class="gamestatusplay"> </span> '._('game in progess');
+ echo ' <span class="gamestatusover "><a>N</a> </span> '._('game over (N people played this hand)').' <br />';
echo ' '._("Reminder: canceling a game can't be reversed!");
echo "</p>\n";