dcc202fb249a446ac15c7cf413b9f1b4a3f31b58
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']));
34)         if (! $debugmode) {
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']));
48)         if (! $debugmode) {
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']);
Bernd Wurst Umstellung von filter_input...

Bernd Wurst authored 4 years 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) {
Bernd Wurst fixing syntax error

Bernd Wurst authored 4 years 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']);
63)         if (! $debugmode) {
64)             header("Location: accounts");
65)         }
66)     } elseif ($sure === false) {
67)         if (! $debugmode) {
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) {
81)         are_you_sure("action=deldomain&domain={$_GET['domain']}", "Möchten Sie die Domain »".filter_output_html($domain->fqdn)."« aus der Jabber-Konfiguration entfernen?");
82)     } elseif ($sure === true) {
83)         delete_jabber_domain($domain->id);
84)         if (! $debugmode) {
85)             header("Location: accounts");
86)         }
87)     } elseif ($sure === false) {
88)         if (! $debugmode) {
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");