logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: restore previous versions: msg#00100

Subject: Re: restore previous versions
Micki Kaufman schrieb:
Message: 8
Date: Mon, 12 Apr 2004 14:03:57 -0500 (CDT)
From: Bob Apthorpe <apthorpe+phpwiki@xxxxxxxxxxxx>

Looks *much* better! Now to figure out authentication and remember what I
did before to import all page versions from a full zip dump (IIRC I hacked
loadpage.php to add an overwrite parameter to destructively overwrite
previous versions when loading from a zip dump. I need to send in some
patches for that.)

Good idea! I'll come up with a destructive version to save a lot of keystrokes.

I don't like the patch below, because of security concerns.
I wouldn't like to have my uploaded files overwritten by someone else.
These files can be silently included into every page as imagebuttons.

And it works only for upload, not for loadfile, which was the requested feature.

Hi Bob - Here's what I use (written by Carsten Klapp):

Add this line to PhpWikiAdministration:

<?plugin WikiForm action=upload buttontext="Upload & OVERWRITE" overwrite=1 ?>

Patch lib/plugin/WikiForm.php with the enclosed patch.

It should go without saying, but here it is anyway: BE CAREFUL you don't do something silly like upload the wrong file! :)

Carsten

Index: WikiForm.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/WikiForm.php,v
retrieving revision 1.9
diff -U2 -r1.9 WikiForm.php
--- WikiForm.php    26 Feb 2003 01:56:52 -0000    1.9
+++ WikiForm.php    7 Dec 2003 17:08:54 -0000
@@ -43,4 +43,5 @@
                      'default' => false,
                      'buttontext' => false,
+                     'overwrite' => false, // HACK ALERT
                      'size' => 50);
     }
@@ -107,4 +108,8 @@

         $input = HTML::input($input);
+        if ($overwrite)
+            $input->pushContent(HTML::input(array('name' => 'overwrite',
+                                                  'value' =>  1,
+ 'type' => 'hidden')));
         $input->addTooltip($buttontext);
         $button = Button('submit:', $buttontext, $class);
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click



Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>