Last modified: 2005-11-05 08:45:30 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T5111, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 3111 - isAllowed('asksql') doesn't work
isAllowed('asksql') doesn't work
Status: RESOLVED INVALID
Product: MediaWiki extensions
Classification: Unclassified
AskSQL (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-08-10 21:47 UTC by Michael Diederich
Modified: 2005-11-05 08:45 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Michael Diederich 2005-08-10 21:47:59 UTC
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..)
Comment 1 Tim Starling 2005-08-10 21:51:09 UTC
Try $wgAvailableRights[] = 'asksql' in the extension setup function. You may
also want to add a group with that right.
Comment 2 Brion Vibber 2005-08-11 06:46:14 UTC
What doesn't work about it?

(Note that there is no Special:Asksql, it was removed long ago.)
Comment 3 Michael Diederich 2005-08-11 09:51:25 UTC
(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 :-|
Comment 4 Brion Vibber 2005-08-11 10:03:25 UTC
Did you set up a user group with that permission? Something like:

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links