Subversion Repositories personal-webbase

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 daniel-mar 1
<?php
2
 
3
if (!defined('WBLEGAL')) die('Kann nicht ohne Personal WebBase ausgef&uuml;hrt werden.');
4
 
5
// Funktioniert FTP-Zugang?
6
 
7
$conn_id = @ftp_connect($configuration['common_directftp']['ftp-server'], $configuration['common_directftp']['ftp-port']);
8
$login_result = @ftp_login ($conn_id, $configuration['common_directftp']['ftp-username'], $configuration['common_directftp']['ftp-password']);
9
 
10
$fehler = '';
11
 
12
if ((!$conn_id) || (!$login_result))
13
{
14
        $fehler = 'Personal WebBase ben&ouml;tigt FTP-Zugriff auf das Verzeichnis &quot;modules&quot;, damit Module ordnungsgem&auml;&szlig; (de)installiert werden k&ouml;nnen.<br>Bitte bearbeiten Sie die <a href="'.$_SERVER['PHP_SELF'].'?modul=common_directftp&amp;seite=config&amp;vonmodul='.$modul.'">Konfigurationswerte</a> und tragen Sie dort korrekte Werte ein.<br><br>M&ouml;gliche Ursache: Server/Benutzername/Passwort falsch.';
15
        $verhindere_loeschen = 1;
16
}
17
 
18
if (($fehler == '') && ((substr($configuration['common_directftp']['ftp-verzeichnis'], 0, 1) != '/') || (substr($configuration['common_directftp']['ftp-verzeichnis'], strlen($configuration['common_directftp']['ftp-verzeichnis'])-1, 1) != '/')))
19
{
20
        $fehler = 'Die Verzeichnissyntax ist falsch. Bitte bearbeiten Sie die <a href="'.$_SERVER['PHP_SELF'].'?modul=common_directftp&amp;seite=config&amp;vonmodul='.$modul.'">Konfigurationswerte</a> und tragen Sie dort korrekte Werte ein.<br><br>M&ouml;gliche Ursache: Verzeichnis zeigt nicht auf Personal WebBase-Verzeichnis oder Datei &quot;moddir.txt&quot; ist nicht mehr vorhanden.';
21
        $verhindere_loeschen = 1;
22
}
23
 
24
if (($fehler == '') && (@ftp_size($conn_id, $configuration['common_directftp']['ftp-verzeichnis'].'modules/moddir.txt') == -1))
25
{
26
        $fehler = 'Personal WebBase ben&ouml;tigt FTP-Zugriff auf das Verzeichnis &quot;modules&quot;, damit Module ordnungsgem&auml;&szlig; (de)installiert werden k&ouml;nnen.<br>Bitte bearbeiten Sie die <a href="'.$_SERVER['PHP_SELF'].'?modul=common_directftp&amp;seite=config&amp;vonmodul='.$modul.'">Konfigurationswerte</a> und tragen Sie dort korrekte Werte ein.<br><br>M&ouml;gliche Ursache: Verzeichnis zeigt nicht auf Personal WebBase-Verzeichnis oder Datei &quot;moddir.txt&quot; ist nicht mehr vorhanden.';
27
        $verhindere_loeschen = 1;
28
}
29
 
30
@ftp_quit($conn_id);
31
 
32
echo $header;
33
 
34
echo '<h1>'.htmlentities($module_information->caption).'</h1>';
35
 
36
echo 'Hier k&ouml;nnen Sie die Module von Personal WebBase verwalten. Ist ein Modul nicht
37
korrekt geschrieben worden, so k&ouml;nnen trotz Deinstallation des Moduls noch Datenbest&auml;nde in der
38
Datenbank zur&uuml;ckbleiben. Wenn das Modul als &quot;Personal WebBase-Core&quot; eingestuft wurde, dann
39
ist der Autor des Moduls der Meinung, dass es wichtig f&uuml;r die Ausf&uuml;hrung von Personal WebBase oder anderen
40
Modulen verantwortlich ist. Entfernen Sie ein solches Modul, so kann Personal WebBase besch&auml;digt und Kundendaten
41
verloren gehen! In dem Feld &quot;Daten&quot; k&ouml;nnen Sie sehen, wie viele Personal WebBase-Konfigurationswerte (C) und wie viele
42
MySQL-Tabellen (T) das jeweilige Modul benutzt.<br><br>';
43
 
44
wb_draw_table_begin();
45
wb_draw_table_content('', '<b>Verzeichnisname</b>', '', '<b>Modulname</b>', '', '<b>Autor</b>', '', '<b>Lizenztyp</b>', '', '<b>Version</b>', '', '<b>Sprache</b>', '', '<b>Daten</b>', '', '<b>Aktionen</b>');
46
foreach ($modules as $m1 => $m2)
47
{
48
        $res = db_query("SELECT COUNT(*) AS `cid` FROM `".$WBConfig->getMySQLPrefix()."configuration` WHERE `module` = '".db_escape($m2)."'");
49
        $row = db_fetch($res);
50
        $cdaten = $row['cid'];
51
 
52
        $res = db_query("SELECT COUNT(*) AS `cid` FROM `".$WBConfig->getMySQLPrefix()."modules` WHERE `module` = '".db_escape($m2)."'");
53
        $row = db_fetch($res);
54
        $mdaten = $row['cid'];
55
 
56
        $module_information = WBModuleHandler::get_module_information($m2);
57
 
58
        if ($module_information->author == '') $module_information->author = 'Unbekannt';
59
 
60
        if ($module_information->version == '') $module_information->version = 'Unbekannt';
61
 
62
        if ($module_information->license == '0')
63
                $module_information->license = 'Public Freeware';
64
        else if ($module_information->license == '1')
65
                $module_information->license = 'Public Shareware';
66
        else if ($module_information->license == '2')
67
                $module_information->license = 'Private Secured';
68
        else if ($module_information->license == '3')
69
                $module_information->license = 'Personal WebBase-Core';
70
        else if ($module_information->license == '4')
71
                $module_information->license = 'Personal WebBase-Enclosure';
72
        else
73
                $module_information->license = 'Unbekannt';
74
 
75
        $ca = ($cdaten == 0) ? '' : '<a href="'.$_SERVER['PHP_SELF'].'?modul=admin_configuration&amp;seite=config&amp;only='.$m2.'&amp;vonmodul='.$modul.'&amp;vonseite='.$seite.'" class="menu">';
76
        $cb = ($cdaten == 0) ? '' : '</a>';
77
        $ta = ($mdaten == 0) ? '' : '<a href="'.$_SERVER['PHP_SELF'].'?modul=admin_database&amp;seite=main&amp;only='.$m2.'&amp;vonmodul='.$modul.'&amp;vonseite='.$seite.'" class="menu">';
78
        $tb = ($mdaten == 0) ? '' : '</a>';
79
 
80
        if ((isset($verhindere_loeschen)) && ($verhindere_loeschen != ''))
81
                $aktionen = '<span class="grey">Entfernen</span>';
82
        else
83
                $aktionen = '<a href="javascript:abfrage(\''.$_SERVER['PHP_SELF'].'?seite=operate&amp;modul='.$modul.'&amp;aktion=delete&amp;entfernen='.$m2.'\');" class="menu">Entfernen</a>';
84
 
85
        wb_draw_table_content('', htmlentities($m2), '', htmlentities($module_information->caption), '', htmlentities($module_information->author), '', $module_information->license, '', htmlentities($module_information->version), '', htmlentities($module_information->language), '', $ca.$cdaten.'C'.$cb.' / '.$ta.$mdaten.'T'.$tb, '', $aktionen);
86
}
87
 
88
unset($m1);
89
unset($m2);
90
 
91
wb_draw_table_end();
92
echo '<b>Modul installieren</b><br><br>';
93
 
94
if ($fehler != '')
95
        echo '<span class="red">'.$fehler.'</span>';
96
else
97
        echo 'Achtung: Personal WebBase &uuml;berl&auml;sst den Modulen die komplette Handlungsfreiheit bez&uuml;glich der Datenbank und der PHP-Codeausf&uuml;hrung. Ein Modul kann bei dem Installationsprozess b&ouml;sartigen Code ausf&uuml;hren und das System oder den Datenbestand gef&auml;hrden. Installieren Sie daher nur Module, bei denen Sie sicherstellen k&ouml;nnen, dass sie keinen b&ouml;sartigen Code enthalten. Wenn Sie ein Modul updaten m&ouml;chten, deinstallieren Sie die alte Version des Modules zuerst. Maximale Dateigr&ouml;&szlig;e: '.ini_get('post_max_size').'B<br><br>
98
 
99
<form enctype="multipart/form-data" action="'.$_SERVER['PHP_SELF'].'" method="POST">
100
<input type="hidden" name="seite" value="operate">
101
<input type="hidden" name="modul" value="'.$modul.'">
102
<input type="hidden" name="aktion" value="install">
103
<input type="hidden" name="MAX_FILE_SIZE" value="'.return_bytes(ini_get('post_max_size')).'">
104
 
105
<input name="dfile" type="file"><br><br>
106
 
107
<input type="submit" class="button" onmouseover="this.className=\'button_act\';" onmouseout="this.className=\'button\';" value="Modul installieren">
108
</form><a href="'.deferer('http://www.personal-webbase.de/module.html').'" target="_blank">Weitere Module im offiziellen Personal WebBase-Portal</a>';
109
 
110
echo $footer;
111
 
112
?>