* @ingroup SpecialPage
*/
class LoginForm extends SpecialPage {
-
const SUCCESS = 0;
const NO_NAME = 1;
const ILLEGAL = 2;
$this->mAction = $request->getVal( 'action' );
$this->mRemember = $request->getCheck( 'wpRemember' );
$this->mFromHTTP = $request->getBool( 'fromhttp', false );
- $this->mStickHTTPS = ( !$this->mFromHTTP && $request->getProtocol() === 'https' ) || $request->getBool( 'wpForceHttps', false );
+ $this->mStickHTTPS = ( !$this->mFromHTTP && $request->getProtocol() === 'https' )
+ || $request->getBool( 'wpForceHttps', false );
$this->mLanguage = $request->getText( 'uselang' );
$this->mSkipCookieCheck = $request->getCheck( 'wpSkipCookieCheck' );
- $this->mToken = ( $this->mType == 'signup' ) ? $request->getVal( 'wpCreateaccountToken' ) : $request->getVal( 'wpLoginToken' );
+ $this->mToken = $this->mType == 'signup'
+ ? $request->getVal( 'wpCreateaccountToken' )
+ : $request->getVal( 'wpLoginToken' );
$this->mReturnTo = $request->getVal( 'returnto', '' );
$this->mReturnToQuery = $request->getVal( 'returntoquery', '' );
}
# Include checks that will include GlobalBlocking (Bug 38333)
- $permErrors = $this->getPageTitle()->getUserPermissionsErrors( 'createaccount', $currentUser, true );
+ $permErrors = $this->getPageTitle()->getUserPermissionsErrors(
+ 'createaccount',
+ $currentUser,
+ true
+ );
+
if ( count( $permErrors ) ) {
throw new PermissionsError( 'createaccount', $permErrors );
}
return Status::newFatal( 'sorbs_create_account_reason' );
}
- // Normalize the name so that silly things don't cause "invalid username" errors.
- // User::newFromName does some rather strict checking, rejecting e.g. leading/trailing/multiple spaces.
+ // Normalize the name so that silly things don't cause "invalid username"
+ // errors. User::newFromName does some rather strict checking, rejecting
+ // e.g. leading/trailing/multiple spaces.
$title = Title::makeTitleSafe( NS_USER, $this->mUsername );
if ( !is_object( $title ) ) {
return Status::newFatal( 'noname' );
// Hook point to check for exempt from account creation throttle
if ( !wfRunHooks( 'ExemptFromAccountCreationThrottle', array( $ip ) ) ) {
- wfDebug( "LoginForm::exemptFromAccountCreationThrottle: a hook allowed account creation w/o throttle\n" );
+ wfDebug( "LoginForm::exemptFromAccountCreationThrottle: a hook " .
+ "allowed account creation w/o throttle\n" );
} else {
if ( ( $wgAccountCreationThrottle && $currentUser->isPingLimitable() ) ) {
$key = wfMemcKey( 'acctcreate', 'ip', $ip );
function processLogin() {
global $wgMemc, $wgLang, $wgSecureLogin, $wgPasswordAttemptThrottle,
- $wgInvalidPasswordReset;
+ $wgInvalidPasswordReset;
switch ( $this->authenticateUserData() ) {
case self::SUCCESS:
* @param string $emailText message name of email text
* @return Status object
*/
- function mailPasswordInternal( $u, $throttle = true, $emailTitle = 'passwordremindertitle', $emailText = 'passwordremindertext' ) {
+ function mailPasswordInternal( $u, $throttle = true, $emailTitle = 'passwordremindertitle',
+ $emailText = 'passwordremindertext'
+ ) {
global $wgNewPasswordExpiry;
if ( $u->getEmail() == '' ) {
* @ingroup SpecialPage
*/
class SpecialUserlogout extends UnlistedSpecialPage {
-
function __construct() {
parent::__construct( 'Userlogout' );
}
$targetUser->clearInstanceCache(); // bug 38989
}
- if ( $request->getVal( 'conflictcheck-originalgroups' ) !== implode( ',', $targetUser->getGroups() ) ) {
+ if ( $request->getVal( 'conflictcheck-originalgroups' )
+ !== implode( ',', $targetUser->getGroups() )
+ ) {
$out->addWikiMsg( 'userrights-conflict' );
} else {
$this->saveUserGroups(
function switchForm() {
global $wgScript;
$this->getOutput()->addHTML(
- Html::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'name' => 'uluser', 'id' => 'mw-userrights-form1' ) ) .
+ Html::openElement(
+ 'form',
+ array(
+ 'method' => 'get',
+ 'action' => $wgScript,
+ 'name' => 'uluser',
+ 'id' => 'mw-userrights-form1'
+ )
+ ) .
Html::hidden( 'title', $this->getPageTitle()->getPrefixedText() ) .
Xml::fieldset( $this->msg( 'userrights-lookup-user' )->text() ) .
- Xml::inputLabel( $this->msg( 'userrights-user-editname' )->text(), 'user', 'username', 30, str_replace( '_', ' ', $this->mTarget ), array( 'autofocus' => true ) ) . ' ' .
+ Xml::inputLabel(
+ $this->msg( 'userrights-user-editname' )->text(),
+ 'user',
+ 'username',
+ 30,
+ str_replace( '_', ' ', $this->mTarget ),
+ array( 'autofocus' => true )
+ ) . ' ' .
Xml::submitButton( $this->msg( 'editusergroup' )->text() ) .
Html::closeElement( 'fieldset' ) .
Html::closeElement( 'form' ) . "\n"
$grouplist = $this->msg( 'userrights-groupsmember', $count, $user->getName() )->parse();
$grouplist = '<p>' . $grouplist . ' ' . $displayedList . "</p>\n";
}
+
$count = count( $autoList );
if ( $count > 0 ) {
- $autogrouplistintro = $this->msg( 'userrights-groupsmember-auto', $count, $user->getName() )->parse();
+ $autogrouplistintro = $this->msg( 'userrights-groupsmember-auto', $count, $user->getName() )
+ ->parse();
$grouplist .= '<p>' . $autogrouplistintro . ' ' . $displayedAutolist . "</p>\n";
}
);
$this->getOutput()->addHTML(
- Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getPageTitle()->getLocalURL(), 'name' => 'editGroup', 'id' => 'mw-userrights-form2' ) ) .
+ Xml::openElement(
+ 'form',
+ array(
+ 'method' => 'post',
+ 'action' => $this->getPageTitle()->getLocalURL(),
+ 'name' => 'editGroup',
+ 'id' => 'mw-userrights-form2'
+ )
+ ) .
Html::hidden( 'user', $this->mTarget ) .
Html::hidden( 'wpEditToken', $this->getUser()->getEditToken( $this->mTarget ) ) .
- Html::hidden( 'conflictcheck-originalgroups', implode( ',', $user->getGroups() ) ) . // Conflict detection
+ Html::hidden(
+ 'conflictcheck-originalgroups',
+ implode( ',', $user->getGroups() )
+ ) . // Conflict detection
Xml::openElement( 'fieldset' ) .
- Xml::element( 'legend', array(), $this->msg( 'userrights-editusergroup', $user->getName() )->text() ) .
- $this->msg( 'editinguser' )->params( wfEscapeWikiText( $user->getName() ) )->rawParams( $userToolLinks )->parse() .
+ Xml::element(
+ 'legend',
+ array(),
+ $this->msg( 'userrights-editusergroup', $user->getName() )->text()
+ ) .
+ $this->msg( 'editinguser' )->params( wfEscapeWikiText( $user->getName() ) )
+ ->rawParams( $userToolLinks )->parse() .
$this->msg( 'userrights-groups-help', $user->getName() )->parse() .
$grouplist .
Xml::tags( 'p', null, $this->groupCheckboxes( $groups, $user ) ) .
<td></td>
<td class='mw-submit'>" .
Xml::submitButton( $this->msg( 'saveusergroups' )->text(),
- array( 'name' => 'saveusergroups' ) + Linker::tooltipAndAccesskeyAttribs( 'userrights-set' ) ) .
+ array( 'name' => 'saveusergroups' ) +
+ Linker::tooltipAndAccesskeyAttribs( 'userrights-set' )
+ ) .
"</td>
</tr>" .
Xml::closeElement( 'table' ) . "\n" .
continue;
}
// Messages: userrights-changeable-col, userrights-unchangeable-col
- $ret .= Xml::element( 'th', null, $this->msg( 'userrights-' . $name . '-col', count( $column ) )->text() );
+ $ret .= Xml::element(
+ 'th',
+ null,
+ $this->msg( 'userrights-' . $name . '-col', count( $column ) )->text()
+ );
}
+
$ret .= "</tr>\n<tr>\n";
foreach ( $columns as $column ) {
if ( $column === array() ) {
// $this->changeableGroups()['remove'] doesn't work, of course. Thanks, PHP.
$groups = $this->changeableGroups();
- return in_array( $group, $groups['remove'] ) || ( $this->isself && in_array( $group, $groups['remove-self'] ) );
+ return in_array(
+ $group,
+ $groups['remove'] ) || ( $this->isself && in_array( $group, $groups['remove-self'] )
+ );
}
/**
private function canAdd( $group ) {
$groups = $this->changeableGroups();
- return in_array( $group, $groups['add'] ) || ( $this->isself && in_array( $group, $groups['add-self'] ) );
+ return in_array(
+ $group,
+ $groups['add'] ) || ( $this->isself && in_array( $group, $groups['add-self'] )
+ );
}
/**
* Returns $this->getUser()->changeableGroups()
*
- * @return Array array( 'add' => array( addablegroups ), 'remove' => array( removablegroups ), 'add-self' => array( addablegroups to self ), 'remove-self' => array( removable groups from self ) )
+ * @return array array(
+ * 'add' => array( addablegroups ),
+ * 'remove' => array( removablegroups ),
+ * 'add-self' => array( addablegroups to self ),
+ * 'remove-self' => array( removable groups from self )
+ * )
*/
function changeableGroups() {
return $this->getUser()->changeableGroups();
* @ingroup SpecialPage
*/
class SpecialVersion extends SpecialPage {
-
protected $firstExtOpened = false;
protected static $extensionTypes = false;
* @return string
*/
private static function getMediaWikiCredits() {
- $ret = Xml::element( 'h2', array( 'id' => 'mw-version-license' ), wfMessage( 'version-license' )->text() );
+ $ret = Xml::element(
+ 'h2',
+ array( 'id' => 'mw-version-license' ),
+ wfMessage( 'version-license' )->text()
+ );
// This text is always left-to-right.
$ret .= '<div class="plainlinks">';
global $wgLang;
if ( defined( 'MEDIAWIKI_INSTALL' ) ) {
- $othersLink = '[//www.mediawiki.org/wiki/Special:Version/Credits ' . wfMessage( 'version-poweredby-others' )->text() . ']';
+ $othersLink = '[//www.mediawiki.org/wiki/Special:Version/Credits ' .
+ wfMessage( 'version-poweredby-others' )->text() . ']';
} else {
- $othersLink = '[[Special:Version/Credits|' . wfMessage( 'version-poweredby-others' )->text() . ']]';
+ $othersLink = '[[Special:Version/Credits|' .
+ wfMessage( 'version-poweredby-others' )->text() . ']]';
}
- $translatorsLink = '[//translatewiki.net/wiki/Translating:MediaWiki/Credits ' . wfMessage( 'version-poweredby-translators' )->text() . ']';
+ $translatorsLink = '[//translatewiki.net/wiki/Translating:MediaWiki/Credits ' .
+ wfMessage( 'version-poweredby-translators' )->text() . ']';
$authorList = array(
'Magnus Manske', 'Brion Vibber', 'Lee Daniel Crocker',
// Allow a hook to add/remove items.
wfRunHooks( 'SoftwareInfo', array( &$software ) );
- $out = Xml::element( 'h2', array( 'id' => 'mw-version-software' ), wfMessage( 'version-software' )->text() ) .
+ $out = Xml::element(
+ 'h2',
+ array( 'id' => 'mw-version-software' ),
+ wfMessage( 'version-software' )->text()
+ ) .
Xml::openElement( 'table', array( 'class' => 'wikitable plainlinks', 'id' => 'sv-software' ) ) .
"<tr>
<th>" . wfMessage( 'version-software-product' )->text() . "</th>
/**
* @since 1.22 Returns the HEAD date in addition to the sha1 and link
- * @return bool|string wgVersion + HEAD sha1 stripped to the first 7 chars with link and date, or false on failure
+ * @return bool|string wgVersion + HEAD sha1 stripped to the first 7 chars
+ * with link and date, or false on failure
*/
private static function getVersionLinkedGit() {
global $IP, $wgLang;
*/
wfRunHooks( 'SpecialVersionExtensionTypes', array( &$this, &$extensionTypes ) );
- $out = Xml::element( 'h2', array( 'id' => 'mw-version-ext' ), $this->msg( 'version-extensions' )->text() ) .
+ $out = Xml::element(
+ 'h2',
+ array( 'id' => 'mw-version-ext' ),
+ $this->msg( 'version-extensions' )->text()
+ ) .
Xml::openElement( 'table', array( 'class' => 'wikitable plainlinks', 'id' => 'sv-ext' ) );
// Make sure the 'other' type is set to an array.
}
}
- $versionString = Html::rawElement( 'span', array( 'class' => 'mw-version-ext-version' ), $canonicalVersion );
+ $versionString = Html::rawElement(
+ 'span',
+ array( 'class' => 'mw-version-ext-version' ),
+ $canonicalVersion
+ );
+
if ( $vcsVersion ) {
if ( $vcsLink ) {
$vcsVerString = Linker::makeExternalLink(
sort( $list );
}
- return $this->getLanguage()->listToText( array_map( array( __CLASS__, 'arrayToString' ), $list ) );
+ return $this->getLanguage()
+ ->listToText( array_map( array( __CLASS__, 'arrayToString' ), $list ) );
}
}
'dir' => $language->getDir(),
'lang' => $language->getCode()
);
- $out = Html::element( 'h2', array( 'id' => 'mw-version-entrypoints' ), $this->msg( 'version-entrypoints' )->text() ) .
+ $out = Html::element(
+ 'h2',
+ array( 'id' => 'mw-version-entrypoints' ),
+ $this->msg( 'version-entrypoints' )->text()
+ ) .
Html::openElement( 'table',
array(
'class' => 'wikitable plainlinks',
)
) .
Html::openElement( 'tr' ) .
- Html::element( 'th', $thAttribures, $this->msg( 'version-entrypoints-header-entrypoint' )->text() ) .
- Html::element( 'th', $thAttribures, $this->msg( 'version-entrypoints-header-url' )->text() ) .
+ Html::element(
+ 'th',
+ $thAttribures,
+ $this->msg( 'version-entrypoints-header-entrypoint' )->text()
+ ) .
+ Html::element(
+ 'th',
+ $thAttribures,
+ $this->msg( 'version-entrypoints-header-url' )->text()
+ ) .
Html::closeElement( 'tr' );
foreach ( $entryPoints as $message => $value ) {
* @ingroup SpecialPage
*/
class WantedTemplatesPage extends WantedQueryPage {
-
function __construct( $name = 'Wantedtemplates' ) {
parent::__construct( $name );
}
* @ingroup SpecialPage
*/
class SpecialWatchlist extends ChangesListSpecialPage {
- /**
- * Constructor
- */
public function __construct( $page = 'Watchlist', $restriction = 'viewmywatchlist' ) {
parent::__construct( $page, $restriction );
}
// Calculate cutoff
if ( $opts['days'] > 0 ) {
- $conds[] = 'rc_timestamp > ' . $dbr->addQuotes( $dbr->timestamp( time() - intval( $opts['days'] * 86400 ) ) );
+ $conds[] = 'rc_timestamp > ' .
+ $dbr->addQuotes( $dbr->timestamp( time() - intval( $opts['days'] * 86400 ) ) );
}
return $conds;
$label = $this->msg( $value ? 'show' : 'hide' )->escaped();
$options[$name] = 1 - (int)$value;
- return $this->msg( $message )->rawParams( Linker::linkKnown( $this->getPageTitle(), $label, array(), $options ) )->escaped();
+ return $this->msg( $message )
+ ->rawParams( Linker::linkKnown( $this->getPageTitle(), $label, array(), $options ) )
+ ->escaped();
}
protected function hoursLink( $h, $options = array() ) {
protected function daysLink( $d, $options = array() ) {
$options['days'] = $d;
- $message = ( $d ? $this->getLanguage()->formatNum( $d ) : $this->msg( 'watchlistall2' )->escaped() );
+ $message = $d ? $this->getLanguage()->formatNum( $d )
+ : $this->msg( 'watchlistall2' )->escaped();
return Linker::linkKnown(
$this->getPageTitle(),
* @ingroup SpecialPage
*/
class SpecialWhatLinksHere extends IncludableSpecialPage {
-
- /**
- * @var FormOptions
- */
+ /** @var FormOptions */
protected $opts;
protected $selfTitle;
- /**
- * @var Title
- */
+ /** @var Title */
protected $target;
protected $limits = array( 20, 50, 100, 250, 500 );
$out->setPageTitle( $this->msg( 'whatlinkshere-title', $this->target->getPrefixedText() ) );
$out->addBacklinkSubtitle( $this->target );
- $this->showIndirectLinks( 0, $this->target, $opts->getValue( 'limit' ), $opts->getValue( 'from' ), $opts->getValue( 'back' ) );
+ $this->showIndirectLinks(
+ 0,
+ $this->target,
+ $opts->getValue( 'limit' ),
+ $opts->getValue( 'from' ),
+ $opts->getValue( 'back' )
+ );
}
/**
);
}
- if ( ( !$fetchlinks || !$plRes->numRows() ) && ( $hidetrans || !$tlRes->numRows() ) && ( $hideimages || !$ilRes->numRows() ) ) {
+ if ( ( !$fetchlinks || !$plRes->numRows() )
+ && ( $hidetrans || !$tlRes->numRows() )
+ && ( $hideimages || !$ilRes->numRows() )
+ ) {
if ( 0 == $level ) {
if ( !$this->including() ) {
$out->addHTML( $this->whatlinkshereForm() );
}
if ( count( $props ) ) {
- $propsText = $this->msg( 'parentheses' )->rawParams( implode( $msgcache['semicolon-separator'], $props ) )->escaped();
+ $propsText = $this->msg( 'parentheses' )
+ ->rawParams( implode( $msgcache['semicolon-separator'], $props ) )->escaped();
}
# Space for utilities links, with a what-links-here link provided
$wlhLink = $this->wlhLink( $nt, $msgcache['whatlinkshere-links'] );
- $wlh = Xml::wrapClass( $this->msg( 'parentheses' )->rawParams( $wlhLink )->escaped(), 'mw-whatlinkshere-tools' );
+ $wlh = Xml::wrapClass(
+ $this->msg( 'parentheses' )->rawParams( $wlhLink )->escaped(),
+ 'mw-whatlinkshere-tools'
+ );
return $notClose ?
Xml::openElement( 'li' ) . "$link $propsText $dirmark $wlh\n" :
$types[] = 'hideimages';
}
- // Combined message keys: 'whatlinkshere-hideredirs', 'whatlinkshere-hidetrans', 'whatlinkshere-hidelinks', 'whatlinkshere-hideimages'
+ // Combined message keys: 'whatlinkshere-hideredirs', 'whatlinkshere-hidetrans',
+ // 'whatlinkshere-hidelinks', 'whatlinkshere-hideimages'
// To be sure they will be found by grep
foreach ( $types as $type ) {
$chosen = $this->opts->getValue( $type );
$this->makeSelfLink( $msg, array_merge( $changed, $overrides ) ) )->escaped();
}
- return Xml::fieldset( $this->msg( 'whatlinkshere-filters' )->text(), $this->getLanguage()->pipeList( $links ) );
+ return Xml::fieldset(
+ $this->msg( 'whatlinkshere-filters' )->text(),
+ $this->getLanguage()->pipeList( $links )
+ );
}
protected function getGroupName() {
Html::openElement( 'fieldset' ) . "\n" .
Html::element( 'legend', null, $this->msg( 'withoutinterwiki-legend' )->text() ) . "\n" .
Html::hidden( 'title', $t->getPrefixedText() ) . "\n" .
- Xml::inputLabel( $this->msg( 'allpagesprefix' )->text(), 'prefix', 'wiprefix', 20, $prefix ) . "\n" .
+ Xml::inputLabel(
+ $this->msg( 'allpagesprefix' )->text(),
+ 'prefix',
+ 'wiprefix',
+ 20,
+ $prefix
+ ) . "\n" .
Xml::submitButton( $this->msg( 'withoutinterwiki-submit' )->text() ) . "\n" .
Html::closeElement( 'fieldset' ) . "\n" .
Html::closeElement( 'form' );