Index: trunk/phase3/includes/ProtectionForm.php |
— | — | @@ -64,25 +64,23 @@ |
65 | 65 | ? array( 'disabled' => 'disabled' ) |
66 | 66 | : array(); |
67 | 67 | |
68 | | - if( $wgRequest->wasPosted() ) { |
69 | | - $this->mReason = $wgRequest->getText( 'mwProtect-reason' ); |
70 | | - $this->mCascade = $wgRequest->getBool( 'mwProtect-cascade' ); |
71 | | - $this->mExpiry = $wgRequest->getText( 'mwProtect-expiry' ); |
| 68 | + $this->mReason = $wgRequest->getText( 'mwProtect-reason' ); |
| 69 | + $this->mCascade = $wgRequest->getBool( 'mwProtect-cascade' ); |
| 70 | + $this->mExpiry = $wgRequest->getText( 'mwProtect-expiry', 'infinite' ); |
72 | 71 | |
73 | | - foreach( $this->mApplicableTypes as $action ) { |
74 | | - $val = $wgRequest->getVal( "mwProtect-level-$action" ); |
75 | | - if( isset( $val ) && in_array( $val, $wgRestrictionLevels ) ) { |
76 | | - //prevent users from setting levels that they cannot later unset |
77 | | - if( $val == 'sysop' ) { |
78 | | - //special case, rewrite sysop to either protect and editprotected |
79 | | - if( !$wgUser->isAllowed('protect') && !$wgUser->isAllowed('editprotected') ) |
80 | | - continue; |
81 | | - } else { |
82 | | - if( !$wgUser->isAllowed($val) ) |
83 | | - continue; |
84 | | - } |
85 | | - $this->mRestrictions[$action] = $val; |
| 72 | + foreach( $this->mApplicableTypes as $action ) { |
| 73 | + $val = $wgRequest->getVal( "mwProtect-level-$action" ); |
| 74 | + if( isset( $val ) && in_array( $val, $wgRestrictionLevels ) ) { |
| 75 | + // Prevent users from setting levels that they cannot later unset |
| 76 | + if( $val == 'sysop' ) { |
| 77 | + // Special case, rewrite sysop to either protect and editprotected |
| 78 | + if( !$wgUser->isAllowed('protect') && !$wgUser->isAllowed('editprotected') ) |
| 79 | + continue; |
| 80 | + } else { |
| 81 | + if( !$wgUser->isAllowed($val) ) |
| 82 | + continue; |
86 | 83 | } |
| 84 | + $this->mRestrictions[$action] = $val; |
87 | 85 | } |
88 | 86 | } |
89 | 87 | } |