$email = DB_get_email('name',$name);
$password = DB_get_passwd_by_name($name);
};
$email = DB_get_email('name',$name);
$password = DB_get_passwd_by_name($name);
};
if($number >1)
echo "N.B. You tried this already $number times during the last day and it will only work ".
" 5 times during a day.<br />";
if($number >1)
echo "N.B. You tried this already $number times during the last day and it will only work ".
" 5 times during a day.<br />";
echo "Back to the <a href=\"$INDEX\">main page</a>.";
/* create temporary password, use the fist 8 letters of a md5 hash */
$TIME = (string) time(); /* to avoid collisions */
echo "Back to the <a href=\"$INDEX\">main page</a>.";
/* create temporary password, use the fist 8 letters of a md5 hash */
$TIME = (string) time(); /* to avoid collisions */
$newpw = substr($hash,1,8);
$message = "Someone (hopefully you) requested a new password. \n".
$newpw = substr($hash,1,8);
$message = "Someone (hopefully you) requested a new password. \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";
"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";
/* we save these in the database */
DB_set_recovery_password($myid,md5($newpw));
/* we save these in the database */
DB_set_recovery_password($myid,md5($newpw));
{
/* make it so that people (or a robot) can request thousands of passwords within a short time
* and spam a user this way */
{
/* make it so that people (or a robot) can request thousands of passwords within a short time
* and spam a user this way */
- echo "Sorry you already tried 5 times during the last 24h.<br />".
- "You need to use one of those passwords or wait to get a new one.<br />";
+ echo _('Sorry you already tried 5 times during the last 24h.<br />'.
+ 'You need to use one of those passwords or wait to get a new one.').'<br />';
"Please try <a href=\"$INDEX\">again</a>.";
else /* default error message */
echo "Couldn't find a player with this email! <br />".
"Please try <a href=\"$INDEX\">again</a>.";
else /* default error message */
echo "Couldn't find a player with this email! <br />".
{
/* user information is ok */
$myname = DB_get_name('email',$email);
{
/* user information is ok */
$myname = DB_get_name('email',$email);