From: Brion Vibber Date: Tue, 28 Dec 2004 14:49:42 +0000 (+0000) Subject: Put the sysop user on install into the sysop and brueacrat groups X-Git-Tag: 1.5.0alpha1~1020 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=1b2d65fb81900011d1c2f66400baa2b58e7d7814;p=lhc%2Fweb%2Fwiklou.git Put the sysop user on install into the sysop and brueacrat groups --- diff --git a/config/index.php b/config/index.php index f79af5bb91..ba246e053d 100644 --- a/config/index.php +++ b/config/index.php @@ -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 "
  • Created sysop account " . htmlspecialchars( $conf->SysopName ) . ".
  • \n"; } else { diff --git a/includes/Article.php b/includes/Article.php index c6f63cce39..ff0be1d848 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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' ); diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index c048965e76..a0491306e5 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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