C:\$Recycle.Bin\S-1-5-21-3967099092-2644009230-141905953-500\$RTL8YJG\changeemail.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
/* $Id: changeemail.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";

if( 
$g_user['userid'] == )
{
    
message('Fehler''Bitte erst einloggen.');
}
else
{
    
$user $HTTP_POST_VARS['user'];

    if( !
$change )
    {
        
$TFrame = new Template('./templates/'.$style['styletemplate'].'/frame.html');
        
$TChangeemail = new Template('./templates/'.$style['styletemplate'].'/changeemail.html');

        
$t_changewarning '';

        if( 
$config['use_email'] )
        {
            
$TChangeemail_warning = new Template('./templates/'.$style['styletemplate'].'/changeemail_warning.html');
            eval(
$TChangeemail_warning->GetTemplate('t_changewarning'));
        }

        
$navpath .= 'Email Adresse &auml;ndern';

        eval(
$TChangeemail->GetTemplate("CONTENT"));
        eval(
$TFrame->GetTemplate());
    }
    else
    {
        
$r_user thwb_query("SELECT userpassword, username FROM ".$pref."user WHERE userid='$g_user[userid]'");
        
$dbuser mysql_fetch_array($r_user);

        if( !
$user['useroldpassword'] || $dbuser['userpassword'] != md5($user['useroldpassword']) )
        {
            
message('Fehler''Das Passwort ist leider nicht korrekt.');
        }
        else if( !
check_email($user['usernewemail']) )
        {
            
message('Fehler''Sie haben keine g&uuml;ltige E-Mailadresse angegeben!<br>Eine g&uuml;ltige E-Mailadresse hat das Format <b>irgendwas@irgendwo.toplvl</b> (toplvl max. 4 Zeichen).');
        }
        else
        {
            if( 
$config['use_email'] )
            {
                
// generate a new password
                
$user['userpassword'] = substr(md5(microtime()), 06);
                
                
thwb_query("UPDATE ".$pref."user SET userpassword='".addslashes(md5($user['userpassword']))."', useremail='".addslashes($user['usernewemail'])."'
                    WHERE userid=
$g_user[userid]");


                
$TMail = new Template("./templates/mail/send_password.mail");
                
$user['username'] = $dbuser['username'];
                eval(
$TMail->GetTemplate("text"));

                @
mail($user['usernewemail'], "Login Daten f&uuml;r $config[board_name]"$text"From: $config[board_admin]");
                
                
message('Hinweis',
                    
'Ihre E-Mailadresse wurde geändert und ein neuen Passwort generiert. Das Passwort wurde an Ihre neue E-Mailadresse
                    geschickt. Bitte <a href="login.php">loggen</a> Sie sich jetzt neu ein.'
);
            }
            else
            {
                
thwb_query("UPDATE ".$pref."user SET useremail='$user[usernewemail]'
                    WHERE userid=
$g_user[userid]");
                
                
message('Hinweis',
                    
'Ihre Email-Adresse wurde erfolgreich geändert.');
            }
        }
    }
}

?>