0648f1d6c2935f43bc6b974fb63dd213e82c9989
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) */
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

13) 
14) include('ftpusers.php');
15) 
16) require_once('inc/base.php');
bernd Nur eingeloggten user sollt...

bernd authored 14 years ago

17) require_role(ROLE_SYSTEMUSER);
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

18) 
Hanno Böck codingstyle, spaces between...

Hanno Böck authored 8 months ago

19) $section = 'ftpusers_accounts';
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

20) 
21) $ftpuser = empty_ftpuser();
22) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

23) if (isset($_GET['id'])) {
24)     $ftpuser = load_ftpuser($_GET['id']);
25) }
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

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

Hanno authored 5 years ago

27) if ($ftpuser['username']) {
28)     title('Ändern des FTP-Benutzers');
29) } else {
30)     title('Neuer FTP-Zugang');
Hanno Böck more HTML fixes

Hanno Böck authored 3 months ago

31)     output('<p style="border: 2px solid red; padding: 1em; padding-left: 4em;"><img src="' . $prefix . 'images/warning.png" style="margin-left: -3em; float: left;" alt="warning"><strong>Bitte beachten Sie:</strong> Ein FTP-Benutzer kann nur im hier angegebenen Verzeichnis (und dallen darin enthaltenen Verzeichnissen) Dateien erstellen oder ändern. Sofern der Benutzer allerdings die Möglichkeit hat, PHP- oder CGI-Programme zu installieren und über den Webserver aufzurufen, kann er damit auch außerhalb dieses Verzeichnisses agieren. Schalten Sie bitte ggf. die PHP- und CGI-Unterstützung für die betreffende Website aus.</p>');
bernd big fat warning zur Sicherh...

bernd authored 14 years ago

32) }
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

33) 
Hanno Böck codingstyle, spaces between...

Hanno Böck authored 8 months ago

34) $username = substr($ftpuser['username'], strlen($_SESSION['userinfo']['username']) + 1);
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

35) 
36) $user_home = $_SESSION['userinfo']['homedir'];
Hanno Böck codingstyle, spaces between...

Hanno Böck authored 8 months ago

37) $homedir = substr($ftpuser['homedir'], strlen($user_home) + 1);
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

38) DEBUG($user_home . ' / ' . $homedir . ' / ' . $ftpuser['homedir']);
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

39) 
bernd Erlaube unverschlüsselte FT...

bernd authored 12 years ago

40) $active = ($ftpuser['active'] == 1 ? 'checked="checked" ' : '');
41) $forcessl = ($ftpuser['forcessl'] == 1 ? 'checked="checked" ' : '');
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

42) 
43) $servers = server_names();
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 2 years ago

44) $available_servers = array_merge([my_server_id()], additional_servers());
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

45) 
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

46) $whichserver = '<strong>' . $servers[my_server_id()] . '</strong>';
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

47) if (count($available_servers) > 1) {
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 2 years ago

48)     $serverselect = [];
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

49)     foreach ($available_servers as $s) {
50)         $serverselect[$s] = $servers[$s];
51)     }
52)     $whichserver = html_select('server', $serverselect, $ftpuser['server']);
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

53) }
Hanno remove whitespace in empty...

Hanno authored 5 years ago

54) 
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

55) 
56) 
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

57) output(html_form('ftpusers_edit', 'save', 'id=' . $ftpuser['id'], '
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

58)   <table style="margin-bottom: 1em;">
59)   <tr>
60)     <td>Benutzername:</td>
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

61)     <td><strong>' . $_SESSION['userinfo']['username'] . '-</strong><input type="text" name="ftpusername" id="ftpusername" value="' . $username . '" /></td>
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

62)   </tr>
63)   <tr>
64)     <td>Verzeichnis:</td>
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

65)     <td><strong>' . $user_home . '/</strong><input type="text" id="homedir" name="homedir" value="' . $homedir . '" /></td>
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

66)   </tr>
67)   <tr>
68)     <td>Passwort:</td>
Hanno Böck autocomplete=new-password f...

Hanno Böck authored 4 months ago

69)     <td><input type="password" id="password" name="password" value="" autocomplete="new-password"></td>
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

70)   </tr>
71)   <tr>
72)     <td>Zugang aktivieren:</td>
Hanno Böck TLS/SSL instead of SSL

Hanno Böck authored 2 months ago

73)     <td><input type="checkbox" id="active" name="active" value="1" ' . $active . '/> auf Server ' . $whichserver . '<br/><input type="checkbox" id="forcessl" name="forcessl" value="1" ' . $forcessl . '/>&#160;<label for="forcessl">SSL/TLS-Verschlüsselung erforderlich<sup>*</sup></label></td>
bernd Verwaltung von FTP-Accounts...

bernd authored 14 years ago

74)   </tr>
75)   </table>
76)   <p><input type="submit" name="save" value="Speichern" /></p>
bernd Erlaube unverschlüsselte FT...

bernd authored 12 years ago

77)   
bernd Typo

bernd authored 12 years ago

78)   <p><sup>*</sup>) Wenn die Verschlüsselung nicht erforderlich ist, können Sie mit diesen Zugangsdaten eine ungesicherte Verbindung auf TCP-Port 1021 aufbauen. Auf dem Standard-Port 21 wird grundsätzlich eine Verschlüsselung benötigt.</p>