2626dd47daad110c63a82c0560b134e2364eeac3
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 Copyright year update

Bernd Wurst authored 6 years ago

5) Written 2008-2018 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) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

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) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

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

bernd authored 17 years ago

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

Hanno authored 6 years ago

33)       $_POST['password'] == '') {
34)         input_error('Sie müssen alle Felder ausfüllen!');
35)     } else {
36)         create_jabber_account($_POST['local'], $_POST['domain'], stripslashes($_POST['password']));
37)         if (! $debugmode) {
38)             header('Location: accounts');
39)         }
40)     }
41) } elseif ($_GET['action'] == 'chpass') {
42)     check_form_token('jabber_chpass');
43)     get_jabberaccount_details($_POST['accountid']);
44)     if ($_POST['newpass'] == '' ||
bernd Neues Jabber-Modul (noch ni...

bernd authored 17 years ago

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

Hanno authored 6 years ago

47)       $_POST['accountid'] == '') {
48)         input_error('Bitte zweimal ein neues Passwort eingeben!');
49)     } else {
50)         change_jabber_password($_POST['accountid'], stripslashes($_POST['newpass']));
51)         if (! $debugmode) {
52)             header('Location: accounts');
53)         }
54)     }
55) } elseif ($_GET['action'] == 'delete') {
56)     $title = "Jabber-Account löschen";
57)     $section = 'jabber_accounts';
bernd Umfangreiche Code-Aufräumar...

bernd authored 17 years ago

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

Hanno authored 6 years ago

59)     $account = get_jabberaccount_details($_GET['account']);
60)     $account_string = filter_input_general($account['local'].'@'.$account['domain']);
61)     $sure = user_is_sure();
62)     if ($sure === null) {
63)         are_you_sure("action=delete&account={$_GET['account']}", "Möchten Sie den Account »{$account_string}« wirklich löschen?");
64)     } elseif ($sure === true) {
65)         delete_jabber_account($account['id']);
66)         if (! $debugmode) {
67)             header("Location: accounts");
68)         }
69)     } elseif ($sure === false) {
70)         if (! $debugmode) {
71)             header("Location: accounts");
72)         }
73)     }
74) } elseif ($_GET['action'] == 'newdomain') {
75)     check_form_token('jabber_new_domain');
76)     new_jabber_domain($_REQUEST['domain']);
77)     header("Location: accounts");
78) } else {
79)     system_failure("Unimplemented action");