96649f21ba18d07757afa9d98998f7a22c0d86a3
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) 
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 5 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) */
16) 
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

17) include('ftpusers.php');
18) 
19) require_role(ROLE_SYSTEMUSER);
20) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

21) if (isset($_GET['regular_ftp'])) {
22)     check_form_token('regular_ftp', $_REQUEST['token']);
23)     if ($_GET['regular_ftp'] == 'yes') {
24)         $sure = user_is_sure();
25)         if ($sure === null) {
26)             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.");
27)             return;
28)         } elseif ($sure === true) {
29)             enable_regular_ftp();
30)         }
31)     } else {
32)         disable_regular_ftp();
Bernd Wurst Sicherheitsabfrage beim Akt...

Bernd Wurst authored 10 years ago

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

Hanno authored 5 years ago

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

bernd authored 14 years ago

35) }
36) 
37) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

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

bernd authored 14 years ago

49) }
50) 
51) $ftpuser = empty_ftpuser();
52) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

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

bernd authored 14 years ago

56) }
57) 
Hanno remove whitespace in empty...

Hanno authored 5 years ago

58) 
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

59) $ftpuser['username'] = $_REQUEST['ftpusername'];
60) $ftpuser['password'] = $_REQUEST['password'];
61) $ftpuser['homedir'] = $_REQUEST['homedir'];
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

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

bernd authored 14 years ago

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

Hanno authored 5 years ago

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

bernd authored 12 years ago

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

Hanno authored 5 years ago

74) if (isset($_REQUEST['server'])) {
75)     $ftpuser['server'] = $_REQUEST['server'];
76) }
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

77) 
Hanno remove whitespace in empty...

Hanno authored 5 years ago

78) 
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

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

Hanno authored 5 years ago

80)