Rev 4 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4 | Rev 8 | ||
---|---|---|---|
1 | <?php |
1 | <?php |
2 | 2 | ||
3 | if (!defined('IBLEGAL')) die('Kann nicht ohne Personal WebBase ausgeführt werden.'); |
3 | if (!defined('IBLEGAL')) die('Kann nicht ohne Personal WebBase ausgeführt werden.'); |
4 | 4 | ||
5 | if (($aktion == 'new') || ($aktion == 'edit')) |
5 | if (($aktion == 'new') || ($aktion == 'edit')) |
6 | { |
6 | { |
7 | echo str_replace('<body', '<body onload="self.focus();document.getElementById(\'name\').focus();"', $header); |
7 | echo str_replace('<body', '<body onload="self.focus();document.getElementById(\'name\').focus();"', $header); |
8 | 8 | ||
9 | if ($aktion == 'new') echo '<h1>Neue HTML-Seite</h1>'; |
9 | if ($aktion == 'new') echo '<h1>Neue HTML-Seite</h1>'; |
10 | if ($aktion == 'edit') echo '<h1>HTML-Seite bearbeiten</h1>'; |
10 | if ($aktion == 'edit') echo '<h1>HTML-Seite bearbeiten</h1>'; |
11 | 11 | ||
12 | if ($aktion == 'edit') |
12 | if ($aktion == 'edit') |
13 | { |
13 | { |
14 | $res = db_query("SELECT * FROM `".$mysql_zugangsdaten['praefix']."html` WHERE `id` = '".db_escape($id)."' AND `user` = '".$benutzer['id']."'"); |
14 | $res = db_query("SELECT * FROM `".$mysql_zugangsdaten['praefix']."html` WHERE `id` = '".db_escape($id)."' AND `user` = '".$benutzer['id']."'"); |
15 | if (db_num($res) == 0) |
15 | if (db_num($res) == 0) |
16 | die($header.'Auf diesen Datensatz kann nicht zugegriffen werden. Entweder ist er nicht mehr verfügbar, oder die Zugriffsberechtigungen sind falsch.'.$footer); |
16 | die($header.'Auf diesen Datensatz kann nicht zugegriffen werden. Entweder ist er nicht mehr verfügbar, oder die Zugriffsberechtigungen sind falsch.'.$footer); |
17 | $row = db_fetch($res); |
17 | $row = db_fetch($res); |
18 | 18 | ||
19 | $auszuwaehlen = (isset($row['folder'])) ? $row['folder'] : ''; |
19 | $auszuwaehlen = (isset($row['folder'])) ? $row['folder'] : ''; |
20 | $name = (isset($row['name'])) ? $row['name'] : ''; |
20 | $name = (isset($row['name'])) ? $row['name'] : ''; |
21 | $hcode = (isset($row['hcode'])) ? $row['hcode'] : ''; |
21 | $hcode = (isset($row['hcode'])) ? $row['hcode'] : ''; |
22 | } |
22 | } |
23 | else |
23 | else |
24 | { |
24 | { |
25 | $auszuwaehlen = (isset($folder)) ? $folder : 0; |
25 | $auszuwaehlen = (isset($folder)) ? $folder : 0; |
26 | $name = ''; |
26 | $name = ''; |
27 | $hcode = ''; |
27 | $hcode = ''; |
28 | } |
28 | } |
29 | 29 | ||
30 | if (isset($vorlage) && ($vorlage != '')) |
30 | if (isset($vorlage) && ($vorlage != '')) |
31 | { |
31 | { |
32 | // Achtung! Ein Hacker könnte durch ../ die MySQL-Zugangsdaten statt einer Vorlage auslesen! |
- | |
33 | if (strpos($vorlage, '..')) |
- | |
34 | die($header.'<b>Fehler</b><br><br>Es ist eine Schutzverletzung aufgetreten!'.$footer); |
- | |
35 | - | ||
36 | $hcode = ''; |
32 | $hcode = ''; |
37 | 33 | ||
38 | $handle = @fopen('modules/'.$modul.'/vorlagen/'.$vorlage, 'r'); |
34 | $handle = @fopen('modules/'.wb_dir_escape($modul).'/vorlagen/'.wb_dir_escape($vorlage), 'r'); |
39 | if ($handle) |
35 | if ($handle) |
40 | { |
36 | { |
41 | while (!@feof($handle)) |
37 | while (!@feof($handle)) |
42 | $hcode .= @fgets($handle, 4096); |
38 | $hcode .= @fgets($handle, 4096); |
43 | } |
39 | } |
44 | @fclose($handle); |
40 | @fclose($handle); |
45 | } |
41 | } |
46 | 42 | ||
47 | echo '<script language="JavaScript" type="text/javascript"> |
43 | echo '<script language="JavaScript" type="text/javascript"> |
48 | <!-- |
44 | <!-- |
49 | 45 | ||
50 | function subm_form(act) |
46 | function subm_form(act) |
51 | { |
47 | { |
52 | if (act == 0) |
48 | if (act == 0) |
53 | { |
49 | { |
54 | document.forms["mainform"].target = \'\'; |
50 | document.forms["mainform"].target = \'\'; |
55 | document.forms["mainform"].elements["seite"].value = \'kraftsetzung\'; |
51 | document.forms["mainform"].elements["seite"].value = \'kraftsetzung\'; |
56 | } |
52 | } |
57 | if (act == 1) |
53 | if (act == 1) |
58 | { |
54 | { |
59 | document.forms["mainform"].target = \'_blank\'; |
55 | document.forms["mainform"].target = \'_blank\'; |
60 | document.forms["mainform"].elements["seite"].value = \'checksite\'; |
56 | document.forms["mainform"].elements["seite"].value = \'checksite\'; |
61 | } |
57 | } |
62 | document.forms.mainform.submit(); |
58 | document.forms.mainform.submit(); |
63 | } |
59 | } |
64 | 60 | ||
65 | // --> |
61 | // --> |
66 | </script> |
62 | </script> |
67 | 63 | ||
68 | <form method="POST" name="mainform" action="'.$_SERVER['PHP_SELF'].'"> |
64 | <form method="POST" name="mainform" action="'.$_SERVER['PHP_SELF'].'"> |
69 | <input type="hidden" name="seite" value="kraftsetzung"> |
65 | <input type="hidden" name="seite" value="kraftsetzung"> |
70 | <input type="hidden" name="aktion" value="'.$aktion.'"> |
66 | <input type="hidden" name="aktion" value="'.$aktion.'"> |
71 | <input type="hidden" name="modul" value="'.$modul.'">'; |
67 | <input type="hidden" name="modul" value="'.$modul.'">'; |
72 | 68 | ||
73 | if ($aktion == 'edit') |
69 | if ($aktion == 'edit') |
74 | echo '<input type="hidden" name="id" value="'.$id.'">'; |
70 | echo '<input type="hidden" name="id" value="'.$id.'">'; |
75 | 71 | ||
76 | echo '<table cellspacing="0" cellpadding="0" border="0"> |
72 | echo '<table cellspacing="0" cellpadding="0" border="0"> |
77 | <tr> |
73 | <tr> |
78 | <td colspan="2"><b>Allgemeine Informationen</b><br><br></td> |
74 | <td colspan="2"><b>Allgemeine Informationen</b><br><br></td> |
79 | </tr> |
75 | </tr> |
80 | <tr> |
76 | <tr> |
81 | <td valign="top">Name:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
77 | <td valign="top">Name:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
82 | <td valign="top"><input type="text" class="normal" onmouseover="this.className=\'highlight\';" onmouseout="this.className=\'normal\';" name="name" id="name" value="'.$name.'" size="50"></td> |
78 | <td valign="top"><input type="text" class="normal" onmouseover="this.className=\'highlight\';" onmouseout="this.className=\'normal\';" name="name" id="name" value="'.$name.'" size="50"></td> |
83 | </tr> |
79 | </tr> |
84 | <tr> |
80 | <tr> |
85 | <td valign="top">In Ordner:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
81 | <td valign="top">In Ordner:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
86 | <td valign="top">'; |
82 | <td valign="top">'; |
87 | 83 | ||
88 | gfx_zeichneordnerbox($modul, 'ORDER BY id', 0, 0, $auszuwaehlen); |
84 | gfx_zeichneordnerbox($modul, 'ORDER BY id', 0, 0, $auszuwaehlen); |
89 | 85 | ||
90 | echo '</td> |
86 | echo '</td> |
91 | </tr> |
87 | </tr> |
92 | <tr> |
88 | <tr> |
93 | <td colspan="2"><br><b>HTML-Daten</b><br><br></td> |
89 | <td colspan="2"><br><b>HTML-Daten</b><br><br></td> |
94 | </tr> |
90 | </tr> |
95 | <tr> |
91 | <tr> |
96 | <td valign="top">HTML-Code:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
92 | <td valign="top">HTML-Code:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
97 | <td valign="top" width="100%"> |
93 | <td valign="top" width="100%"> |
98 | <table width="100%"><tr><td rowspan="8" style="vertical-align:top;width:100%">Verwenden Sie eine vordefinierte HTML-Seite wenn Sie z.B. ein automatisches Login-Formular erstellen, jedoch kein Personal WebBase-Modul schreiben möchten.<br><br> |
94 | <table width="100%"><tr><td rowspan="8" style="vertical-align:top;width:100%">Verwenden Sie eine vordefinierte HTML-Seite wenn Sie z.B. ein automatisches Login-Formular erstellen, jedoch kein Personal WebBase-Modul schreiben möchten.<br><br> |
99 | <textarea style="width:100%; overflow:auto;" wrap="virtual" name="hcode" rows="15" cols="50">'.$hcode.'</textarea><br><br> |
95 | <textarea style="width:100%; overflow:auto;" wrap="virtual" name="hcode" rows="15" cols="50">'.$hcode.'</textarea><br><br> |
100 | Eine Vorlage kann Ihnen die Arbeit erleichtern. Wählen Sie eine Vorlage, wenn Sie dies wünschen. |
96 | Eine Vorlage kann Ihnen die Arbeit erleichtern. Wählen Sie eine Vorlage, wenn Sie dies wünschen. |
101 | <ul>'; |
97 | <ul>'; |
102 | 98 | ||
103 | function liste_vorlagen() |
99 | function liste_vorlagen() |
104 | { |
100 | { |
105 | global $modul; |
101 | global $modul; |
106 | $ary = array(); |
102 | $ary = array(); |
107 | $i = 0; |
103 | $i = 0; |
108 | $v = 'modules/'.$modul.'/vorlagen/'; |
104 | $v = 'modules/'.wb_dir_escape($modul).'/vorlagen/'; |
109 | $verz=opendir($v); |
105 | $verz=opendir($v); |
110 | 106 | ||
111 | while ($file = readdir($verz)) |
107 | while ($file = readdir($verz)) |
112 | { |
108 | { |
113 | if (($file != '.') && ($file != '..') && ($file != 'index.html') && (is_file($v.$file))) |
109 | if (($file != '.') && ($file != '..') && ($file != 'index.html') && (is_file($v.$file))) |
114 | { |
110 | { |
115 | $i++; |
111 | $i++; |
116 | $ary[$i] = $file; |
112 | $ary[$i] = $file; |
117 | } |
113 | } |
118 | } |
114 | } |
119 | 115 | ||
120 | closedir($verz); |
116 | closedir($verz); |
121 | sort($ary); |
117 | sort($ary); |
122 | 118 | ||
123 | return $ary; |
119 | return $ary; |
124 | } |
120 | } |
125 | 121 | ||
126 | $vorlagen = liste_vorlagen(); |
122 | $vorlagen = liste_vorlagen(); |
127 | 123 | ||
128 | foreach ($vorlagen AS $m1 => $m2) |
124 | foreach ($vorlagen AS $m1 => $m2) |
129 | { |
125 | { |
130 | if (!isset($id)) $id = 0; |
126 | if (!isset($id)) $id = 0; |
131 | echo '<li><a href="'.$_SERVER['PHP_SELF'].'?seite='.$seite.'&modul='.$modul.'&aktion='.$aktion.'&id='.$id.'&vorlage='.$m2.'">'.$m2.'</a></li>'; |
127 | echo '<li><a href="'.$_SERVER['PHP_SELF'].'?seite='.urlencode($seite).'&modul='.urlencode($modul).'&aktion='.urlencode($aktion).'&id='.urlencode($id).'&vorlage='.urlencode($m2).'">'.$m2.'</a></li>'; |
132 | } |
128 | } |
133 | 129 | ||
134 | unset($m1); |
130 | unset($m1); |
135 | unset($m2); |
131 | unset($m2); |
136 | 132 | ||
137 | if (!isset($danach)) $danach = 'A'; |
133 | if (!isset($danach)) $danach = 'A'; |
138 | 134 | ||
139 | echo '</ul>Bitte beachten Sie, dass beim Öffnen einer Vorlage die aktuellen Änderungen überschrieben werden.<br><br> |
135 | echo '</ul>Bitte beachten Sie, dass beim Öffnen einer Vorlage die aktuellen Änderungen überschrieben werden.<br><br> |
140 | <a href="javascript:subm_form(1);">Seite testen</a></td></tr></table> |
136 | <a href="javascript:subm_form(1);">Seite testen</a></td></tr></table> |
141 | </td> |
137 | </td> |
142 | </tr> |
138 | </tr> |
143 | 139 | ||
144 | <tr> |
140 | <tr> |
145 | <td colspan="2"><br><b>Nach Speicherung</b><br><br></td> |
141 | <td colspan="2"><br><b>Nach Speicherung</b><br><br></td> |
146 | </tr> |
142 | </tr> |
147 | <tr> |
143 | <tr> |
148 | <td valign="top">Aktion: </td> |
144 | <td valign="top">Aktion: </td> |
149 | <td><select name="danach"> |
145 | <td><select name="danach"> |
150 | <option value="A"'; if ($danach == 'A') echo ' selected'; echo '>Zurück zum Hauptmenü</option> |
146 | <option value="A"'; if ($danach == 'A') echo ' selected'; echo '>Zurück zum Hauptmenü</option> |
151 | <option value="B"'; if ($danach == 'B') echo ' selected'; echo '>Neuer Eintrag in Kategorie</option> |
147 | <option value="B"'; if ($danach == 'B') echo ' selected'; echo '>Neuer Eintrag in Kategorie</option> |
152 | <option value="C"'; if ($danach == 'C') echo ' selected'; echo '>Neuer Eintrag im Ordner</option> |
148 | <option value="C"'; if ($danach == 'C') echo ' selected'; echo '>Neuer Eintrag im Ordner</option> |
153 | </select></td> |
149 | </select></td> |
154 | </tr> |
150 | </tr> |
155 | </table><br> |
151 | </table><br> |
156 | <a href="javascript:subm_form(0);">'; |
152 | <a href="javascript:subm_form(0);">'; |
157 | 153 | ||
158 | if ($aktion == 'new') echo 'Eintragung hinzufügen'; |
154 | if ($aktion == 'new') echo 'Eintragung hinzufügen'; |
159 | if ($aktion == 'edit') echo 'Eintragung aktualisieren'; |
155 | if ($aktion == 'edit') echo 'Eintragung aktualisieren'; |
160 | 156 | ||
161 | echo '</a> | <a href="'.$_SERVER['PHP_SELF'].'?seite=inhalt&modul='.$modul.'">Zurück</a> |
157 | echo '</a> | <a href="'.$_SERVER['PHP_SELF'].'?seite=inhalt&modul='.urlencode($modul).'">Zurück</a> |
162 | 158 | ||
163 | </form>'; |
159 | </form>'; |
164 | 160 | ||
165 | echo $footer; |
161 | echo $footer; |
166 | 162 | ||
167 | } |
163 | } |
168 | 164 | ||
169 | ?> |
165 | ?> |
170 | 166 |