<?php
-
-function wfSpecialAsksql()
-{
- global $wgUser, $wgOut, $wgRequest;
-
- if ( ! $wgUser->isSysop() ) {
+/**
+ * If enabled through $wgAllowSysopQueries = true, this class
+ * let users with sysop right the possibility to make sql queries
+ * against the cur table.
+ * Heavy queries could slow down the database specially for the
+ * biggest wikis.
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
+
+/**
+ *
+ */
+function wfSpecialAsksql() {
+ global $wgUser, $wgOut, $wgRequest, $wgAllowSysopQueries;
+
+ if( !$wgAllowSysopQueries ) {
+ $wgOut->errorpage( "nosuchspecialpage", "nospecialpagetext" );
+ return;
+ }
+ if( !$wgUser->isSysop() ) {
$wgOut->sysopRequired();
return;
}
if ( "submit" == $action ) {
$f->doSubmit();
} else {
- $f->showForm( "" );
+ $f->showForm( '' );
}
}
+/**
+ * @access private
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
class SqlQueryForm {
- var $query = "";
+ var $query = '';
function SqlQueryForm( $query ) {
$this->query = $query;
}
- function showForm( $err )
- {
+ function showForm( $err ) {
global $wgOut, $wgUser, $wgLang;
global $wgLogQueries;
}
- function doSubmit()
- {
+ function doSubmit() {
global $wgOut, $wgUser, $wgServer, $wgScript, $wgArticlePath, $wgLang;
global $wgDBserver, $wgDBsqluser, $wgDBsqlpassword, $wgDBname, $wgSqlTimeout;