6e6b6d2f074d7b478a3e6b19c3aa6df1ecdea586
bernd Auch mailaccounts können si...

bernd authored 16 years ago

1) <?php
2) 
3) require_once('session/start.php');
4) 
5) require_once('mailaccounts.php');
6) 
7) require_role(ROLE_MAILACCOUNT);
8) 
9) $account = $_SESSION['accountname'];
10) 
11) $title = "Passwort ändern";
12) 
13) if ($_POST['password1'] != '')
14) {
15)   check_form_token('imap_chpass');
16)   $result = find_role($_SESSION['mailaccount'], $_POST['old_password']);
17) 
18)   if ($_POST['old_password'] == '')
19)     input_error('Altes Passwort nicht angegeben!');
20)   elseif (! $result & ROLE_MAILACCOUNT)
21)     input_error('Das bisherige Passwort ist nicht korrekt!');
22)   elseif ($_POST['password2'] != $_POST['password1'])
23)     input_error('Die Bestätigung ist nicht identisch mit dem neuen Passwort!');
24)   elseif ($_POST['password2'] == '')
25)     input_error('Sie müssen das neue Passwort zweimal eingeben!');
26)   elseif (($check = strong_password($_POST['password1'])) !== true)
27)     input_error("Das Passwort ist zu einfach (cracklib sagt: {$check})!");
28)   else {
29)     change_mailaccount(get_mailaccount_id($_SESSION['mailaccount']), array('password' => $_POST['password1']));
30)     if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 15 years ago

31)       header('Location: chpass');
bernd Auch mailaccounts können si...

bernd authored 16 years ago

32)     else
33)       output('');
34)   }
35) }
36) 
37) 
38) 
bernd Entities repariert

bernd authored 16 years ago

39) output('<h3>Passwort ändern</h3>
40) <p>Hier können Sie Ihr Passwort ändern.</p>
bernd eliminate .php extensions f...

bernd authored 15 years ago

41) '.html_form('imap_chpass', 'chpass', '', '<table>
bernd Auch mailaccounts können si...

bernd authored 16 years ago

42)   <tr>
43)     <td>bisheriges Passwort:</td>  <td><input type="password" name="old_password" value="" /></td>
44)   </tr>
45)   <tr>
46)     <td>neues Passwort:</td>       <td><input type="password" name="password1" value="" /></td>
47)   </tr>
48)   <tr>
bernd Entities repariert

bernd authored 16 years ago

49)     <td>Bestätigung:<br /><span style="font-size: 80%;">(nochmal neues Passwort)</span></td>