f12aba6daa6e2848a8ed60ea57b26874d6675f52
bernd Neues Jabber-Modul (noch ni...

bernd authored 17 years ago

1) <?php
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

2) /*
3) This file belongs to the Webinterface of schokokeks.org Hosting
4) 
Bernd Wurst Updated copyright notice (2...

Bernd Wurst authored 11 years ago

5) Written 2008-2013 by schokokeks.org Hosting, namely
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

6)   Bernd Wurst <bernd@schokokeks.org>
7)   Hanno Böck <hanno@schokokeks.org>
8) 
9) To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
10) 
11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
12) http://creativecommons.org/publicdomain/zero/1.0/
13) 
14) Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
15) */
bernd Neues Jabber-Modul (noch ni...

bernd authored 17 years ago

16) 
17) require_once('session/start.php');
18) 
19) require_once('jabberaccounts.php');
20) 
bernd bisschen XSS-Schutz

bernd authored 17 years ago

21) require_once('inc/security.php');
22) 
23) 
bernd Neues Jabber-Modul (noch ni...

bernd authored 17 years ago

24) require_role(ROLE_CUSTOMER);
25) 
26) require_once("inc/debug.php");
27) global $debugmode;
28) 
29) if ($_GET['action'] == 'new')
30) {
31)   check_form_token('jabber_new_account');
bernd Erst filtern, dann schauen...

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

35)   {
36)     input_error('Sie müssen alle Felder ausfüllen!');
37)   }
38)   else
39)   {
bernd stripslashes und erlaube An...

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

43)   }
44) }
45) elseif ($_GET['action'] == 'chpass')
46) {
47)   check_form_token('jabber_chpass');
bernd Parse Error, hatte ich gar...

bernd authored 17 years ago

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

bernd authored 17 years ago

49)   if ($_POST['newpass'] == '' ||
50)       $_POST['newpass2'] == '' ||
51)       $_POST['newpass'] != $_POST['newpass2'] ||
52)       $_POST['accountid'] == '')
53)   {
54)     input_error('Bitte zweimal ein neues Passwort eingeben!');
55)   }
56)   else
57)   {
bernd stripslashes und erlaube An...

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

61)   }
62) }
63) elseif ($_GET['action'] == 'delete')
64) {
bernd Umfangreiche Code-Aufräumar...

bernd authored 17 years ago

65)   $title = "Jabber-Account löschen";
66)   $section = 'jabber_accounts';
67)   
bernd Neues Jabber-Modul (noch ni...

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

70)   $sure = user_is_sure();
71)   if ($sure === NULL)
72)   {
bernd * alle internen Links sinnv...

bernd authored 15 years ago

73)     are_you_sure("action=delete&account={$_GET['account']}", "Möchten Sie den Account »{$account_string}« wirklich löschen?");
bernd Neues Jabber-Modul (noch ni...

bernd authored 17 years ago

74)   }
75)   elseif ($sure === true)
76)   {
77)     delete_jabber_account($account['id']);
78)     if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 16 years ago

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

bernd authored 17 years ago

80)   }
81)   elseif ($sure === false)
82)   {
83)     if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 16 years ago

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

bernd authored 17 years ago

85)   }
86) 
87) }
bernd Neue Jabber-Domains selbst...

bernd authored 15 years ago

88) elseif ($_GET['action'] == 'newdomain')
89) {
90)   check_form_token('jabber_new_domain');
91)   new_jabber_domain( $_REQUEST['domain'] );
92)   header("Location: accounts");
93) }