new wfMsg* functions to use the wgContLang object for translating content related...
[lhc/web/wiklou.git] / includes / SpecialAsksql.php
index 150137c..6096623 100644 (file)
@@ -1,10 +1,26 @@
 <?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;
        }
@@ -21,19 +37,23 @@ function wfSpecialAsksql()
        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;
 
@@ -69,8 +89,7 @@ class SqlQueryForm {
 
        }
 
-       function doSubmit()
-       {
+       function doSubmit() {
                global $wgOut, $wgUser, $wgServer, $wgScript, $wgArticlePath, $wgLang;
                global $wgDBserver, $wgDBsqluser, $wgDBsqlpassword, $wgDBname, $wgSqlTimeout;