71e87c960a844568bbe0c2a7dd012d8b9247b037
bernd Neues Jabber-Modul (noch ni...

bernd authored 18 years ago

1) <?php
Hanno Böck Add newlines before comment...

Hanno Böck authored 11 months ago

2) 
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 13 years ago

3) /*
4) This file belongs to the Webinterface of schokokeks.org Hosting
5) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 3 years ago

6) Written by schokokeks.org Hosting, namely
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 13 years ago

7)   Bernd Wurst <bernd@schokokeks.org>
8)   Hanno Böck <hanno@schokokeks.org>
9) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 3 years ago

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

Bernd Wurst authored 13 years ago

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

bernd authored 18 years ago

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

bernd authored 18 years ago

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

bernd authored 18 years ago

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

Hanno authored 7 years ago

27) if ($_GET['action'] == 'new') {
28)     check_form_token('jabber_new_account');
Hanno Böck Neuer @PER codingstyle mit...

Hanno Böck authored 5 months ago

29)     if (filter_input_username($_POST['local']) == ''
30)       || $_POST['domain'] == ''
31)       || $_POST['password'] == '') {
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

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

Hanno Böck authored 2 years ago

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

Hanno authored 7 years ago

36)             header('Location: accounts');
37)         }
38)     }
39) } elseif ($_GET['action'] == 'chpass') {
40)     check_form_token('jabber_chpass');
41)     get_jabberaccount_details($_POST['accountid']);
Hanno Böck Neuer @PER codingstyle mit...

Hanno Böck authored 5 months ago

42)     if ($_POST['newpass'] == ''
43)       || $_POST['newpass2'] == ''
44)       || $_POST['newpass'] != $_POST['newpass2']
45)       || $_POST['accountid'] == '') {
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

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

Hanno Böck authored 2 years ago

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

Hanno authored 7 years ago

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

Hanno authored 7 years ago

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

Hanno authored 7 years ago

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

Hanno Böck authored 2 years ago

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

Hanno authored 7 years ago

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

Hanno Böck authored 2 years ago

61)         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 7 years ago

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

Hanno Böck authored 2 years ago

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

Hanno authored 7 years ago

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

Hanno Böck authored 2 years ago

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

Hanno authored 7 years ago

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

Bernd Wurst authored 5 years ago

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

Hanno Böck authored 2 years ago

82)         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 5 years ago

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

Hanno Böck authored 2 years ago

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

Bernd Wurst authored 5 years ago

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

Hanno Böck authored 2 years ago

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

Bernd Wurst authored 5 years ago

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

Hanno authored 7 years ago

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