354c05a4ddd678c49bcbba458bffa7d13482139a
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 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) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 1 year ago

5) Written 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) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 1 year ago

9) This code is published under a 0BSD license.
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

10) 
11) 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.
12) */
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

13) 
14) require_once('session/start.php');
15) 
16) require_once('jabberaccounts.php');
17) 
bernd bisschen XSS-Schutz

bernd authored 16 years ago

18) require_once('inc/security.php');
19) 
20) 
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

21) require_role(ROLE_CUSTOMER);
22) 
23) require_once("inc/debug.php");
24) global $debugmode;
25) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

26) if ($_GET['action'] == 'new') {
27)     check_form_token('jabber_new_account');
28)     if (filter_input_username($_POST['local']) == '' ||
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

29)       $_POST['domain'] == '' ||
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

30)       $_POST['password'] == '') {
31)         input_error('Sie müssen alle Felder ausfüllen!');
32)     } else {
33)         create_jabber_account($_POST['local'], $_POST['domain'], stripslashes($_POST['password']));
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 6 months ago

34)         if (!$debugmode) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

35)             header('Location: accounts');
36)         }
37)     }
38) } elseif ($_GET['action'] == 'chpass') {
39)     check_form_token('jabber_chpass');
40)     get_jabberaccount_details($_POST['accountid']);
41)     if ($_POST['newpass'] == '' ||
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

42)       $_POST['newpass2'] == '' ||
43)       $_POST['newpass'] != $_POST['newpass2'] ||
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

44)       $_POST['accountid'] == '') {
45)         input_error('Bitte zweimal ein neues Passwort eingeben!');
46)     } else {
47)         change_jabber_password($_POST['accountid'], stripslashes($_POST['newpass']));
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 6 months ago

48)         if (!$debugmode) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

49)             header('Location: accounts');
50)         }
51)     }
52) } elseif ($_GET['action'] == 'delete') {
53)     $title = "Jabber-Account löschen";
54)     $section = 'jabber_accounts';
Hanno remove whitespace in empty...

Hanno authored 5 years ago

55) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

56)     $account = get_jabberaccount_details($_GET['account']);
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

57)     $account_string = $account['local'] . '@' . $account['domain'];
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

58)     $sure = user_is_sure();
59)     if ($sure === null) {
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

60)         are_you_sure("action=delete&account={$_GET['account']}", "Möchten Sie den Account »" . filter_output_html($account_string) . "« wirklich löschen?");
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

61)     } elseif ($sure === true) {
62)         delete_jabber_account($account['id']);
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 6 months ago

63)         if (!$debugmode) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

64)             header("Location: accounts");
65)         }
66)     } elseif ($sure === false) {
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 6 months ago

67)         if (!$debugmode) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

68)             header("Location: accounts");
69)         }
70)     }
71) } elseif ($_GET['action'] == 'newdomain') {
72)     check_form_token('jabber_new_domain');
73)     new_jabber_domain($_REQUEST['domain']);
74)     header("Location: accounts");
Bernd Wurst implemented deletion of unu...

Bernd Wurst authored 4 years ago

75) } elseif ($_GET['action'] == 'deldomain') {
76)     $title = "Jabber-Domain löschen";
77)     $section = 'jabber_accounts';
78)     $domain = new Domain((int) $_GET['domain']);
79)     $sure = user_is_sure();
80)     if ($sure === null) {
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

81)         are_you_sure("action=deldomain&domain={$_GET['domain']}", "Möchten Sie die Domain »" . filter_output_html($domain->fqdn) . "« aus der Jabber-Konfiguration entfernen?");
Bernd Wurst implemented deletion of unu...

Bernd Wurst authored 4 years ago

82)     } elseif ($sure === true) {
83)         delete_jabber_domain($domain->id);
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 6 months ago

84)         if (!$debugmode) {
Bernd Wurst implemented deletion of unu...

Bernd Wurst authored 4 years ago

85)             header("Location: accounts");
86)         }
87)     } elseif ($sure === false) {
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 6 months ago

88)         if (!$debugmode) {
Bernd Wurst implemented deletion of unu...

Bernd Wurst authored 4 years ago

89)             header("Location: accounts");
90)         }
91)     }
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

92) } else {
93)     system_failure("Unimplemented action");