Last modified: 2005-11-05 08:45:30 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..)
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.)
(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;