Special:UserLogin UI improvements when user is logged in
[lhc/web/wiklou.git] / includes / templates / Userlogin.php
index b9825a6..202ec55 100644 (file)
@@ -39,6 +39,11 @@ class UserloginTemplate extends BaseTemplate {
        ?>
 <div id="userloginForm">
 <form name="userlogin" class="mw-ui-vform" method="post" action="<?php $this->text( 'action' ); ?>">
+       <?php if ( $this->data['loggedin'] ) { ?>
+               <div class="warningbox">
+                       <?php echo $this->getMsg( 'userlogin-loggedin' )->params( $this->data['loggedinuser'] )->parse(); ?>
+               </div>
+       <?php } ?>
        <section class="mw-form-header">
                <?php $this->html( 'header' ); /* extensions such as ConfirmEdit add form HTML here */ ?>
        </section>
@@ -94,7 +99,7 @@ class UserloginTemplate extends BaseTemplate {
                        $this->msg( 'userlogin-yourpassword' );
 
                        if ( $this->data['useemail'] && $this->data['canreset'] && $this->data['resetlink'] === true ) {
-                               echo Linker::link(
+                               echo ' ' . Linker::link(
                                        SpecialPage::getTitleFor( 'PasswordReset' ),
                                        $this->getMsg( 'userlogin-resetpassword-link' )->parse(),
                                        array( 'class' => 'mw-ui-flush-right' )
@@ -151,18 +156,6 @@ class UserloginTemplate extends BaseTemplate {
        <?php } ?>
                </div>
 
-       <?php if ( $this->data['cansecurelogin'] ) { ?>
-               <div>
-                       <label class="mw-ui-checkbox-label">
-                               <input name="wpStickHTTPS" type="checkbox" value="1" id="wpStickHTTPS" tabindex="5"
-                                       <?php if ( $this->data['stickHTTPS'] ) {
-                                               echo 'checked="checked"';
-                                       } ?>
-                               >
-                               <?php $this->msg( 'securelogin-stick-https' ); ?>
-                       </label>
-               </div>
-       <?php } ?>
                <div>
                        <?php
                        echo Html::input( 'wpLoginAttempt', $this->getMsg( 'login' )->text(), 'submit', array(
@@ -176,12 +169,19 @@ class UserloginTemplate extends BaseTemplate {
                        <?php echo $this->getMsg( 'userlogin-helplink' )->parse(); ?>
                </div>
                <?php if ( $this->haveData( 'createOrLoginHref' ) ) { ?>
-                       <div id="mw-createaccount-cta">
-                               <h3 id="mw-userloginlink"><?php $this->msg( 'userlogin-noaccount' ); ?><a href="<?php $this->text( 'createOrLoginHref' ); ?>" id="mw-createaccount-join" tabindex="7"  class="mw-ui-button mw-ui-constructive"><?php $this->msg( 'userlogin-joinproject' ); ?></a></h3>
-                       </div>
+                       <?php if ( $this->data['loggedin'] ) { ?>
+                               <div id="mw-createaccount-another">
+                                       <h3 id="mw-userloginlink"><a href="<?php $this->text( 'createOrLoginHref' ); ?>" id="mw-createaccount-join" tabindex="7"  class="mw-ui-button"><?php $this->msg( 'userlogin-createanother' ); ?></a></h3>
+                               </div>
+                       <?php } else { ?>
+                               <div id="mw-createaccount-cta">
+                                       <h3 id="mw-userloginlink"><?php $this->msg( 'userlogin-noaccount' ); ?><a href="<?php $this->text( 'createOrLoginHref' ); ?>" id="mw-createaccount-join" tabindex="7"  class="mw-ui-button mw-ui-constructive"><?php $this->msg( 'userlogin-joinproject' ); ?></a></h3>
+                               </div>
+                       <?php } ?>
                <?php } ?>
 <?php if ( $this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
 <?php if ( $this->haveData( 'token' ) ) { ?><input type="hidden" name="wpLoginToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?>
+<?php if ( $this->data['cansecurelogin'] ) {?><input type="hidden" name="wpForceHttps" value="<?php $this->text( 'stickhttps' ); ?>" /><?php } ?>
 </form>
 </div>
 </div>