On 10/08/10 15:42, John Beranek wrote:
> So, I've got mwlib.rl and Collection working on our private Wiki.
> 
[snip]
> Has anyone done this before, or do I need to start digging into the
> Collection code?

Well, the attached diff seems to do it - I'm least happy about the
change in addArticle(), because the error page isn't shown, and the user
sees no change when they click 'Add this page to your book'.

Cheers,

John.

-- 
John Beranek                         To generalise is to be an idiot.
http://redux.org.uk/                                 -- William Blake

-- 
You received this message because you are subscribed to the Google Groups 
"mwlib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/mwlib?hl=en.

Index: Collection.body.php
===================================================================
--- Collection.body.php (revision 70819)
+++ Collection.body.php (working copy)
@@ -606,6 +606,11 @@
        }
 
        static function addArticle( $title, $oldid = 0 ) {
+               // Lockdown support
+               if (!$title->userCanRead()) {
+                       $wgOut->showErrorPage( 'coll-couldnotaddarticle_title', 
'coll-couldnotaddarticle-lockdown_msg' );
+                       return false;
+               }
                $article = new Article( $title, $oldid );
                $latest = $article->getLatest();
 
@@ -1191,6 +1196,11 @@
                        $wgOut->showErrorPage( 'coll-notitle_title', 
'coll-notitle_msg' );
                        return;
                }
+               // Lockdown support
+               if (!$title->userCanRead()) {
+                       $wgOut->showErrorPage( 'coll-couldnotaddarticle_title', 
'coll-couldnotaddarticle-lockdown_msg' );
+                       return;
+               }
                $article = array(
                        'type' => 'article',
                        'content_type' => 'text/x-wiki',

Reply via email to