r117 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r116‎ | r117 | r118 >
Date:09:56, 11 February 2002
Author:magnus_manske
Status:old
Tags:
Comment:
making asksql function visible for sysops
Modified paths:
  • /trunk/phpwiki/fpw/special_asksql.php (modified) (history)
  • /trunk/phpwiki/fpw/wikiPage.php (modified) (history)
  • /trunk/phpwiki/fpw/wikiTextEn.php (modified) (history)

Diff [purge]

Index: trunk/phpwiki/fpw/special_asksql.php
@@ -1,8 +1,7 @@
22 <?
33 # A little hack for direct MySQL access; for sysops only!
44 function askSQL () {
5 - global $THESCRIPT ;
6 - global $Save , $question ;
 5+ global $THESCRIPT , $wikiAskSQLtext , $Save , $question ;
76 $ret = "" ;
87 if ( isset ( $Save ) ) {
98 $ret .= "$question<br>" ;
@@ -31,9 +30,9 @@
3231 }
3332 $ret .= "</tr></table>" ;
3433 }
35 - $form = "" ;
 34+ $form = $wikiAskSQLtext ;
3635 $form .= "<FORM method=POST>" ;
37 - $form .= "<input type=text value=\"$question\" name=question size=150> \n" ;
 36+ $form .= "<input type=text value=\"$question\" name=question size=110> \n" ;
3837 $form .= "<input type=submit value=Ask name=Save> \n" ;
3938 $form .= "</FORM>" ;
4039 return $form.$ret ;
Index: trunk/phpwiki/fpw/wikiPage.php
@@ -936,7 +936,7 @@
937937 # This generates the QuickBar (also used by the list of special pages function)
938938 function getQuickBar () {
939939 global $wikiMainPage , $wikiRecentChanges , $wikiRecentChangesLink , $wikiUpload , $wikiPopularPages , $wikiLongPages;
940 - global $user , $oldID , $version , $wikiEditThisPage , $wikiDeleteThisPage , $wikiHistory , $wikiMyWatchlist ;
 940+ global $user , $oldID , $version , $wikiEditThisPage , $wikiDeleteThisPage , $wikiHistory , $wikiMyWatchlist , $wikiAskSQL ;
941941 global $wikiStatistics , $wikiNewPages , $wikiOrphans , $wikiMostWanted , $wikiAllPages , $wikiRandomPage , $wikiStubs , $wikiListUsers ;
942942 $editOldVersion = "" ;
943943 if ( $oldID != "" ) $editOldVersion="&oldID=$oldID&version=$version" ;
@@ -950,6 +950,7 @@
951951 # To be implemented later
952952 # if ( $this->canAdvance() ) $column .= "<br><a href=\"".wikiLink("special:Advance&topic=$this->safeTitle")."\">Advance</a>\n" ;
953953
 954+ if ( in_array ( "is_sysop" , $user->rights ) ) $column .= "<br><a href=\"".wikiLink(urldecode("special:AskSQL"))."\">$wikiAskSQL</a>\n" ;
954955 if ( !$this->isSpecialPage ) $column .= "<br><a href=\"".wikiLink(urldecode($this->url)."&action=history")."\">$wikiHistory</a>\n" ;
955956 $column .= "<br><a href=\"".wikiLink("special:Upload")."\">$wikiUpload</a>\n" ;
956957 $column .= "<hr>" ;
Index: trunk/phpwiki/fpw/wikiTextEn.php
@@ -308,6 +308,8 @@
309309 $wikiStubText = "'''These are all the articles in the database, sorted by length, shortest first.'''<br>''#REDIRECT pages and pages within a namespace (like Talk:) are '''not''' listed here!''\n\n" ;
310310 $wikiLongPagesText = "'''These are all the articles in the database, sorted by length, longest first.'''<br>''#REDIRECT pages and pages within a namespace (like Talk:) are '''not''' listed here!''\n\n" ;
311311 $wikiStubChars = "$1 chars" ;
 312+$wikiAskSQL = "MySQL access" ;
 313+$wikiAskSQLtext = "This function is available for sysops only.<br>''Please, do not press return/enter, '''always''' click on the ask button!''" ;
312314 $wikiStubDelete = "<b>Delete this page!</b>" ;
313315 $wikiStubLinkHere = "$1 articles link here." ;
314316 $wikiStubShowLinks = "<nowiki><a href=\"$THESCRIPT?title=special:ShortPages&showLinksThere=$1\">Toggle \"show links\" option</a><br></nowiki>\n" ;

Status & tagging log