C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\webboard\do_send_password.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
/* $Id: do_send_password.php,v 1.1.1.1 2002/10/28 19:13:46 pbaecher Exp $ */
/*
          ThWboard - PHP/MySQL Bulletin Board System
        ==============================================
            (c) 2000, 2001 by
               Paul Baecher         <paul@thewall.de>
               Felix Gonschorek   <funner@thewall.de>

          download the latest version:
            http://www.thwboard.de

          This  program is  free  software;  you can
          redistribute it and/or modify it under the
          terms of the GNU General Public License as
          published by the Free Software Foundation;
          either  version 2 of  the License,  or (at
          your option) any later version.

        ==============================================

*/

include "./inc/header.inc.php";

/* 11/12/2001: since passwords are encrypted we need to
 *   to send the current *passwordhash* to the email address
 *   and wait for a confirmation with this hash.
 */
if( $config['use_email'] )
{
    
$r_user thwb_query("SELECT username, userpassword, useremail FROM ".$pref."user WHERE username='".addslashes($username)."' AND useremail='".addslashes($email)."'");
    if( 
mysql_num_rows($r_user) != )
    {
        
message("Fehler""Es gibt leider keinen Benutzer mit diesem Namen und dieser Email!");
    }
    else
    {
        
$user mysql_fetch_array($r_user);
        if( !
$hash )
        {
            
$TMail = new Template("./templates/mail/send_password_request.mail");

            
$username rawurlencode($user['username']);
            eval(
$TMail->GetTemplate("text"));

            @
mail($email"Passwort vergessen - $config[board_name]"$text"From: $config[board_admin]");
            
message("Best&#xE4;tigung""Es wurde eine Mail an die angegebene Email Adresse geschickt. Bitte lesen Sie diese, um die Passwort&#xE4;nderung zu vervollst&#xE4;ndigen.");
        }
        else
        {
            if( 
$hash != $user['userpassword'] )
            {
                
message("Fehler""Ung&#xFC;ltiger Hash.");
            }
            else
            {
                
$TMail = new Template("./templates/mail/send_password.mail");

                
/* generate a new password */
                
$user['userpassword'] = substr(md5(microtime()), 06);

                
thwb_query("UPDATE ".$pref."user SET userpassword='" md5($user['userpassword']) . "' WHERE username='" addslashes($username) . "'");                

                eval(
$TMail->GetTemplate("text"));
                @
mail($email"Passwort vergessen - $config[board_name]"$text"From: $config[board_admin]");

                
message("Passwort gesendet""Ein neues Passwort wurde generiert und an Ihre Email-Adresse geschickt.");
            }
        }
    }
}
else
{
    
message('Sorry',
        
'Der Forumadministrator hat diese Funktion leider deaktiviert. Wenn Sie Ihr Passwort vergessen haben, wenden
        Sie sich bitte an den <a href="mailto:' 
$config['board_admin'] . '">Forumadministrator</a>.');
}

?>