$wgOut->errorpage( "movenologin", "movenologintext" );
return;
}
- if (! $wgUser->isBureaucrat()){
+ if (! $wgUser->isBureaucrat() && ! $wgUser->isDeveloper() ){
$wgOut->errorpage( "bureaucrattitle", "bureaucrattext" );
return;
}
function showForm( $err = "")
{
global $wgOut, $wgUser, $wgLang;
- global $wpNewTitle, $wpOldTitle, $wpMovetalk, $target;
+ global $wpNewTitle, $wpOldTitle, $wpMovetalk, $target, $wpRights, $wpMakesysopUser;
- $wgOut->setPagetitle( wfMsg( "makesysoptitle" ) );
+ if ( $wgUser->isDeveloper() ) {
+ $wgOut->setPageTitle( wfMsg( "set_user_rights" ) );
+ } else {
+ $wgOut->setPagetitle( wfMsg( "makesysoptitle" ) );
+ }
$wgOut->addWikiText( wfMsg( "makesysoptext" ) );
$wgOut->addHTML( "<p><font color='red' size='+1'>{$err}</font>\n" );
}
$namedesc = wfMsg( "makesysopname" );
+ if ( isset( $wpMakesysopUser ) ) {
+ $encUser = htmlspecialchars( $wpMakesysopUser );
+ } else {
+ $encUser = "";
+ }
+
$wgOut->addHTML( "<p>
<form id=\"makesysop\" method=\"post\" action=\"{$action}\">
<table border=0>
<tr>
<td align=right>$namedesc</td>
<td align=left>
- <input type=text size=40 name=\"wpMakesysopUser\">
+ <input type=text size=40 name=\"wpMakesysopUser\" value=\"$encUser\">
</td>
</tr>"
);
+ /*
$makeburo = wfMsg( "setbureaucratflag" );
$wgOut->addHTML(
"<tr>
<input type=checkbox name=\"wpSetBureaucrat\" value=1>$makeburo
</td>
</tr>"
- );
+ );*/
+
+ if ( $wgUser->isDeveloper() ) {
+ $rights = wfMsg( "rights" );
+ if ( isset( $wpRights ) ) {
+ $encRights = htmlspecialchars( $wpRights );
+ } else {
+ $encRights = "sysop";
+ }
- $mss = wfMsg( "makesysopsubmit" );
+ $wgOut->addHTML( "
+ <tr>
+ <td align=right>$rights</td>
+ <td align=left>
+ <input type=text size=40 name=\"wpRights\" value=\"$encRights\">
+ </td>
+ </tr>"
+ );
+ }
+
+ if ( $wgUser->isDeveloper() ) {
+ $mss = wfMsg( "set_user_rights" );
+ } else {
+ $mss = wfMsg( "makesysopsubmit" );
+ }
$wgOut->addHTML(
"<tr>
<td> </td><td align=left>
function doSubmit()
{
global $wgOut, $wgUser, $wgLang, $wpMakesysopUser, $wpSetBureaucrat;
- global $wgDBname, $wgMemc;
- /*
+ global $wgDBname, $wgMemc, $wpRights;
+
$parts = explode( "@", $wpMakesysopUser );
- if( count( $parts ) == 2){
+ if( count( $parts ) == 2 && $wgUser->isDeveloper() ){
$username = addslashes( $parts[0] );
$usertable = $parts[1] . "wiki.user";
$dbName = $parts[1] . "wiki";
- } else {*/
- $username = addslashes( $wpMakesysopUser );
+ } else {
+ $username = addslashes( $wpMakesysopUser );
$usertable = "user";
$dbName = $wgDBname;
- #}
+ }
$prev = wfIgnoreSQLErrors( TRUE );
$res = wfQuery("SELECT user_id, user_rights FROM user WHERE user_name = '{$username}'", DB_WRITE);
wfIgnoreSQLErrors( $prev );
$id = intval( $row->user_id );
$rightsNotation = array();
- if( $row->user_rights ){
- $rights = explode(",", $row->user_rights );
- if(! in_array("sysop", $rights ) ){
- $rights[] = "sysop";
- $rightsNotation[] = "+sysop ";
- }
- if ( $wpSetBureaucrat && !in_array( "bureaucrat", $rights ) ) {
- $rights[] = "bureaucrat";
- $rightsNotation[] = "+bureaucrat ";
- }
- $newrights = addslashes( implode( ",", $rights ) );
+ if ( $wgUser->isDeveloper() ) {
+ $newrights = (string)$wpRights;
+ $rightsNotation[] = "=$wpRights";
} else {
- $newrights = "sysop";
- $rightsNotation[] = "+sysop";
- if ( $wpSetBureaucrat ) {
- $rightsNotation[] = "+bureaucrat";
- $newrights .= ",bureaucrat";
+ if( $row->user_rights ){
+ $rights = explode(",", $row->user_rights );
+ if(! in_array("sysop", $rights ) ){
+ $rights[] = "sysop";
+ $rightsNotation[] = "+sysop ";
+ }
+ if ( $wpSetBureaucrat && !in_array( "bureaucrat", $rights ) ) {
+ $rights[] = "bureaucrat";
+ $rightsNotation[] = "+bureaucrat ";
+ }
+ $newrights = addslashes( implode( ",", $rights ) );
+ } else {
+ $newrights = "sysop";
+ $rightsNotation[] = "+sysop";
+ if ( $wpSetBureaucrat ) {
+ $rightsNotation[] = "+bureaucrat";
+ $newrights .= ",bureaucrat";
+ }
}
}
function showSuccess()
{
- global $wgOut, $wpMakesysopUser;
+ global $wgOut, $wpMakesysopUser, $wgUser;
$wgOut->setPagetitle( wfMsg( "makesysoptitle" ) );
- $text = wfMsg( "makesysopok", $wpMakesysopUser );
+
+ if ( $wgUser->isDeveloper() ) {
+ $text = wfMsg( "user_rights_set", $wpMakesysopUser );
+ } else {
+ $text = wfMsg( "makesysopok", $wpMakesysopUser );
+ }
+ $text .= "\n\n";
$wgOut->addWikiText( $text );
$this->showForm();
function showFail()
{
- global $wgOut, $wpMakesysopUser;
+ global $wgOut, $wpMakesysopUser, $wgUser;
$wgOut->setPagetitle( wfMsg( "makesysoptitle" ) );
- $this->showForm( wfMsg( "makesysopfail", $wpMakesysopUser ) );
+ if ( $wgUser->isDeveloper() ) {
+ $this->showForm( wfMsg( "set_rights_fail", $wpMakesysopUser ) );
+ } else {
+ $this->showForm( wfMsg( "makesysopfail", $wpMakesysopUser ) );
+ }
}
}
?>
7 => "Image_talk",
8 => "MediaWiki",
9 => "MediaWiki_talk"
+
+ # Temporarily commented out:
+ /*,
+ 10 => "Template",
+ 11 => "Template_talk"*/
);
/* private */ $wgDefaultUserOptionsEn = array(
"date" => 0
);
+/* private */ $wgDefaultAnonOptionsEn = array(
+ "editsection" => 0
+);
+
/* private */ $wgQuickbarSettingsEn = array(
"None", "Fixed left", "Fixed right", "Floating left"
);
Type the name of the user in the box and press the button to make the user an administrator",
"makesysopname" => "Name of the user:",
"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>",
+"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",
"bureaucratlog" => "Bureaucrat_log",
-"bureaucratlogentry" => " set $1: $2",
+"bureaucratlogentry" => "Rights for user \"$1\" set \"$2\"",
+"rights" => "Rights:",
+"set_user_rights" => "Set user rights",
+"user_rights_set" => "<b>User rights for \"$1\" updated</b>",
+"set_rights_fail" => "<b>User rights for \"$1\" could not be set. (Did you enter the name correctly?)</b>",
# Move page
#
function getDefaultUserOptions () {
global $wgDefaultUserOptionsEn ;
return $wgDefaultUserOptionsEn ;
- }
+ }
+ function getDefaultAnonOptions() {
+ global $wgDefaultAnonOptionsEn;
+ return $wgDefaultAnonOptionsEn + $this->getDefaultUserOptions();
+ }
+
function getBookstoreList () {
global $wgBookstoreListEn ;
return $wgBookstoreListEn ;