function admRename(&$session, $message) { global $rename_oldname, $rename_newname, $rename_backlinks; $session->trace(TC_Gui1, 'admRename'); guiHeader($session, 'Umbenennen einer Seite'); guiHeadline($session, 1, 'Umbenennen einer Seite'); if (!empty($message)) { guiParagraph($session, $message, false); } guiStartForm($session, 'Form', P_Rename); echo '<table border="0">'; echo '<tr><td>Bisheriger Name:</td><td>'; guiTextField('rename_oldname', $rename_oldname, 64, 64); echo '<tr><td>Neuer Name:</td><td>'; guiTextField('rename_newname', $rename_newname, 64, 64); echo '</td></tr>' . "\n"; echo '<tr><td></td><td>'; guiButton('rename_info', 'Info'); if (!empty($rename_oldname) && !empty($rename_newname)) { echo ' | '; } guiButton('rename_rename', 'Umbenennen'); echo '<br>'; guiCheckBox('rename_backlinks', 'Alle Verweise umbenennen', !isset($rename_backlinks) || $rename_backlinks == C_CHECKBOX_TRUE); echo '</td></tr></table>' . "\n"; guiFinishForm($session); if (!empty($rename_oldname) && dbPageId($session, $rename_oldname) > 0) { $row = dbFirstRecord($session, 'select page,text,createdby,createdat from ' . dbTable($session, T_Text) . ' where replacedby is null and text like ' . dbSqlString($session, "%{$rename_oldname}%")); if (!$row) { guiParagraph($session, '+++ keine Verweise gefunden', false); } else { echo '<table border="1"><tr><td>Seite:</td><td>Typ:</td>' . '<td>von</td><td>Letzte Änderung</td><td>Fundstelle</td></tr>'; while ($row) { $pagerecord = dbGetRecordById($session, T_Page, $row[0], 'name,type'); $text = findTextInLine($row[1], $rename_oldname, 10, true); if (!empty($text)) { echo "\n<tr><td>"; guiInternLink($session, encodeWikiName($session, $pagerecord[0]), $pagerecord[0], M_Base); echo '</td><td>'; echo $pagerecord[1]; echo '</td><td>'; echo $row[2]; echo '</td><td>'; echo htmlentities($row[3]); echo '</td><td>'; echo $text; echo "</td><tr>\n"; } $row = dbNextRecord($session); } echo "\n</table>\n"; } } guiFinishBody($session, null); }
function instFinish(&$session, $message = null) { $session->trace(TC_Init, 'instFinish'); guiHeader($session, 'Schritt 3'); guiHeadline($session, 2, 'Installation beenden'); guiParagraph($session, empty($message) ? $message : 'Der InfoBasar ist jetzt installiert.', false); guiStartForm($session, 'Form'); echo '<p>Passwort für den Benutzer admin: '; guiTextField('inst_passw', '', 32, 0); echo ' '; guiCheckbox('inst_setpassw', 'Passwort setzen', true); echo '</p><p>'; guiCheckbox('inst_delete', 'Installationsdateien entfernen', true); echo '</p><p>'; guiCheckbox('inst_documentation', 'Dokumentation entfernen', false); echo '</p><p>'; guiCheckbox('inst_optimized', 'Laufzeitoptimierung', true); echo '</p>'; instDocu($session, '<li>Passwort eintragen</li>' . '<li>"Passwort setzen" ist angeklickt</li>' . '<li>"Installationsdateien löschen" ist angeklickt</li>', '<li>"Passwort setzen" ist <b>nicht</b> angeklickt</li>' . '<li>"Installationsdateien löschen" ist angeklickt</li>'); instStandardEnd($session); }
function guiLogin(&$session, $message) { guiStandardHeader($session, "Anmeldung für den InfoBasar", Th_LoginHeader, Th_LoginBodyStart); guiStartForm($session); if (!empty($message)) { $message = preg_replace('/^\\+/', '+++ Fehler: ', $message); guiParagraph($session, $message, false); } outDivision($session); if (!isset($_POST['login_user'])) { $_POST['login_user'] = $session->fUserName; $_POST['login_email'] = ''; } outTableAndRecord(); outTableTextField($session, 'Benutzername:', 'login_user', null, 32, 32); outTableRecordDelim(); outTablePasswordField($session, 'Passwort:', 'login_code', '', 32, 32); outTableRecordDelim(); outTableButton($session, ' ', 'but_login', 'Anmelden'); outTableAndRecordEnd(); guiLine($session, 2); guiParagraph($session, 'Passwort vergessen?', false); outTableAndRecord(); outTableTextField($session, 'EMail-Adresse:', 'login_email', null, 32, 0); outTableRecordDelim(); outTableButton($session, ' ', 'but_forget', 'Passwort ändern'); outTableAndRecordEnd(); echo '(Das neue Passwort wird dann zugeschickt.)'; outNewline(); outStrong('Achtung:'); echo 'Benutzername muss ausgefüllt sein!'; outDivisionEnd($session); guiFinishForm($session, $session); guiStandardBodyEnd($session, Th_LoginBodyEnd); return 1; }
function basePosting(&$session, $message, $mode) { global $forum_id, $thread_id, $reference_id, $posting_id, $posting_subject, $posting_text, $posting_preview, $textarea_width, $textarea_height, $last_pagename; $session->trace(TC_Gui1, 'basePosting: ' . $mode); if (!isset($last_pagename)) { $last_pagename = $session->fPageName; } $headline = $mode == C_New ? empty($reference_id) ? 'Neues Thema' : 'Antworten' : (empty($reference_id) ? 'Thema ändern' : 'Antwort ändern'); guiStandardHeader($session, $headline, Th_AnswerHeader, Th_AnswerBodyStart); if (!empty($reference_id) && ($posting = dbGetRecordById($session, T_Posting, $reference_id, 'author,subject,text,forum'))) { guiHeadline($session, 1, 'Beitrag: ' . $posting[1]); guiParagraph($session, 'Autor: ' . $posting[0], true); wikiToHTML($session, $posting[2]); guiLine(2); if ($mode == C_New) { $pos = strpos($posting[1], 'Re: '); $posting_subject = (is_int($pos) ? '' : 'Re: ') . $posting[1]; } $forum_id = $posting[3]; } else { str_replace($posting_text, "\\'", "'"); } if (isset($posting_preview)) { guiHeadline($session, 1, 'Vorschau'); wikiToHtml($session, $posting_text); guiLine(2); } guiHeadline($session, 1, $headline); if (!empty($message)) { guiParagraph($session, $message, true); } if ($mode == C_Change && !isset($posting_text)) { $posting = dbGetRecordById($session, T_Posting, $posting_id, 'subject,text,forum'); $forum_id = $posting[2]; $posting_text = $posting[1]; $posting_subject = $posting[0]; } getUserParam($session, U_TextAreaWidth, $textarea_width); getUserParam($session, U_TextAreaHeight, $textarea_height); guiStartForm($session, 'thread'); guiHiddenField('std_answer', 'j'); guiHiddenField('last_pagename', $last_pagename); guiHiddenField('forum_id', $forum_id); guiHiddenField('thread_id', $thread_id); guiHiddenField('posting_id', $posting_id); guiHiddenField('reference_id', $reference_id); echo "<table border=\"0\">\n<tr><td>Thema:</td><td>"; guiTextField('posting_subject', $posting_subject, $textarea_width, 64); echo "</td></tr>\n<tr><td>Text</td><td>"; guiTextArea('posting_text', $posting_text, $textarea_width, $textarea_height); echo '</td></tr><tr><td></td><td style="text-align: right;">Eingabefeld: Breite: '; guiTextField('textarea_width', $textarea_width, 3, 3); echo " Höhe: "; guiTextField('textarea_height', $textarea_height, 3, 3); echo "</td></tr>\n<tr><td></td><td>"; guiButton('posting_preview', 'Vorschau'); echo ' | '; if ($mode == C_New) { guiButton('posting_insert', 'Eintragen'); } else { guiButton('posting_change', 'Ändern'); } echo "</td></tr>\n</table>\n"; guiFinishForm($session, $session); guiStandardBodyEnd($session, Th_AnswerBodyEnd); }
function baseLastChanges(&$session) { $headline = 'Übersicht über die letzten Änderungen'; guiStandardHeader($session, $headline, Th_StandardHeader, Th_StandardBodyStart); if (!isset($_POST['last_days']) || $_POST['last_days'] < 1) { $_POST['last_days'] = 7; } guiStartForm($session); outParagraph($session); echo 'Zeitraum: die letzten '; outTextField($session, 'last_days', $_POST['last_days'], 3, 4); echo ' Tage '; outButton($session, 'last_refresh', 'Aktualisieren'); outParagraphEnd($session); outTable(); for ($day = 0; $day <= $_POST['last_days']; $day++) { $date = localtime(time() - $day * 86400); $time_0 = strftime('%Y.%m.%d', time() - $day * 86400); $time_2 = mktime(0, 0, 0, $date[4] + 1, $date[3], $date[5]); $time_1 = dbSqlDateTime($session, $time_2); $condition = 't.createdat>=' . $time_1 . ' and t.createdat<=' . str_replace('00:00:00', '23:59:59', $time_1); $rec = dbFirstRecord($session, 'select t.id,p.name,t.createdby,t.createdat,t.replacedby,p.id from ' . dbTable($session, T_Text) . ' t, ' . dbTable($session, T_Page) . ' p where p.id=t.page and ' . $condition . ' order by createdat desc'); if ($rec) { outTableRecord(); outTableCellStrong($time_0); outTableRecordEnd(); do { $text_id = $rec[0] + 0; $page_id = $rec[5] + 0; $page_name = $rec[1]; $page_link = encodeWikiName($session, $page_name); outTableRecord(); outTableCell(dbSingleValue($session, 'select min(id) from ' . dbTable($session, T_Text) . ' where page=' . $page_id) == $text_id ? 'Neu' : 'Änderung'); outTableInternLink($session, null, $page_link . '?action=' . A_ShowText . '&page_id=' . $page_id . '&text_id=' . $text_id, $text_id); outTableInternLink($session, null, $page_link, $page_name); outTableAuthorLink($session, $rec[2]); outTableCell(dbSqlDateToText($session, $rec[3])); $pred_rec = dbSingleValue($session, 'select max(id) from ' . dbTable($session, T_Text) . ' where page=' . $page_id . ' and createdat<' . dbSqlDateTime($session, $time_2)); if ($pred_rec > 0) { outTableInternLink($session, null, $page_link . '?action=' . A_Diff . '&text_id=' . $text_id . '&text_id2=' . $pred_rec, 'Unterschied zum Vortag (' . $pred_rec . ')'); } outTableRecordEnd(); } while (($rec = dbNextRecord($session)) != null); } } outTableEnd(); guiStandardBodyEnd($session, Th_StandardBodyEnd); }
function addressShowCards(&$session, $message = null) { $session->trace(TC_Gui1, 'addressShowBook:'); guiStandardHeader($session, 'Anzeigen von Adressen', Th_AddressHeader, Th_AddressBodyStart); if ($message != null) { guiParagraph($session, $message, false); } guiStartForm($session); guiHeadline($session, 2, 'Suchkriterien:'); $books = dbColumnList($session, Tab_Book, 'name', '1'); if (!isset($_POST['show_book'])) { $_POST['show_book'] = $books[0]; } echo 'Adressbuch: '; guiComboBox('show_book', $books, null, null); $fields = array('Name', 'Vorname', 'Spitzname', 'EMail', 'PLZ', 'Ort', 'Funktion', 'Notiz'); echo ' Auswahlkriterium: '; guiComboBox('show_choice', $fields, null, null); echo ' Suchmuster: '; outTextField($session, 'show_pattern', null, 16); echo ' '; outButton($session, 'show_search', 'Suchen'); guiHeadline($session, 2, 'Ausgabefelder:'); outCheckBox($session, 'show_withname', 'Name'); echo ' '; outCheckBox($session, 'show_withprivate', 'Privat'); echo ' '; outCheckBox($session, 'show_withoffice', 'Geschäftlich'); echo ' '; outCheckBox($session, 'show_withphone', 'Telefon'); echo ' '; outCheckBox($session, 'show_withemail', 'EMail'); echo ' '; outCheckBox($session, 'show_withaddress', 'Postadresse'); echo ' '; outCheckBox($session, 'show_withfunction', 'Funktion'); echo ' '; outCheckBox($session, 'show_withnote', 'Notiz'); echo ' '; outCheckBox($session, 'show_withdate', 'Datum'); guiFinishForm($session, $session); if (isset($_POST['show_pattern'])) { $pattern = $_POST['show_pattern']; if (empty($pattern)) { $condidtion = '1'; } else { $pattern = '%' . $pattern . '%'; switch ($_POST['show_choice']) { case 'Name': $condition = 'lastname like ' . dbSqlString($session, $pattern); break; case 'Vorname': $condition = 'firstname like ' . dbSqlString($session, $pattern); break; case 'Spitzname': $condition = 'nickname like ' . dbSqlString($session, $pattern); break; case 'EMail': $condition = 'emailprivate like ' . dbSqlString($session, $pattern) . ' or emailprivate2 like ' . dbSqlString($session, $pattern) . ' or emailoffice like ' . dbSqlString($session, $pattern) . ' or emailoffice2 like ' . dbSqlString($session, $pattern); break; case 'PLZ': $condition = 'zip like ' . dbSqlString($session, $pattern); break; case 'Ort': $condition = 'city like ' . dbSqlString($session, $pattern); break; case 'Funktion': $condition = 'function like ' . dbSqlString($session, $pattern); break; case 'Notiz': $condition = 'note like ' . dbSqlString($session, $pattern); break; default: $condition = '1'; break; } $what = 'lastname,firstname,country,zip,city,street,' . 'emailprivate,emailprivate2,phoneprivate,phoneprivate2,mobileprivate,faxprivate,' . 'emailoffice,emailoffice2,phoneoffice,phoneoffice2,mobileoffice,faxoffice,' . 'functions,notes,nickname,id,changedat,createdat'; addressPrintTable($session, "select {$what} from " . dbTable($session, Tab_Card) . " where {$condition}", 30); } } guiStandardBodyEnd($session, Th_AddressBodyEnd); }
function instFinish(&$session, $message = null) { global $inst_populate; $session->trace(TC_Init, 'instFinish'); guiHeader($session, 'Schritt 3'); guiHeadline($session, 2, 'Installation beenden'); guiParagraph($session, empty($message) ? $message : 'Der InfoBasar ist jetzt installiert.', false); guiStartForm($session, 'Form'); guiHiddenField('inst_step', 3); echo 'Passwort für den Benutzer admin: '; guiTextField('inst_passw', '', 32, 0); guiCheckbox('inst_setpassw', 'Passwort setzen', true); echo '<br />'; guiCheckbox('inst_delete', 'Installationsdateien entfernen', true); guiLine($session, 2); guiButton('inst_last', 'zurück'); echo ' | '; guiButton('inst_next', 'weiter'); guiFinishForm($session); guiFinishBody($session); }
function admShowDir(&$session, $path, $headline = null, $pattern = null, $button_text = null, $button_prefix = null, $file_prefix = null, $with_form = true) { $session->trace(TC_Init, 'admShowDir'); $dir = opendir($path); if ($headline != '') { guiHeadline($session, 2, $headline == null ? "Verzeichnis {$path} auf dem Server" : $headline); } if ($button_text != null && $with_form) { guiStartForm($session); } outTableAndRecord(1); outTableCellStrong('Name'); outTableCellStrong('Größe'); outTableCellStrong('Geändert am'); if ($button_text != null) { outTableCellStrong('Aktion'); } outTableRecordEnd(); $no = 0; while ($file = readdir($dir)) { if ($file != '.' && $file != '..' && ($pattern == null || preg_match($pattern, $file))) { $name = $path . $file; outTableRecord(); outTableCell(htmlentities($file)); outTableCell(is_dir($name) ? 'Verzeichnis' : filesize($name), AL_Right); outTableCell(date("Y.m.d H:i:s", filemtime($name))); if ($button_text != null) { $no++; outTableDelim(); outHiddenField($session, $file_prefix . $no, $path . $file); outButton($session, $button_prefix . $no, $button_text); outTableDelimEnd(); } outTableRecordEnd(); } } outTableEnd(); closedir($dir); if ($button_text != null && $with_form) { guiFinishForm($session); } }
function admBackup(&$session, $with_header, $message) { global $backup_table, $backup_compressed, $backup_save; $session->trace(TC_Gui1, 'admBackup'); if ($with_header) { guiHeader($session, 'Datenbank-Backup'); } if (!empty($message)) { guiParagraph($session, $message, false); } guiHeadLine($session, 1, 'Backup'); guiStartForm($session, "backup"); // guiHiddenField ('forum_id', $forum_id); echo "<table border=\"0\">\n<tr>"; echo "<td>Tabelle:</td><td>"; guiTextField('backup_table', $backup_table, 64, 64); echo "</td></tr>\n<tr><td></td></td>"; guiCheckBox('backup_compressed', 'komprimiert', $backup_compressed); echo "</td></tr>\n<tr><td>"; guiButton('backup_save', 'Sichern'); echo "</td></tr>"; echo "\n</table>\n"; guiFinishForm($session); guiFinishBody($session, null); }
function baseLastChanges(&$session) { global $last_days; $headline = 'Übersicht über die letzten Änderungen'; guiStandardHeader($session, $headline, Th_StandardHeader, Th_StandardBodyStart); if (!isset($last_days) || $last_days < 1) { $last_days = 7; } guiStartForm($session); echo '<p>Zeitraum: die letzten '; guiTextField('last_days', $last_days, 3, 4); echo ' Tage '; guiButton('last_refresh', 'Aktualisieren'); echo '</p>' . "\n"; echo '<table border="0">' . "\n"; for ($day = 0; $day <= $last_days; $day++) { $date = localtime(time() - $day * 86400); $time_0 = strftime('%Y.%m.%d', time() - $day * 86400); $time_2 = mktime(0, 0, 0, $date[4] + 1, $date[3], $date[5]); $time_1 = dbSqlDateTime($session, $time_2); $condition = 't.createdat>=' . $time_1 . ' and t.createdat<=' . str_replace('00:00:00', '23:59:59', $time_1); $rec = dbFirstRecord($session, 'select t.id,p.name,t.createdby,t.createdat,t.replacedby,p.id from ' . dbTable($session, T_Text) . ' t, ' . dbTable($session, T_Page) . ' p where p.id=t.page and ' . $condition . ' order by createdat desc'); if ($rec) { echo '<tr><td><b>'; echo $time_0; echo '</b></td></tr>' . "\n"; do { echo '<tr><td>'; echo dbSingleValue($session, 'select min(id) from ' . dbTable($session, T_Text) . ' where page=' . $rec[5]) == $rec[0] ? 'Neu' : 'Änderung'; echo '</td><td>'; echo $rec[0]; echo '</td><td>'; echo guiInternLink($session, $rec[1], $rec[1]); echo '</td><td>'; guiAuthorLink($session, $rec[2]); echo '</td><td>'; echo dbSqlDateToText($session, $rec[3]); $pred_rec = dbSingleValue($session, 'select max(id) from ' . dbTable($session, T_Text) . ' where page=' . $rec[5] . ' and createdat<' . dbSqlDateTime($session, $time_2)); if ($pred_rec > 0) { echo '</td><td>'; guiInternLink($session, $rec[5] . '?action=' . A_Diff . '&text_id=' . $rec[0] . '&text_id2=' . $pred_rec, 'Unterschied zum Vortag (' . $pred_rec . ')'); } echo '</td></tr>' . "\n"; } while (($rec = dbNextRecord($session)) != null); } /* if (false){ $ids = dbIdList2 ($session, T_Text, 'distinct page', $condition); if ($ids) { echo '<tr><td><b>'; echo $time_0; echo'</b></td></tr>' . "\n"; foreach ($ids as $ii => $pageid) { $page = dbGetRecordById ($session, T_Page, $pageid, 'name'); $text = dbFirstRecord ($session, 'select id,createdby,createdat,replacedby from ' . dbTable ($session, T_Text) . ' where page=' . (0 + $pageid) . ' and ' . $condition . ' order by id desc'); $count = 0; while ($text) { $pred_text = dbSingleValue ($session, 'select max(id) from ' . dbTable ($session, T_Text) . ' where page=' . $pageid . ' and createdat<' . dbSqlDateTime ($session, $time_2)); echo '<tr><td>'; echo dbSingleValue ($session, 'select min(id) from ' . dbTable ($session, T_Text) . ' where page=' . $pageid) == $text [0] ? 'Neu' : 'Änderung'; echo '</td><td>'; echo $text [0]; echo '</td><td>'; echo $count++ > 0 ? htmlentities ($page [0]) : guiInternLink ($session, $page [0], $page [0]); echo '</td><td>'; guiAuthorLink ($session, $text [1]); echo '</td><td>'; echo dbSqlDateToText ($session, $text [2]); if ($pred_text > 0) { echo '</td><td>'; guiInternLink ($session, $page [0] . '?action=' . A_Diff . '&text_id=' . $pred_text . '&text_id2=' . $text [0], 'Unterschied zum Vortag (' . $pred_text . ')'); } echo '</td></tr>' . "\n"; $text = dbNextRecord ($session); } } } } */ } echo '</table>'; guiStandardBodyEnd($session, Th_StandardBodyEnd); }