Hey, this hack seems to work:

        private function performRequest() {
                global $wgServer, $wgUsePathInfo, $wgTitle;

                wfProfileIn( __METHOD__ );

                $request = $this->context->getRequest();
                $title = $this->context->getTitle();
                $output = $this->context->getOutput();
                $user = $this->context->getUser();

                // My Change
                $myAction = $this->getAction();
                if($myAction == 'edit') {
                        $myUser = $this->context->getUser();
                        $myGroups = $myUser->getGroups();
                        $allowed = false;
                        foreach ($myGroups as $grp) {
                                if($grp == 'sysop' || $grp == 'bureaucrat') {
                                        $allowed = true;
                                        break;
                                }
                        }
                        if(!$allowed) {
                                return;
                        }
                }
                // end my change
                ...

It just silently ignores an edit action w/o an error message, but that's ok for 
my purposes as no one should be manually entering action=edit anyways.  I just 
need to tweek for allowing edits in the Help space or other exceptions.

Al




________________________________
 From: Al Johnson <alj62...@yahoo.com>
To: "mediawiki-l@lists.wikimedia.org" <mediawiki-l@lists.wikimedia.org> 
Sent: Monday, February 25, 2013 2:59 AM
Subject: Disabling action=edit for non-SysOps.  Force using forms instead.
 

Hi,

I know this has been asked many times, but I would like to ask if there is 
aaaaany way at all, including hacks, writing a custom extension, etc..


Why?  Because the data in my special purpose semantic wiki is the basis of 
another app which could suffer a lot if certain people try to "game" my system. 
 And generally, I'm trying to make things as tight as possible while still 
being editable by anons.


Any suggestions, thoughts, or general musings are appreciated.

Thanks!
Al

P.S. For example, I wonder if there is a way to intercept the URL connection 
and simply replace action=edit query parameter with action=formedit for 
non-sysops.
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Reply via email to