4dff8924ef93a88bbd80cbfac817b98a765a7800
bernd Systemuser-Modul hinzugefügt

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

Hanno Böck authored 2 years 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 2 years 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 Systemuser-Modul hinzugefügt

bernd authored 17 years ago

13) 
14) require_once('session/start.php');
15) 
16) require_once('useraccounts.php');
17) 
18) require_once('inc/security.php');
19) 
20) 
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 2 years ago

21) require_role([ROLE_CUSTOMER, ROLE_SYSTEMUSER]);
bernd Erlaube Änderung von Name u...

bernd authored 14 years ago

22) 
23) $role = $_SESSION['role'];
bernd Systemuser-Modul hinzugefügt

bernd authored 17 years ago

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

Hanno authored 6 years ago

28) if ($_GET['action'] == 'new') {
29)     system_failure('not implemented');
30) } elseif ($_GET['action'] == 'pwchange') {
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 11 months ago

31)     if (!$role & ROLE_CUSTOMER) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

32)         system_failure("Zum Ändern Ihres Passworts verwenden Sie bitte die Funktion im Hauptmenü!");
33)     }
34)     $error = false;
35)     check_form_token('systemuser_pwchange');
36)     if (customer_useraccount($_REQUEST['uid'])) {
37)         system_failure('Zum Ändern dieses Passworts verwenden Sie bitte die Funktion im Hauptmenü!');
38)     }
39) 
40)     //if (! strong_password($_POST['newpass']))
41)     //  input_error('Das Passwort ist zu einfach');
42)     //else
43)     if ($_POST['newpass1'] == '' ||
44)       $_POST['newpass1'] != $_POST['newpass2']) {
45)         input_error('Bitte zweimal ein neues Passwort eingeben!');
46)         $error = true;
47)     } else {
48)         $user = get_account_details($_REQUEST['uid']);
49)         # set_systemuser_password kommt aus den Session-Funktionen!
50)         set_systemuser_password($user['uid'], $_POST['newpass1']);
51)     }
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 11 months ago

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

Hanno authored 6 years ago

53)         header('Location: account');
54)     }
55) } elseif ($_GET['action'] == 'edit') {
56)     check_form_token('systemuser_edit');
57)     $account = null;
58)     if ($role & ROLE_CUSTOMER) {
59)         $account = get_account_details($_REQUEST['uid']);
60)     } else {
61)         $account = get_account_details($_SESSION['userinfo']['uid'], $_SESSION['userinfo']['customerno']);
62)     }
63) 
64)     if ($role & ROLE_CUSTOMER) {
65)         $customerquota = get_customer_quota();
66)         $maxquota = $customerquota['max'] - $customerquota['assigned'] + $account['quota'];
Hanno remove whitespace in empty...

Hanno authored 6 years ago

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

Hanno authored 6 years ago

68)         $quota = (int) $_POST['quota'];
Bernd Wurst fix zero division error whe...

Bernd Wurst authored 3 weeks ago

69)         if ($quota < 1) {
70)             system_failure("Sie müssen dem Account mindestens 1 MB Speicherplatz zuweisen.");
71)         }
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

72)         if ($quota > $maxquota) {
73)             system_failure("Sie können diesem Account maximal {$maxquota} MB Speicherplatz zuweisen.");
74)         }
75)         $account['quota'] = $quota;
76)     }
77) 
78)     if ($_POST['defaultname'] == 1) {
79)         $account['name'] = null;
80)     } else {
Bernd Wurst Umstellung von filter_input...

Bernd Wurst authored 5 years ago

81)         $account['name'] = filter_input_oneline($_POST['fullname']);
Bernd Wurst Redirect non-customer users...

Bernd Wurst authored 12 years ago

82)     }
Hanno remove whitespace in empty...

Hanno authored 6 years ago

83) 
Bernd Wurst add feature to disable SSH...

Bernd Wurst authored 4 years ago

84)     if (isset($_POST['passwordlogin'])) {
85)         $account['passwordlogin'] = (int) $_POST['passwordlogin'];
86)     }
87) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

88)     $shells = available_shells();
89)     if (isset($shells[$_POST['shell']])) {
90)         $account['shell'] = $_POST['shell'];
91)     } elseif (isset($_POST['shell']) && $_POST['shell'] != '') {
92)         system_failure('Ungültige Shell');
93)     }
94) 
95)     set_account_details($account);
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 11 months ago

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

Hanno authored 6 years ago

97)         $location = 'myaccount';
98)         if ($_SESSION['role'] & ROLE_CUSTOMER) {
99)             $location = 'account';
100)         }
Hanno Böck Spaces between string conca...

Hanno Böck authored 11 months ago

101)         header('Location: ' . $location);
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

102)     }
103) } elseif ($_GET['action'] == 'delete') {
104)     system_failure("Benutzeraccounts zu löschen ist momentan nicht über diese Oberfläche möglich. Bitte wenden Sie sich an einen Administrator.");
105) } else {
106)     system_failure("Unimplemented action");