From: Alexandre Emsenhuber Date: Sun, 18 Dec 2011 16:02:14 +0000 (+0000) Subject: And I of course forgot to commit ProtectionForm.php in r106567... X-Git-Tag: 1.31.0-rc.0~25908 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=81de35ad40de3bb32b91bf3c253ce0c1b3752f45;p=lhc%2Fweb%2Fwiklou.git And I of course forgot to commit ProtectionForm.php in r106567... --- diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php index caa949dacc..dbe06d49c6 100644 --- a/includes/ProtectionForm.php +++ b/includes/ProtectionForm.php @@ -247,7 +247,7 @@ class ProtectionForm { * @return Boolean: success */ function save() { - global $wgRequest, $wgUser; + global $wgRequest, $wgUser, $wgOut; # Permission check! if ( $this->disabled ) { @@ -294,14 +294,11 @@ class ProtectionForm { !(isset($wgGroupPermissions[$edit_restriction]['protect']) && $wgGroupPermissions[$edit_restriction]['protect'] ) ) $this->mCascade = false; - if ($this->mTitle->exists()) { - $ok = $this->mArticle->updateRestrictions( $this->mRestrictions, $reasonstr, $this->mCascade, $expiry ); - } else { - $ok = $this->mTitle->updateTitleProtection( $this->mRestrictions['create'], $reasonstr, $expiry['create'] ); - } + $status = $this->mArticle->doUpdateRestrictions( $this->mRestrictions, $expiry, $this->mCascade, $reasonstr, $wgUser ); - if( !$ok ) { - throw new FatalError( "Unknown error at restriction save time." ); + if ( !$status->isOK() ) { + $this->show( $wgOut->parseInline( $status->getWikiText() ) ); + return false; } /** @@ -326,7 +323,7 @@ class ProtectionForm { } elseif ( $this->mTitle->userIsWatching() ) { WatchAction::doUnwatch( $this->mTitle, $wgUser ); } - return $ok; + return true; } /**