354c05a4ddd678c49bcbba458bffa7d13482139a
bernd Verwaltung von FTP-Accounts...

bernd authored 14 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) */
13) 
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

14) include('ftpusers.php');
15) 
16) require_role(ROLE_SYSTEMUSER);
17) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

18) if (isset($_GET['regular_ftp'])) {
19)     check_form_token('regular_ftp', $_REQUEST['token']);
20)     if ($_GET['regular_ftp'] == 'yes') {
21)         $sure = user_is_sure();
22)         if ($sure === null) {
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

23)             are_you_sure("regular_ftp=yes&token=" . $_REQUEST['token'], "Benötigen Sie wirklich klassischen FTP-Zugriff für Ihren Benutzeraccount? Lesen Sie die Hinweise in unserem Wiki falls Sie sich nicht sicher sind.");
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

24)             return;
25)         } elseif ($sure === true) {
26)             enable_regular_ftp();
27)         }
28)     } else {
29)         disable_regular_ftp();
Bernd Wurst Sicherheitsabfrage beim Akt...

Bernd Wurst authored 10 years ago

30)     }
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

31)     redirect('accounts');
bernd Security-enhancements und a...

bernd authored 14 years ago

32) }
33) 
34) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

35) if (isset($_GET['delete'])) {
36)     $ftpuser = load_ftpuser($_GET['delete']);
37) 
38)     $sure = user_is_sure();
39)     if ($sure === null) {
40)         are_you_sure("delete={$ftpuser['id']}", "Möchten Sie den FTP-Zugang »{$ftpuser['username']}« wirklich löschen?");
41)         return;
42)     } elseif ($sure === true) {
43)         delete_ftpuser($ftpuser['id']);
44)     }
45)     redirect('accounts');
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

46) }
47) 
48) $ftpuser = empty_ftpuser();
49) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

50) if (isset($_GET['id'])) {
51)     check_form_token('ftpusers_edit');
52)     $ftpuser = load_ftpuser($_GET['id']);
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

53) }
54) 
Hanno remove whitespace in empty...

Hanno authored 5 years ago

55) 
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

56) $ftpuser['username'] = $_REQUEST['ftpusername'];
57) $ftpuser['password'] = $_REQUEST['password'];
58) $ftpuser['homedir'] = $_REQUEST['homedir'];
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

59) if (isset($_REQUEST['active'])) {
60)     $ftpuser['active'] = $_REQUEST['active'];
61) } else {
62)     $ftpuser['active'] = 0;
63) }
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

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

Hanno authored 5 years ago

65) if (isset($_REQUEST['forcessl'])) {
66)     $ftpuser['forcessl'] = $_REQUEST['forcessl'];
67) } else {
68)     $ftpuser['forcessl'] = 0;
69) }
bernd Erlaube unverschlüsselte FT...

bernd authored 12 years ago

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

Hanno authored 5 years ago

71) if (isset($_REQUEST['server'])) {
72)     $ftpuser['server'] = $_REQUEST['server'];
73) }
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

74) 
Hanno remove whitespace in empty...

Hanno authored 5 years ago

75) 
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

76) save_ftpuser($ftpuser);
Hanno remove whitespace in empty...

Hanno authored 5 years ago

77)