6e6b6d2f074d7b478a3e6b19c3aa6df1ecdea586
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

1) <?php
2) 
3) require_once('session/start.php');
4) 
5) require_once('jabberaccounts.php');
6) 
bernd bisschen XSS-Schutz

bernd authored 16 years ago

7) require_once('inc/security.php');
8) 
9) 
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

10) require_role(ROLE_CUSTOMER);
11) 
12) require_once("inc/debug.php");
13) global $debugmode;
14) 
15) if ($_GET['action'] == 'new')
16) {
17)   check_form_token('jabber_new_account');
bernd Erst filtern, dann schauen...

bernd authored 16 years ago

18)   if (filter_input_username($_POST['local']) == '' ||
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

19)       $_POST['domain'] == '' ||
bernd Anführungszeichen filtern

bernd authored 16 years ago

20)       $_POST['password'] == '')
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

21)   {
22)     input_error('Sie müssen alle Felder ausfüllen!');
23)   }
24)   else
25)   {
bernd stripslashes und erlaube An...

bernd authored 16 years ago

26)     create_jabber_account($_POST['local'], $_POST['domain'], stripslashes($_POST['password']));
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

27)     if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 15 years ago

28)       header('Location: accounts');
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

29)   }
30) }
31) elseif ($_GET['action'] == 'chpass')
32) {
33)   check_form_token('jabber_chpass');
bernd Parse Error, hatte ich gar...

bernd authored 16 years ago

34)   get_jabberaccount_details($_POST['accountid']);
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

35)   if ($_POST['newpass'] == '' ||
36)       $_POST['newpass2'] == '' ||
37)       $_POST['newpass'] != $_POST['newpass2'] ||
38)       $_POST['accountid'] == '')
39)   {
40)     input_error('Bitte zweimal ein neues Passwort eingeben!');
41)   }
42)   else
43)   {
bernd stripslashes und erlaube An...

bernd authored 16 years ago

44)     change_jabber_password($_POST['accountid'], stripslashes($_POST['newpass']));
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

45)     if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 15 years ago

46)       header('Location: accounts');
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

47)   }
48) }
49) elseif ($_GET['action'] == 'delete')
50) {
bernd Umfangreiche Code-Aufräumar...

bernd authored 16 years ago

51)   $title = "Jabber-Account löschen";
52)   $section = 'jabber_accounts';
53)   
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

54)   $account = get_jabberaccount_details($_GET['account']);
bernd bisschen XSS-Schutz

bernd authored 16 years ago

55)   $account_string = filter_input_general( $account['local'].'@'.$account['domain'] );
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

56)   $sure = user_is_sure();
57)   if ($sure === NULL)
58)   {
59)     are_you_sure("action=delete&amp;account={$_GET['account']}", "Möchten Sie den Account »{$account_string}« wirklich löschen?");
60)   }
61)   elseif ($sure === true)
62)   {
63)     delete_jabber_account($account['id']);
64)     if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 15 years ago

65)       header("Location: accounts");
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

66)   }
67)   elseif ($sure === false)
68)   {
69)     if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 15 years ago

70)       header("Location: accounts");