Index: trunk/phase3/includes/specials/SpecialRestrictUser.php |
— | — | @@ -62,7 +62,7 @@ |
63 | 63 | global $wgOut, $wgRequest, $wgUser; |
64 | 64 | $error = ''; |
65 | 65 | $success = false; |
66 | | - if( $wgRequest->wasPosted() && $wgRequest->getVal( 'type' ) == UserRestriction::PAGE && |
| 66 | + if( $wgRequest->wasPosted() && $wgRequest->getVal( 'type' ) == UserRestriction::PAGE_RESTRICTION && |
67 | 67 | $wgUser->matchEditToken( $wgRequest->getVal( 'edittoken' ) ) ) { |
68 | 68 | |
69 | 69 | $title = Title::newFromText( $wgRequest->getVal( 'page' ) ); |
— | — | @@ -81,14 +81,14 @@ |
82 | 82 | $success = array('restrictuser-success', $user); |
83 | 83 | } |
84 | 84 | } |
85 | | - $useRequestValues = $wgRequest->getVal( 'type' ) == UserRestriction::PAGE; |
| 85 | + $useRequestValues = $wgRequest->getVal( 'type' ) == UserRestriction::PAGE_RESTRICTION; |
86 | 86 | $wgOut->addHTML( Xml::fieldset( wfMsg( 'restrictuser-legend-page' ) ) ); |
87 | 87 | |
88 | 88 | self::printSuccessError( $success, $error ); |
89 | 89 | |
90 | 90 | $wgOut->addHTML( Xml::openElement( 'form', array( 'action' => SpecialPage::getTitleFor( 'RestrictUser' )->getLocalUrl(), |
91 | 91 | 'method' => 'post' ) ) ); |
92 | | - $wgOut->addHTML( Xml::hidden( 'type', UserRestriction::PAGE ) ); |
| 92 | + $wgOut->addHTML( Xml::hidden( 'type', UserRestriction::PAGE_RESTRICTION ) ); |
93 | 93 | $wgOut->addHTML( Xml::hidden( 'edittoken', $wgUser->editToken() ) ); |
94 | 94 | $wgOut->addHTML( Xml::hidden( 'user', $user ) ); |
95 | 95 | $form = array(); |
— | — | @@ -113,7 +113,7 @@ |
114 | 114 | public static function doPageRestriction( $uid, $user ) { |
115 | 115 | global $wgUser, $wgRequest; |
116 | 116 | $r = new UserRestriction(); |
117 | | - $r->setType( UserRestriction::PAGE ); |
| 117 | + $r->setType( UserRestriction::PAGE_RESTRICTION ); |
118 | 118 | $r->setPage( Title::newFromText( $wgRequest->getVal( 'page' ) ) ); |
119 | 119 | $r->setSubjectId( $uid ); |
120 | 120 | $r->setSubjectText( $user ); |
— | — | @@ -133,7 +133,7 @@ |
134 | 134 | global $wgOut, $wgRequest, $wgUser, $wgContLang; |
135 | 135 | $error = ''; |
136 | 136 | $success = false; |
137 | | - if( $wgRequest->wasPosted() && $wgRequest->getVal( 'type' ) == UserRestriction::NAMESPACE && |
| 137 | + if( $wgRequest->wasPosted() && $wgRequest->getVal( 'type' ) == UserRestriction::NAMESPACE_RESTRICTION && |
138 | 138 | $wgUser->matchEditToken( $wgRequest->getVal( 'edittoken' ) ) ) { |
139 | 139 | $ns = $wgRequest->getVal( 'namespace' ); |
140 | 140 | if( $wgContLang->getNsText( $ns ) === false ) |
— | — | @@ -149,14 +149,14 @@ |
150 | 150 | $success = array('restrictuser-success', $user); |
151 | 151 | } |
152 | 152 | } |
153 | | - $useRequestValues = $wgRequest->getVal( 'type' ) == UserRestriction::NAMESPACE; |
| 153 | + $useRequestValues = $wgRequest->getVal( 'type' ) == UserRestriction::NAMESPACE_RESTRICTION; |
154 | 154 | $wgOut->addHTML( Xml::fieldset( wfMsg( 'restrictuser-legend-namespace' ) ) ); |
155 | 155 | |
156 | 156 | self::printSuccessError( $success, $error ); |
157 | 157 | |
158 | 158 | $wgOut->addHTML( Xml::openElement( 'form', array( 'action' => SpecialPage::getTitleFor( 'RestrictUser' )->getLocalUrl(), |
159 | 159 | 'method' => 'post' ) ) ); |
160 | | - $wgOut->addHTML( Xml::hidden( 'type', UserRestriction::NAMESPACE ) ); |
| 160 | + $wgOut->addHTML( Xml::hidden( 'type', UserRestriction::NAMESPACE_RESTRICTION ) ); |
161 | 161 | $wgOut->addHTML( Xml::hidden( 'edittoken', $wgUser->editToken() ) ); |
162 | 162 | $wgOut->addHTML( Xml::hidden( 'user', $user ) ); |
163 | 163 | $form = array(); |
— | — | @@ -172,7 +172,7 @@ |
173 | 173 | public static function doNamespaceRestriction( $uid, $user ) { |
174 | 174 | global $wgUser, $wgRequest; |
175 | 175 | $r = new UserRestriction(); |
176 | | - $r->setType( UserRestriction::NAMESPACE ); |
| 176 | + $r->setType( UserRestriction::NAMESPACE_RESTRICTION ); |
177 | 177 | $r->setNamespace( $wgRequest->getVal( 'namespace' ) ); |
178 | 178 | $r->setSubjectId( $uid ); |
179 | 179 | $r->setSubjectText( $user ); |
Index: trunk/phase3/includes/specials/SpecialListUserRestrictions.php |
— | — | @@ -48,8 +48,8 @@ |
49 | 49 | public static function typeSelector( $name = 'type', $value = '', $id = false ) { |
50 | 50 | $s = new XmlSelect( $name, $id, $value ); |
51 | 51 | $s->addOption( wfMsg( 'userrestrictiontype-none' ), '' ); |
52 | | - $s->addOption( wfMsg( 'userrestrictiontype-page' ), UserRestriction::PAGE ); |
53 | | - $s->addOption( wfMsg( 'userrestrictiontype-namespace' ), UserRestriction::NAMESPACE ); |
| 52 | + $s->addOption( wfMsg( 'userrestrictiontype-page' ), UserRestriction::PAGE_RESTRICTION ); |
| 53 | + $s->addOption( wfMsg( 'userrestrictiontype-namespace' ), UserRestriction::NAMESPACE_RESTRICTION ); |
54 | 54 | return $s->getHTML(); |
55 | 55 | } |
56 | 56 | |
— | — | @@ -58,7 +58,7 @@ |
59 | 59 | $conds = array(); |
60 | 60 | |
61 | 61 | $type = $wgRequest->getVal( 'type' ); |
62 | | - if( in_array( $type, array( UserRestriction::PAGE, UserRestriction::NAMESPACE ) ) ) |
| 62 | + if( in_array( $type, array( UserRestriction::PAGE_RESTRICTION, UserRestriction::NAMESPACE_RESTRICTION ) ) ) |
63 | 63 | $conds['ur_type'] = $type; |
64 | 64 | |
65 | 65 | $user = $wgRequest->getVal( 'user' ); |
— | — | @@ -105,7 +105,7 @@ |
106 | 106 | $name = str_replace( ' ', '_', $row->ur_user_text ); |
107 | 107 | $lb->add( NS_USER, $name ); |
108 | 108 | $lb->add( NS_USER_TALK, $name ); |
109 | | - if( $row->ur_type == UserRestriction::PAGE ) |
| 109 | + if( $row->ur_type == UserRestriction::PAGE_RESTRICTION ) |
110 | 110 | $lb->add( $row->ur_page_namespace, $row->ur_page_title ); |
111 | 111 | } |
112 | 112 | $lb->execute(); |