354c05a4ddd678c49bcbba458bffa7d13482139a
bernd Systemuser-Modul hinzugefügt

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 Systemuser-Modul hinzugefügt

bernd authored 16 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 16 years ago

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

Hanno authored 5 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 6 months ago

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

Hanno authored 5 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 6 months ago

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

Hanno authored 5 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 5 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 4 years ago

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

Bernd Wurst authored 11 years ago

79)     }
Hanno remove whitespace in empty...

Hanno authored 5 years ago

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

Bernd Wurst authored 3 years ago

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

Hanno authored 5 years ago

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

Hanno Böck authored 6 months ago

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

Hanno authored 5 years ago

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

Hanno Böck authored 6 months ago

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

Hanno authored 5 years ago

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