92f133ee96716791aa0cad3fd268fafdc9c507dc
bernd Systemuser-Modul hinzugefügt

bernd authored 16 years ago

1) <?php
2) 
3) require_once('session/start.php');
4) 
5) require_once('useraccounts.php');
6) 
7) require_once('inc/security.php');
8) 
9) 
10) require_role(ROLE_CUSTOMER);
11) 
12) require_once("inc/debug.php");
13) global $debugmode;
14) 
15) if ($_GET['action'] == 'new')
16) {
17)   system_failure('not implemented');
18)   /*
bernd Primärer Useraccount kann d...

bernd authored 16 years ago

19)   check_form_token('systemuser_new');
20)   if (filter_input_username($_POST['username']) == '' ||
bernd Systemuser-Modul hinzugefügt

bernd authored 16 years ago

21)       filter_shell($_POST['password']) == '')
22)   {
23)     input_error('Sie müssen alle Felder ausfüllen!');
24)   }
25)   else
26)   {
27)     create_jabber_account($_POST['local'], $_POST['domain'], $_POST['password']);
28)     if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 15 years ago

29)       header('Location: accounts');
bernd Systemuser-Modul hinzugefügt

bernd authored 16 years ago

30)   }
31)   */
32) }
bernd Überarbeitetes Systemuser-M...

bernd authored 14 years ago

33) elseif ($_GET['action'] == 'pwchange')
bernd Systemuser-Modul hinzugefügt

bernd authored 16 years ago

34) {
35)   $error = false;
bernd Überarbeitetes Systemuser-M...

bernd authored 14 years ago

36)   check_form_token('systemuser_pwchange');
37)   if (customer_useraccount($_REQUEST['uid']))
38)     system_failure('Zum Ändern dieses Passworts verwenden Sie bitte die Funktion im Hauptmenü!');
bernd Primärer Useraccount kann d...

bernd authored 16 years ago

39) 
bernd Überarbeitetes Systemuser-M...

bernd authored 14 years ago

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)   {
46)     input_error('Bitte zweimal ein neues Passwort eingeben!');
47)     $error = true;
48)   }
49)   else
bernd Systemuser-Modul hinzugefügt

bernd authored 16 years ago

50)   {
bernd Überarbeitetes Systemuser-M...

bernd authored 14 years ago

51)     $user = get_account_details($_REQUEST['uid']);
52)     # set_systemuser_password kommt aus den Session-Funktionen!
53)     set_systemuser_password($user['uid'], $_POST['newpass1']);
bernd Systemuser-Modul hinzugefügt

bernd authored 16 years ago

54)   }
bernd Überarbeitetes Systemuser-M...

bernd authored 14 years ago

55)   if (! ($debugmode || $error))
56)     header('Location: accounts');
57) }
58) elseif ($_GET['action'] == 'edit')
59) {
60)   check_form_token('systemuser_edit');
61)   $account = get_account_details($_REQUEST['uid']);
62) 
63)   $customerquota = get_customer_quota();
64)   $maxquota = $customerquota['max'] - $customerquota['assigned'] + $account['quota'];
65)  
66)   $quota = (int) $_POST['quota'];
67)   if ($quota > $maxquota) 
68)     system_failure("Sie können diesem Account maximal {$maxquota} MB Speicherplatz zuweisen.");
69)   $account['quota'] = $quota;
70) 
71)   if ($_POST['defaultname'] == 1)
72)     $account['name'] = NULL;
73)   else
74)     $account['name'] = filter_input_general($_POST['fullname']);
75)   
76)   $shells = available_shells();
77)   if (isset($shells[$_POST['shell']]))
78)     $account['shell'] = $_POST['shell'];
bernd Systemuser-Modul hinzugefügt

bernd authored 16 years ago

79) 
bernd Überarbeitetes Systemuser-M...

bernd authored 14 years ago

80)   set_account_details($account);
bernd Systemuser-Modul hinzugefügt

bernd authored 16 years ago

81)   if (! ($debugmode || $error))
bernd eliminate .php extensions f...

bernd authored 15 years ago

82)     header('Location: accounts');
bernd Systemuser-Modul hinzugefügt

bernd authored 16 years ago

83)   
84) }
85) elseif ($_GET['action'] == 'delete')
86) {
87)   system_failure("Benutzeraccounts zu löschen ist momentan nicht über diese Oberfläche möglich. Bitte wenden Sie sich an einen Administrator.");
88)   /*
89)   $account_string = filter_input_general( $account['local'].'@'.$account['domain'] );
90)   $sure = user_is_sure();
91)   if ($sure === NULL)
92)   {
bernd * alle internen Links sinnv...

bernd authored 15 years ago

93)     are_you_sure("action=delete&account={$_GET['account']}", "Möchten Sie den Account »{$account_string}« wirklich löschen?");
bernd Systemuser-Modul hinzugefügt

bernd authored 16 years ago

94)   }
95)   elseif ($sure === true)
96)   {
97)     delete_jabber_account($account['id']);
98)     if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 15 years ago

99)       header("Location: accounts");
bernd Systemuser-Modul hinzugefügt

bernd authored 16 years ago

100)   }
101)   elseif ($sure === false)
102)   {
103)     if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 15 years ago

104)       header("Location: accounts");