MediaWiki  1.23.13
Userlogin.php
Go to the documentation of this file.
1 <?php
25 
26  function execute() {
27  global $wgCookieExpiration;
28  $expirationDays = ceil( $wgCookieExpiration / ( 3600 * 24 ) );
29 ?>
30 <div class="mw-ui-container">
31  <div id="userloginprompt"><?php $this->msgWiki('loginprompt') ?></div>
32  <?php if ( $this->haveData( 'languages' ) ) { ?>
33  <div id="languagelinks">
34  <p><?php $this->html( 'languages' ); ?></p>
35  </div>
36  <?php } ?>
37  <div id="userloginForm">
38  <form name="userlogin" class="mw-ui-vform" method="post" action="<?php $this->text( 'action' ); ?>">
39  <?php if ( $this->data['loggedin'] ) { ?>
40  <div class="warningbox">
41  <?php echo $this->getMsg( 'userlogin-loggedin' )->params( $this->data['loggedinuser'] )->parse(); ?>
42  </div>
43  <?php } ?>
44  <section class="mw-form-header">
45  <?php $this->html( 'header' ); /* extensions such as ConfirmEdit add form HTML here */ ?>
46  </section>
47 
48  <?php if ( $this->data['message'] ) { ?>
49  <div class="<?php $this->text( 'messagetype' ); ?>box">
50  <?php if ( $this->data['messagetype'] == 'error' ) { ?>
51  <strong><?php $this->msg( 'loginerror' ); ?></strong>
52  <br />
53  <?php } ?>
54  <?php $this->html( 'message' ); ?>
55  </div>
56  <?php } ?>
57 
58  <div>
59  <label for='wpName1'>
60  <?php
61  $this->msg( 'userlogin-yourname' );
62 
63  if ( $this->data['secureLoginUrl'] ) {
64  echo Html::element( 'a', array(
65  'href' => $this->data['secureLoginUrl'],
66  'class' => 'mw-ui-flush-right mw-secure',
67  ), $this->getMsg( 'userlogin-signwithsecure' )->text() );
68  }
69  ?>
70  </label>
71  <?php
73  echo Html::input( 'wpName', $this->data['name'], 'text', array(
74  'class' => 'loginText',
75  'id' => 'wpName1',
76  'tabindex' => '1',
77  'size' => '20',
78  // 'required' is blacklisted for now in Html.php due to browser issues.
79  // Keeping here in case that changes.
80  'required' => true,
81  // Set focus to this field if it's blank.
82  'autofocus' => !$this->data['name'],
83  'placeholder' => $this->getMsg( 'userlogin-yourname-ph' )->text()
84  ) );
85  ?>
86  </div>
87 
88  <div>
89  <label for='wpPassword1'>
90  <?php
91  $this->msg( 'userlogin-yourpassword' );
92 
93  if ( $this->data['useemail'] && $this->data['canreset'] && $this->data['resetlink'] === true ) {
94  echo ' ' . Linker::link(
95  SpecialPage::getTitleFor( 'PasswordReset' ),
96  $this->getMsg( 'userlogin-resetpassword-link' )->parse(),
97  array( 'class' => 'mw-ui-flush-right' )
98  );
99  }
100  ?>
101  </label>
102  <?php
103  echo Html::input( 'wpPassword', null, 'password', array(
104  'class' => 'loginPassword',
105  'id' => 'wpPassword1',
106  'tabindex' => '2',
107  'size' => '20',
108  // Set focus to this field if username is filled in.
109  'autofocus' => (bool)$this->data['name'],
110  'placeholder' => $this->getMsg( 'userlogin-yourpassword-ph' )->text()
111  ) );
112  ?>
113  </div>
114 
115  <?php
116  if ( isset( $this->data['usedomain'] ) && $this->data['usedomain'] ) {
117  $select = new XmlSelect( 'wpDomain', false, $this->data['domain'] );
118  $select->setAttribute( 'tabindex', 3 );
119  foreach ( $this->data['domainnames'] as $dom ) {
120  $select->addOption( $dom );
121  }
122  ?>
123  <div id="mw-user-domain-section">
124  <label for='wpDomain'><?php $this->msg( 'yourdomainname' ); ?></label>
125  <?php echo $select->getHTML(); ?>
126  </div>
127  <?php } ?>
128 
129  <?php
130  if ( $this->haveData( 'extrafields' ) ) {
131  echo $this->data['extrafields'];
132  }
133  ?>
134 
135  <div>
136  <?php if ( $this->data['canremember'] ) { ?>
137  <label class="mw-ui-checkbox-label">
138  <input name="wpRemember" type="checkbox" value="1" id="wpRemember" tabindex="4"
139  <?php if ( $this->data['remember'] ) {
140  echo 'checked="checked"';
141  } ?>
142  >
143  <?php echo $this->getMsg( 'userlogin-remembermypassword' )->numParams( $expirationDays )->escaped(); ?>
144  </label>
145  <?php } ?>
146  </div>
147 
148  <div>
149  <?php
150  echo Html::input( 'wpLoginAttempt', $this->getMsg( 'pt-login-button' )->text(), 'submit', array(
151  'id' => 'wpLoginAttempt',
152  'tabindex' => '6',
153  'class' => 'mw-ui-button mw-ui-big mw-ui-block mw-ui-constructive'
154  ) );
155  ?>
156  </div>
157  <div id="mw-userlogin-help">
158  <?php
159  echo Html::element(
160  'a',
161  array(
163  wfMessage( 'helplogin-url' )->inContentLanguage()->text()
164  ),
165  ),
166  $this->getMsg( 'userlogin-helplink2' )->text()
167  );
168  ?>
169  </div>
170  <?php if ( $this->haveData( 'createOrLoginHref' ) ) { ?>
171  <?php if ( $this->data['loggedin'] ) { ?>
172  <div id="mw-createaccount-another">
173  <a href="<?php $this->text( 'createOrLoginHref' ); ?>" id="mw-createaccount-join" tabindex="7" class="mw-ui-button"><?php $this->msg( 'userlogin-createanother' ); ?></a>
174  </div>
175  <?php } else { ?>
176  <div id="mw-createaccount-cta">
177  <?php $this->msg( 'userlogin-noaccount' ); ?><a href="<?php $this->text( 'createOrLoginHref' ); ?>" id="mw-createaccount-join" tabindex="7" class="mw-ui-button mw-ui-progressive"><?php $this->msg( 'userlogin-joinproject' ); ?></a>
178  </div>
179  <?php } ?>
180  <?php } ?>
181  <?php if ( $this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
182  <?php if ( $this->haveData( 'token' ) ) { ?><input type="hidden" name="wpLoginToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?>
183  <?php if ( $this->data['cansecurelogin'] ) {?><input type="hidden" name="wpForceHttps" value="<?php $this->text( 'stickhttps' ); ?>" /><?php } ?>
184  </form>
185  </div>
186 </div>
187 <?php
188 
189  }
190 }
BaseTemplate\msg
msg( $str)
Definition: SkinTemplate.php:1524
BaseTemplate\msgWiki
msgWiki( $str)
An ugly, ugly hack.
Definition: SkinTemplate.php:1532
data
and how to run hooks for an and one after Each event has a preferably in CamelCase For ArticleDelete hook A clump of code and data that should be run when an event happens This can be either a function and a chunk of data
Definition: hooks.txt:6
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
SpecialPage\getTitleFor
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name.
Definition: SpecialPage.php:74
XmlSelect
Definition: Xml.php:844
Linker\link
static link( $target, $html=null, $customAttribs=array(), $query=array(), $options=array())
This function returns an HTML link to the given target.
Definition: Linker.php:192
Html\element
static element( $element, $attribs=array(), $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
Definition: Html.php:148
wfMessage
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form externallinks including delete and has completed for all link tables default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "&lt
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
form
null means default in associative array form
Definition: hooks.txt:1530
UserloginTemplate\execute
execute()
Main function, used by classes that subclass QuickTemplate to show the actual HTML output.
Definition: Userlogin.php:26
Html\input
static input( $name, $value='', $type='text', $attribs=array())
Convenience function to produce an "<input>" element.
Definition: Html.php:648
QuickTemplate\text
text( $str)
Definition: SkinTemplate.php:1429
action
action
Definition: parserTests.txt:378
BaseTemplate\getMsg
getMsg( $name)
Get a Message object with its context set.
Definition: SkinTemplate.php:1520
UserloginTemplate\$extraAttrs
if( $this->data['secureLoginUrl']) $extraAttrs
Definition: Userlogin.php:72
QuickTemplate\haveData
haveData( $str)
Definition: SkinTemplate.php:1469
type
This document describes the state of Postgres support in and is fairly well maintained The main code is very well while extensions are very hit and miss it is probably the most supported database after MySQL Much of the work in making MediaWiki database agnostic came about through the work of creating Postgres as and are nearing end of but without copying over all the usage comments General notes on the but these can almost always be programmed around *Although Postgres has a true BOOLEAN type
Definition: postgres.txt:22
UserloginTemplate
Definition: Userlogin.php:24
QuickTemplate\html
html( $str)
Definition: SkinTemplate.php:1436
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
name
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at name
Definition: design.txt:12
href
shown</td >< td > a href
Definition: All_system_messages.txt:2674
section
section
Definition: parserTests.txt:378
BaseTemplate
New base template for a skin's template extended from QuickTemplate this class features helper method...
Definition: SkinTemplate.php:1512
Skin\makeInternalOrExternalUrl
static makeInternalOrExternalUrl( $name)
If url string starts with http, consider as external URL, else internal.
Definition: Skin.php:1158