Rev 3 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | daniel-mar | 1 | <?php |
2 | |||
3 | daniel-mar | 3 | if (!defined('IBLEGAL')) die('Kann nicht ohne Personal WebBase ausgeführt werden.'); |
2 | daniel-mar | 4 | |
5 | // Funktioniert FTP-Zugang? |
||
6 | |||
3 | daniel-mar | 7 | if ($konfiguration['core_directftp']['ftp-server'] == '') { |
8 | $fehler = 'Personal WebBase benötigt FTP-Zugriff auf das Verzeichnis "design", damit Designs ordnungsgemäß (de)installiert werden können.<br>Bitte bearbeiten Sie die <a href="'.$_SERVER['PHP_SELF'].'?modul=core_directftp&seite=konfig&vonmodul='.$modul.'">Konfigurationswerte</a> und tragen Sie dort korrekte Werte ein.<br><br>Mögliche Ursache: Server/Benutzername/Passwort falsch.'; |
||
9 | $verhindere_loeschen = 1; |
||
10 | $conn_id = null; |
||
11 | $login_result = false; |
||
12 | } else { |
||
13 | $conn_id = @ftp_connect($konfiguration['core_directftp']['ftp-server'], $konfiguration['core_directftp']['ftp-port']); |
||
14 | $login_result = @ftp_login ($conn_id, $konfiguration['core_directftp']['ftp-username'], $konfiguration['core_directftp']['ftp-passwort']); |
||
15 | } |
||
2 | daniel-mar | 16 | |
17 | $fehler = ''; |
||
18 | |||
19 | if ((!$conn_id) || (!$login_result)) |
||
20 | { |
||
3 | daniel-mar | 21 | $fehler = 'Personal WebBase benötigt FTP-Zugriff auf das Verzeichnis "design", damit Designs ordnungsgemäß (de)installiert werden können.<br>Bitte bearbeiten Sie die <a href="'.$_SERVER['PHP_SELF'].'?modul=core_directftp&seite=konfig&vonmodul='.$modul.'">Konfigurationswerte</a> und tragen Sie dort korrekte Werte ein.<br><br>Mögliche Ursache: Server/Benutzername/Passwort falsch.'; |
2 | daniel-mar | 22 | $verhindere_loeschen = 1; |
23 | } |
||
24 | |||
25 | if (($fehler == '') && ((substr($konfiguration['core_directftp']['ftp-verzeichnis'], 0, 1) != '/') || (substr($konfiguration['core_directftp']['ftp-verzeichnis'], strlen($konfiguration['core_directftp']['ftp-verzeichnis'])-1, 1) != '/'))) |
||
26 | { |
||
3 | daniel-mar | 27 | $fehler = 'Die Verzeichnissyntax ist falsch. Bitte bearbeiten Sie die <a href="'.$_SERVER['PHP_SELF'].'?modul=core_directftp&seite=konfig&vonmodul='.$modul.'">Konfigurationswerte</a> und tragen Sie dort korrekte Werte ein.<br><br>Mögliche Ursache: Verzeichnis zeigt nicht auf Personal WebBase-Verzeichnis oder Datei "moddir.txt" ist nicht mehr vorhanden.'; |
2 | daniel-mar | 28 | $verhindere_loeschen = 1; |
29 | } |
||
30 | |||
31 | if (($fehler == '') && ((@ftp_size($conn_id, $konfiguration['core_directftp']['ftp-verzeichnis'].'design/'.'desdir.txt') == -1) || (@ftp_size($conn_id, $konfiguration['core_directftp']['ftp-verzeichnis'].'modules/'.'moddir.txt') == -1))) |
||
32 | { |
||
3 | daniel-mar | 33 | $fehler = 'Personal WebBase benötigt FTP-Zugriff auf die Verzeichnisse "design" und "modules", damit Designs ordnungsgemäß (de)installiert werden können.<br>Bitte bearbeiten Sie die <a href="'.$_SERVER['PHP_SELF'].'?modul=core_directftp&seite=konfig&vonmodul='.$modul.'">Konfigurationswerte</a> und tragen Sie dort korrekte Werte ein.<br><br>Mögliche Ursache: Verzeichnis zeigt nicht auf das Personal WebBase-Verzeichnis oder Datei "desdir.txt" bzw. "moddir.txt" ist nicht mehr vorhanden.'; |
2 | daniel-mar | 34 | $verhindere_loeschen = 1; |
35 | } |
||
36 | |||
3 | daniel-mar | 37 | if ($conn_id) @ftp_quit($conn_id); |
2 | daniel-mar | 38 | |
39 | echo $header; |
||
40 | |||
41 | if ($modulueberschrift == '') $modulueberschrift = $modul; |
||
3 | daniel-mar | 42 | echo '<h1>'.my_htmlentities($modulueberschrift).'</h1>'; |
43 | echo 'Hier können Sie die Designs von Personal WebBase verwalten.<br><br>'; |
||
2 | daniel-mar | 44 | |
45 | gfx_begintable(); |
||
46 | gfx_tablecontent('', '<b>Verzeichnisname</b>', '', '<b>Designname</b>', '', '<b>Autor</b>', '', '<b>Version</b>', '', '<b>Lizenztyp</b>', '', '<b>Aktionen</b>'); |
||
47 | |||
48 | $handle = @opendir('design/'); |
||
49 | while ($file = @readdir($handle)) |
||
50 | { |
||
51 | if ((filetype('design/'.$file) == 'dir') && ($file <> '.') && ($file <> '..')) |
||
52 | { |
||
53 | $name = ''; |
||
54 | $autor = ''; |
||
55 | $version = ''; |
||
56 | $license = ''; |
||
57 | |||
58 | if (file_exists('design/'.$file.'/var.inc.php')) |
||
59 | include 'design/'.$file.'/var.inc.php'; |
||
60 | |||
61 | if ($license == '1') |
||
62 | $license = 'Offizielles Produkt'; |
||
63 | else if ($license == '0') |
||
64 | $license = 'Drittanbieter-Produkt'; |
||
65 | else |
||
66 | $license = 'Unbekannt'; |
||
67 | |||
68 | if (isset($verhindere_loeschen) && ($verhindere_loeschen != '')) |
||
69 | $aktionen = '<font color="#888888">Entfernen</font>'; |
||
70 | else |
||
71 | $aktionen = '<a href="javascript:abfrage(\''.$_SERVER['PHP_SELF'].'?seite=kraftsetzung&modul='.$modul.'&aktion=delete&entfernen='.$file.'\');" class="menu">Entfernen</a>'; |
||
72 | |||
3 | daniel-mar | 73 | gfx_tablecontent('', my_htmlentities($file), '', my_htmlentities($name), '', my_htmlentities($autor), '', $version, '', $license, '', $aktionen); |
2 | daniel-mar | 74 | } |
75 | } |
||
76 | closedir($handle); |
||
77 | |||
78 | gfx_endtable(); |
||
79 | |||
80 | echo '<a href="'.$_SERVER['PHP_SELF'].'?seite=konfig&modul='.$modul.'&vonmodul='.$modul.'&vonseite='.$seite.'">Aktuelles Design ändern</a><br><br>'; |
||
81 | |||
82 | echo '<b>Design installieren</b><br><br>'; |
||
83 | |||
84 | if ($fehler != '') |
||
85 | echo '<font color="#FF0000">'.$fehler.'</font>'; |
||
86 | else |
||
3 | daniel-mar | 87 | echo 'Achtung: Personal WebBase überlässt den Designs die komplette Handlungsfreiheit bezüglich der Datenbank und der PHP-Codeausführung. Ein Design kann bei dem Installationsprozess bösartigen Code ausführen und das System oder den Datenbestand gefährden. Installieren Sie daher nur Designs, bei denen Sie sicherstellen können, dass sie keinen bösartigen Code enthalten. Maximale Dateigröße: '.ini_get('post_max_size').'B<br><br> |
2 | daniel-mar | 88 | |
89 | <form enctype="multipart/form-data" action="'.$_SERVER['PHP_SELF'].'" method="POST"> |
||
90 | <input type="hidden" name="seite" value="kraftsetzung"> |
||
91 | <input type="hidden" name="modul" value="'.$modul.'"> |
||
92 | <input type="hidden" name="aktion" value="install"> |
||
93 | <input type="hidden" name="MAX_FILE_SIZE" value="'.return_bytes(ini_get('post_max_size')).'"> |
||
94 | |||
95 | <input name="dfile" type="file"><br><br> |
||
96 | |||
97 | <input type="submit" class="button" onmouseover="this.className=\'button_act\';" onmouseout="this.className=\'button\';" value="Design installieren"> |
||
3 | daniel-mar | 98 | </form><a href="https://www.personal-webbase.de/designs.html" target="_blank">Weitere Designs im offiziellen Personal WebBase-Portal</a>'; |
2 | daniel-mar | 99 | |
100 | echo $footer; |
||
101 | |||
3 | daniel-mar | 102 | ?> |