Index: trunk/extensions/Sudo/SpecialSudo.php |
— | — | @@ -27,14 +27,13 @@ |
28 | 28 | } |
29 | 29 | |
30 | 30 | class SpecialSudo extends SpecialPage { |
31 | | - protected $mode, $skin, $target, $reason, $errors; |
| 31 | + protected $mode, $target, $reason, $errors; |
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Constructor -- set up the new special page |
35 | 35 | */ |
36 | 36 | public function __construct() { |
37 | 37 | parent::__construct( 'Sudo', 'sudo' ); |
38 | | - |
39 | 38 | } |
40 | 39 | |
41 | 40 | /** |
— | — | @@ -47,10 +46,12 @@ |
48 | 47 | |
49 | 48 | $this->mode = $wgRequest->getText( 'mode' ); |
50 | 49 | if( $this->mode == 'success' ) { |
51 | | - return $this->showSuccessPage(); |
| 50 | + $this->showSuccessPage(); |
| 51 | + return; |
52 | 52 | } |
53 | 53 | if( $this->mode == 'unsudo' ) { |
54 | | - return $this->showUnsudoPage(); |
| 54 | + $this->showUnsudoPage(); |
| 55 | + return; |
55 | 56 | } |
56 | 57 | |
57 | 58 | // Check that the user is allowed to access this special page... |
— | — | @@ -74,7 +75,6 @@ |
75 | 76 | // Set page title and other stuff |
76 | 77 | $this->setHeaders(); |
77 | 78 | |
78 | | - $this->skin = $wgUser->getSkin(); |
79 | 79 | $this->target = $wgRequest->getText( 'target', $par ); |
80 | 80 | $this->reason = $wgRequest->getText( 'reason', '' ); |
81 | 81 | $this->errors = array(); |
— | — | @@ -92,11 +92,10 @@ |
93 | 93 | $this->showError( 'sudo-error-nosudo' ); |
94 | 94 | } else { |
95 | 95 | $this->setHeaders(); |
96 | | - $s = $wgUser->getSkin(); |
97 | 96 | $suUser = User::newFromId( $_SESSION['wsSudoId'] ); |
98 | 97 | $wgOut->addHTML( wfMsgExt( 'sudo-success', array( 'parse', 'replaceafter' ), |
99 | | - $s->makeLinkObj( $suUser->getUserPage(), htmlspecialchars( $suUser->getName() ) ), |
100 | | - $s->makeLinkObj( $wgUser->getUserPage(), htmlspecialchars( $wgUser->getName() ) ) ) |
| 98 | + Linker::makeLinkObj( $suUser->getUserPage(), htmlspecialchars( $suUser->getName() ) ), |
| 99 | + Linker::makeLinkObj( $wgUser->getUserPage(), htmlspecialchars( $wgUser->getName() ) ) ) |
101 | 100 | ); |
102 | 101 | } |
103 | 102 | } |
— | — | @@ -115,7 +114,6 @@ |
116 | 115 | } |
117 | 116 | $this->setHeaders(); |
118 | 117 | $wgOut->setPageTitle( wfMsg( 'unsudo' ) ); |
119 | | - $s = $wgUser->getSkin(); |
120 | 118 | |
121 | 119 | $wgOut->addHTML( |
122 | 120 | Xml::openElement( 'form', array( 'method' => 'post', |
— | — | @@ -124,8 +122,8 @@ |
125 | 123 | ); |
126 | 124 | $wgOut->addHTML( |
127 | 125 | wfMsgExt( 'sudo-unsudo', array( 'parse', 'replaceafter' ), |
128 | | - $s->makeLinkObj( $suUser->getUserPage(), htmlspecialchars( $suUser->getName() ) ), |
129 | | - $s->makeLinkObj( $wgUser->getUserPage(), htmlspecialchars( $wgUser->getName() ) ) |
| 126 | + Linker::makeLinkObj( $suUser->getUserPage(), htmlspecialchars( $suUser->getName() ) ), |
| 127 | + Linker::makeLinkObj( $wgUser->getUserPage(), htmlspecialchars( $wgUser->getName() ) ) |
130 | 128 | ) . |
131 | 129 | Xml::submitButton( wfMsg( 'sudo-unsudo-submit' ) ) . |
132 | 130 | Xml::closeElement( 'form' ) |
— | — | @@ -151,7 +149,6 @@ |
152 | 150 | |
153 | 151 | function addError( $error = '' ) { |
154 | 152 | $this->errors[] = $error; |
155 | | - return; |
156 | 153 | } |
157 | 154 | |
158 | 155 | function showError( $error ) { |
— | — | @@ -172,22 +169,25 @@ |
173 | 170 | |
174 | 171 | $u = User::newFromName( $this->target ); |
175 | 172 | if( is_null( $u ) ) { |
176 | | - return $this->addError( 'sudo-error-sudo-invaliduser' ); |
| 173 | + $this->addError( 'sudo-error-sudo-invaliduser' ); |
| 174 | + return; |
177 | 175 | } |
178 | 176 | if( User::isIP( $u->getName() ) ) { |
179 | | - return $this->addError( 'sudo-error-ip' ); |
| 177 | + $this->addError( 'sudo-error-ip' ); |
| 178 | + return; |
180 | 179 | } |
181 | 180 | if( $u->isAnon() ) { |
182 | | - return $this->addError( 'sudo-error-sudo-nonexistent' ); |
| 181 | + $this->addError( 'sudo-error-sudo-nonexistent' ); |
| 182 | + return; |
183 | 183 | } |
184 | 184 | if( $u->getName() === $wgUser->getName() ) { |
185 | | - return $this->addError( 'sudo-error-sudo-self' ); |
| 185 | + $this->addError( 'sudo-error-sudo-self' ); |
| 186 | + return; |
186 | 187 | } |
187 | 188 | |
188 | | - $s = $wgUser->getSkin(); |
189 | 189 | $log = new LogPage( 'sudo' ); |
190 | 190 | $log->addEntry( 'sudo', $wgUser->getUserPage(), $this->reason, |
191 | | - array( $s->makeLinkObj( $u->getUserPage(), $u->getName() ) ) ); |
| 191 | + array( Linker::makeLinkObj( $u->getUserPage(), $u->getName() ) ) ); |
192 | 192 | |
193 | 193 | if( !isset( $_SESSION['wsSudoId'] ) || $_SESSION['wsSudoId'] < 0 ) { |
194 | 194 | $_SESSION['wsSudoId'] = $wgUser->getId(); |
Index: trunk/extensions/Tasks/Tasks.hooks.php |
— | — | @@ -236,7 +236,6 @@ |
237 | 237 | $st->change_task_status( $task->task_id, MW_TASK_CLOSED ); |
238 | 238 | $st->set_new_article_id( $t ); |
239 | 239 | |
240 | | - $id = $t->getArticleId(); |
241 | 240 | # Nothing more to do |
242 | 241 | break; |
243 | 242 | } |