"; $html .= gettext ("PhpWiki is unable to save your changes, because another user edited and saved the page while you were editing the page too. If saving proceeded now changes from the previous author would be lost."); $html .= "

\n

"; $html .= gettext ("In order to recover from this situation follow these steps:"); $html .= "\n

  1. "; $html .= gettext ("Use your browser's Back button to go back to the edit page."); $html .= "\n
  2. "; $html .= gettext ("Copy your changes to the clipboard or to another temporary place (e.g. text editor)."); $html .= "\n
  3. "; $html .= gettext ("Reload the page. You should now see the most current version of the page. Your changes are no longer there."); $html .= "\n
  4. "; $html .= gettext ("Make changes to the file again. Paste your additions from the clipboard (or text editor)."); $html .= "\n
  5. "; $html .= gettext ("Press Save again."); $html .= "
\n

"; $html .= gettext ("Sorry for the inconvenience."); $html .= "

"; echo GeneratePage('MESSAGE', $html, sprintf (gettext ("Problem while updating %s"), $pagename), 0); ExitWiki(); } $pagehash = RetrievePage($dbi, $pagename, $WikiPageStore); // if this page doesn't exist yet, now's the time! if (! is_array($pagehash)) { $pagehash = array(); $pagehash['version'] = 0; $pagehash['created'] = time(); $pagehash['flags'] = 0; $newpage = 1; } else { if (($pagehash['flags'] & FLAG_PAGE_LOCKED) && ! $user->is_admin()) { $html = "

" . gettext ("This page has been locked by the administrator and cannot be edited."); $html .= "\n

" . gettext ("Sorry for the inconvenience."); echo GeneratePage('MESSAGE', $html, sprintf (gettext ("Problem while editing %s"), $pagename), 0); ExitWiki (""); } if(isset($editversion) && ($editversion != $pagehash['version'])) { ConcurrentUpdates($pagename); } if ($user->id() != $pagehash['author'] && ! $user->is_admin()) unset($minor_edit); // Force archive if (empty($minor_edit)) SaveCopyToArchive($dbi, $pagename, $pagehash); $newpage = 0; } // set new pageinfo $pagehash['lastmodified'] = time(); $pagehash['version']++; $pagehash['author'] = $user->id(); // create page header $html = sprintf(gettext("Thank you for editing %s."), LinkExistingWikiWord($pagename)); $html .= "
\n"; if (! empty($content)) { // patch from Grant Morgan for magic_quotes_gpc fix_magic_quotes_gpc($content); $pagehash['content'] = preg_split('/[ \t\r]*\n/', chop($content)); // convert spaces to tabs at user request if (isset($convert)) { $pagehash['content'] = CookSpaces($pagehash['content']); } } InsertPage($dbi, $pagename, $pagehash); UpdateRecentChanges($dbi, $pagename, $newpage); $html .= gettext ("Your careful attention to detail is much appreciated."); $html .= "\n"; // fixme: no test for flat file db system if (!empty($DBWarning)) { $html .= "

Warning: $DBWarning" . "Please read the INSTALL file and move " . "the DB file to a permanent location or risk losing " . "all the pages!\n"; } if (!empty($SignatureImg)) $html .= sprintf("

\n", DataURL($SignatureImg)); $html .= "
\n"; include('lib/transform.php'); echo GeneratePage('BROWSE', $html, $pagename, $pagehash); ?>