Page MenuHomePhabricator

isAllowed('asksql') doesn't work
Closed, InvalidPublic

Description

Author: michael

Description:
Hi all,

if( !$wgUser->isAllowed('asksql') ) {
$wgOut->sysopRequired();
return;
}

doesn't work. In the file Defines.php is the array with the rights:

$wgAvailableRights = array('read', 'edit', 'move', 'delete', 'undelete',
'protect', 'block', 'userrights', 'createaccount', 'upload',
'rollback', 'patrol', 'editinterface', 'siteadmin', 'bot', 'validate',
'import', 'importupload', 'renameuser' );

As 'asksql' is missed, even sysops can't execute the asksql. Unfortunately i am
not sure how

function isAllowed($action='') {
$this->loadFromDatabase();
return in_array( $action , $this->mRights );
}

works. (Otherwise i would submit a patch..)


Version: unspecified
Severity: normal

Details

Reference
bz3111

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:46 PM
bzimport set Reference to bz3111.
bzimport added a subscriber: Unknown Object (MLST).

Try $wgAvailableRights[] = 'asksql' in the extension setup function. You may
also want to add a group with that right.

What doesn't work about it?

(Note that there is no Special:Asksql, it was removed long ago.)

michael wrote:

(In reply to comment #2)

What doesn't work about it?

(Note that there is no Special:Asksql, it was removed long ago.)

I have copyed the extension into my extenstions directory. I set the wgAllowSql
(or so) true and set the user/pass for sql-querys. I get an error, i need to be
sysop even when I am. When i comment out line 67:

if( !$wgUser->isAllowed('asksql') ) {
$wgOut->sysopRequired();
..

it works without any problems.

askSQL is very usefull, when you have a non utf-8 shell and need sql-queries for
the wikipedia. I thought it would only be a small fix for my problem :-|

Did you set up a user group with that permission? Something like:

$wgGroupPermissions['sysop']['asksql'] = true;