Put the sysop user on install into the sysop and brueacrat groups
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 28 Dec 2004 14:49:42 +0000 (14:49 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 28 Dec 2004 14:49:42 +0000 (14:49 +0000)
config/index.php
includes/Article.php
includes/DefaultSettings.php

index f79af5b..ba246e0 100644 (file)
@@ -544,6 +544,16 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) {
                                        $u->addRight( "sysop" );
                                        $u->addRight( "bureaucrat" );
                                        $u->saveSettings();
+                                       
+                                       # Set up the new user in the sysop group
+                                       # This is a bit of an ugly hack
+                                       global $wgSysopGroupId, $wgBureaucratGroupId;
+                                       $groups = $u->getGroups();
+                                       $groups[] = $wgSysopGroupId;
+                                       $groups[] = $wgBureaucratGroupId;
+                                       $u->setGroups( $groups );
+                                       $u->saveSettings();
+                                       
                                        print "<li>Created sysop account <tt>" .
                                                htmlspecialchars( $conf->SysopName ) . "</tt>.</li>\n";
                                } else {
index c6f63cc..ff0be1d 100644 (file)
@@ -1243,12 +1243,12 @@ class Article {
                        if (wfRunHooks('ArticleProtect', $this, $wgUser, $limit == 'sysop', $reason, $moveonly)) {
                                
                                $dbw =& wfGetDB( DB_MASTER );
-                               $dbw->update( 'cur',
+                               $dbw->update( 'page',
                                                          array( /* SET */
-                                                                        'cur_touched' => $dbw->timestamp(),
-                                                                        'cur_restrictions' => $restrictions
+                                                                        'page_touched' => $dbw->timestamp(),
+                                                                        'page_restrictions' => $restrictions
                                                                         ), array( /* WHERE */
-                                                                                          'cur_id' => $id
+                                                                                          'page_id' => $id
                                                                                           ), 'Article::protect'
                                                          );
                                
index c048965..a049130 100644 (file)
@@ -939,6 +939,8 @@ $wgLocaltimezone = null;
 # default. A better interface should be coded [av]
 $wgAnonGroupId = 1;
 $wgLoggedInGroupId = 2;
+$wgSysopGroupId = 3;
+$wgBureaucratGroupId = 4;
 
 /*
 When translating messages with wfMsg(), it is not always clear what should