X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FProtectionForm.php;h=beb20eabc734b109383a45e57e6ac773d4831e84;hb=759518bdde8825dc414c1ff0cf99a9dc84088ae6;hp=ce0e36b044e037a0b4da9305f609bb894a92768f;hpb=c024eaddc2ae38191f64e3b309d8fb0fb990cd6b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php index ce0e36b044..beb20eabc7 100644 --- a/includes/ProtectionForm.php +++ b/includes/ProtectionForm.php @@ -286,12 +286,10 @@ class ProtectionForm { # They shouldn't be able to do this anyway, but just to make sure, ensure that cascading restrictions aren't being applied # to a semi-protected page. - global $wgGroupPermissions; - $edit_restriction = isset( $this->mRestrictions['edit'] ) ? $this->mRestrictions['edit'] : ''; $this->mCascade = $wgRequest->getBool( 'mwProtect-cascade' ); if ($this->mCascade && ($edit_restriction != 'protect') && - !(isset($wgGroupPermissions[$edit_restriction]['protect']) && $wgGroupPermissions[$edit_restriction]['protect'] ) ) + !User::groupHasPermission( $edit_restriction, 'protect' ) ) $this->mCascade = false; $status = $this->mArticle->doUpdateRestrictions( $this->mRestrictions, $expiry, $this->mCascade, $reasonstr, $wgUser ); @@ -600,11 +598,11 @@ class ProtectionForm { } function buildCleanupScript() { - global $wgRestrictionLevels, $wgGroupPermissions, $wgOut; + global $wgRestrictionLevels, $wgOut; $cascadeableLevels = array(); foreach( $wgRestrictionLevels as $key ) { - if ( ( isset( $wgGroupPermissions[$key]['protect'] ) && $wgGroupPermissions[$key]['protect'] ) + if ( User::groupHasPermission( $key, 'protect' ) || $key == 'protect' ) { $cascadeableLevels[] = $key;