+ sub DoEditIntermap { + my ($intermapList, $status); + + print &GetHeader("", "Editing IntermapList", ""); + print "\n"; + return if (!&UserIsAdminOrError()); + ($status, $intermapList) = &ReadFile("$DataDir/intermap"); + $intermapList = "" if (!$status); + print &GetFormStart(); + print GetHiddenValue("edit_intermap", 1), "\n"; + print &GetTextArea('intermaplist', $intermapList, 12, 100); + print "<br>", $q->submit(-name=>'Save'), "\n"; + print $q->endform; + print '</div>' . &GetCommonFooter(); + } + + sub DoUpdateIntermap { + my ($newList, $fname); + + print &GetHeader("", "Updating Intermap list", ""); + return if (!&UserIsAdminOrError()); + $fname = "$DataDir/intermap"; + $newList = &GetParam("intermaplist", "#Empty file"); + if ($newList eq "") { + print "<p>Empty intermap list or error."; + print "<p>Resubmit with at least one space character to remove."; + } elsif ($newList =~ /^\s*$/s) { + unlink($fname); + print "<p>Removed intermap list"; + } else { + &WriteStringToFile($fname, $newList); + print "<p>Updated intermap list"; + } + print '</div>' . &GetCommonFooter(); + } Sub GetAdminBar { .... $result .= &ScriptLink("action=editbanned", T("Edit Banned List")); + $result .= ' | ' . &ScriptLink("action=editintermap",T("Intermap")); ... } Sub DoOtherRequest { ... } elsif ($action eq "editbanned") { &DoEditBanned(); + } elsif ($action eq "editintermap") { + &DoEditIntermap(); ... sub DoOtherRequest { ... if (&GetParam("edit_ban", 0)) { &DoUpdateBanned(); return; } + if (&GetParam("edit_intermap", 0)) { + &DoUpdateIntermap(); + return; + }If the script runs as "www-data", then the wikidb, etc. files must also be owned by "www-data", (apache2 runs as user www-data, for instance). See the documentation of your web server for details. (See cuestion: Q: What should the following file permissions be? at UseModWiki/Install)
In fact, all the files out of subdirectories can be accessed from web, in the same manner, taking into account security considerations.
--JuanmaMP