Allowing bureaucrats to create other bureaucrats
authorTim Starling <tstarling@users.mediawiki.org>
Fri, 6 Feb 2004 15:14:53 +0000 (15:14 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Fri, 6 Feb 2004 15:14:53 +0000 (15:14 +0000)
includes/SpecialMakesysop.php
languages/Language.php

index 1a99fd9..5996032 100644 (file)
@@ -56,6 +56,15 @@ class MakesysopForm {
                                </td>
                        </tr>" 
                );
+               $makeburo = wfMsg( "setbureaucratflag" );
+               $wgOut->addHTML(
+                       "<tr>
+                               <td>&nbsp;</td><td align=left>
+                                       <input type=checkbox name=\"wpSetBureaucrat\" value=1>$makeburo
+                               </td>
+                       </tr>"
+               );
+
                $mss = wfMsg( "makesysopsubmit" );
                $wgOut->addHTML(
                        "<tr>
@@ -69,7 +78,9 @@ class MakesysopForm {
 
        function doSubmit()
        {
-               global $wgOut, $wgUser, $wgLang, $wpMakesysopUser, $wgDBname, $wgMemc;
+               global $wgOut, $wgUser, $wgLang, $wpMakesysopUser, $wpSetBureaucrat;
+               global $wgDBname, $wgMemc;
+               
                $parts = explode( "@", $wpMakesysopUser );
                if( count( $parts ) == 2){
                        $username = addslashes( $parts[0] );
@@ -95,6 +106,9 @@ class MakesysopForm {
                        if(! in_array("sysop", $rights ) ){
                                $rights[] = "sysop";
                        }
+                       if ( $wpSetBureaucrat && !in_array( "bureaucrat", $rights ) ) {
+                               $rights[] = "bureaucrat";
+                       }
                        $newrights = addslashes( implode( ",", $rights ) );
                } else {
                        $newrights = "sysop";
index aed5165..07d15d5 100644 (file)
@@ -1278,6 +1278,7 @@ Type the name of the user in the box and press the button to make the user an ad
 "makesysopsubmit"      => "Make this user into a sysop",
 "makesysopok"          => "<b>User '$1' is now a sysop</b>",
 "makesysopfail"                => "<b>User '$1' could not be made into a sysop. (Did you enter the name correctly?)</b>",
+"setbureaucratflag" => "Set bureaucrat flag",
 
 # Move page
 #