r51111 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51110‎ | r51111 | r51112 >
Date:12:39, 28 May 2009
Author:werdna
Status:deferred
Tags:
Comment:
Fix bug 18947 "LiquidThreads thread renaming silently fails if user is not allowed to move pages" properly: disable the subject field if the user hasn't permission to change it.
Modified paths:
  • /trunk/extensions/LiquidThreads/classes/LqtView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/classes/LqtView.php
@@ -298,7 +298,7 @@
299299 wfMsgExt( 'lqt_invalid_subject', 'parse' ) );
300300 }
301301
302 - if ( $subject != $thread->subjectWithoutIncrement() &&
 302+ if ( $subject && $subject != $thread->subjectWithoutIncrement() &&
303303 !$this->user->isAllowed( 'move' ) ) {
304304 $e->editFormPageTop .=
305305 Xml::tags( 'div', array( 'class' => 'error' ),
@@ -327,10 +327,15 @@
328328 $db_subject = $thread ? $thread->subjectWithoutIncrement() : '';
329329 $subject = $this->request->getVal( 'lqt_subject_field', $db_subject );
330330 $subject_label = wfMsg( 'lqt_subject' );
331 - $e->editFormTextBeforeContent .= <<<HTML
332 - <label for="lqt_subject_field">$subject_label</label>
333 - <input type="text" size="60" name="lqt_subject_field" id="lqt_subject_field" value="$subject" tabindex="1"><br />
334 -HTML;
 331+
 332+ $disableattr = array();
 333+ if ( !$this->user->isAllowed( 'move' ) ) {
 334+ $disableattr = array( 'readonly' => 'readonly' );
 335+ }
 336+
 337+ $e->editFormTextBeforeContent .=
 338+ Xml::inputLabel( $subject_label, 'lqt_subject_field', 'lqt_subject_field',
 339+ 60, $subject, $disableattr ) . Xml::element( 'br' );
335340 }
336341
337342 $e->edit();

Follow-up revisions

RevisionCommit summaryAuthorDate
r51116Fix r51111, some bugs when creating a threadwerdna14:01, 28 May 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r51110Fix bug 18947 LiquidThreads thread renaming silently fails if user is not all...werdna12:32, 28 May 2009

Status & tagging log