Skip to content

Commit

Permalink
Dev: forgot password design
Browse files Browse the repository at this point in the history
  • Loading branch information
louis committed Sep 25, 2015
1 parent 7c50ff1 commit 74dc4fc
Show file tree
Hide file tree
Showing 3 changed files with 240 additions and 153 deletions.
77 changes: 61 additions & 16 deletions application/views/admin/authentication/forgotpassword.php
@@ -1,17 +1,62 @@
<div class='header'><?php eT('Recover your password'); ?></div>
<p><?php eT('To receive a new password by email you have to enter your user name and original email address.'); ?>
</p>
<p>&nbsp;</p>
<?php echo CHtml::form(array("admin/authentication/sa/forgotpassword"), 'post', array('class'=>'form44','id'=>'forgotpassword','name'=>'forgotpassword'));?>
<?php
/**
* Forgot your password
*/
?>
<div class="container-fluid welcome">
<div class="row text-center">
<div class="col-lg-3 col-lg-offset-4 col-sm-6 col-sm-offset-3">
<div class="panel panel-primary login-pannel" id="pannel-1">

<!-- Header -->
<div class="panel-body">
<div class="row">
<div class="col-lg-12">
<img id="profile-img" class="profile-img-card img-responsive center-block" src="<?php echo Yii::app()->getBaseUrl(true);?>/images/Limesurvey_logo.png" />
<p>Dashboard</p>
</div>
</div>
</div>

<!-- Action Name -->
<div class="row login-title login-content">
<div class="col-lg-12">
<h3><?php eT('Recover your password'); ?></h3>
</div>
</div>

<!-- Form -->
<?php echo CHtml::form(array("admin/authentication/sa/forgotpassword"), 'post', array('id'=>'forgotpassword','name'=>'forgotpassword'));?>
<div class="row login-content login-content-form">
<div class="col-lg-12">
<div class="alert alert-info" role="alert">
<?php eT('To receive a new password by email you have to enter your user name and original email address.'); ?>
</div>
<span>
<label for="user"><?php eT('User name'); ?></label>
<input name="user" id="user" type="text" size="40" maxlength="40" class="form-control" value="" />
</span>
<span>
<label for="email"><?php eT('Email'); ?>

</label><input name="email" id="email" type="email" size="40" maxlength="40" class="form-control" value="" />
</span>

<ul>
<li><label for="user"><?php eT('User name'); ?></label><input name="user" id="user" type="text" size="60" maxlength="60" value="" /></li>
<li><label for="email"><?php eT('Email'); ?></label><input name="email" id="email" type="email" size="60" maxlength="60" value="" /></li>
</ul>
<p>
<input type="hidden" name="action" value="forgotpass" />
<input class="action" type="submit" value="<?php eT('Check data'); ?>" />
</p>
<p><a href="<?php echo $this->createUrl("/admin"); ?>"><?php eT('Main Admin Screen'); ?></a></p>
</form>
<p>&nbsp;</p>
</div>
</div>

<!-- Buttons -->
<div class="row login-submit login-content">
<div class="col-lg-12">
<input type="hidden" name="action" value="forgotpass" />
<input class="action btn btn-default" type="submit" value="<?php eT('Check data'); ?>" />
<br/><br/>
<a href="<?php echo $this->createUrl("/admin"); ?>"><?php eT('Main Admin Screen'); ?></a>
</div>

</div>
<?php echo CHtml::endForm(); ?>
</div>
</div>
</div>
</div>
268 changes: 135 additions & 133 deletions application/views/admin/authentication/login.php
@@ -1,140 +1,142 @@
<?php
/**
* Login Form
*/
?>
<div class="container-fluid welcome">
<div class="row text-center">
<div class="col-lg-3 col-lg-offset-4 col-sm-6 col-sm-offset-3">
<div class="panel panel-primary login-pannel" id="pannel-1">
<div class="panel-body">
<div class="row">
<div class="col-lg-12">
<img id="profile-img" class="profile-img-card img-responsive center-block" src="<?php echo Yii::app()->getBaseUrl(true);?>/images/Limesurvey_logo.png" />
<p>Dashboard</p>
</div>
</div>

</div>
<div class="row login-title login-content">
<div class="col-lg-12">
<h3><?php eT("Log In");?></h3>
</div>
</div>
<div class="row login-content login-content-form">
<div class="col-lg-12">

<?php echo CHtml::form(array('admin/authentication/sa/login'), 'post', array('id'=>'loginform', 'name'=>'loginform'));?>

<?php
$pluginNames = array_keys($pluginContent);
if (!isset($defaultAuth))
{
// Make sure we have a default auth, if not set, use the first one we find
$defaultAuth = reset($pluginNames);
}

if (count($pluginContent)>1)
{
$selectedAuth = App()->getRequest()->getParam('authMethod', $defaultAuth);
if (!in_array($selectedAuth, $pluginNames))
{
$selectedAuth = $defaultAuth;
}
?>
<label for='authMethod'><?php eT("Authentication method"); ?></label>
<?php
$possibleAuthMethods = array();
foreach($pluginNames as $plugin)
{
$info = App()->getPluginManager()->getPluginInfo($plugin);
$possibleAuthMethods[$plugin] = $info['pluginName'];
}
$this->widget('yiiwheels.widgets.select2.WhSelect2', array(

'name' => 'authMethod',
'pluginOptions' => array(
'value' => $selectedAuth,
'data' => $possibleAuthMethods,
'options' => array(
'onChange'=>'this.form.submit();'
)
)));


}
else
{
echo CHtml::hiddenField('authMethod', $defaultAuth);
$selectedAuth = $defaultAuth;
}
?>

<?php
if (isset($pluginContent[$selectedAuth])) {
$blockData = $pluginContent[$selectedAuth];
/* @var $blockData PluginEventContent */
echo $blockData->getContent();
}

$languageData = array(
'default' => gT('Default')
);
foreach (getLanguageDataRestricted(true) as $sLangKey => $aLanguage)
{
$languageData[$sLangKey] = html_entity_decode($aLanguage['nativedescription'], ENT_NOQUOTES, 'UTF-8') . " - " . $aLanguage['description'];
}
echo CHtml::label(gT('Language'), 'loginlang');

//$this->widget('bootstrap.widgets.TbSelect2', array(

$this->widget('yiiwheels.widgets.select2.WhSelect2', array(

'name' => 'loginlang',
'data' => $languageData,
'pluginOptions' => array(
'options' => array(
'width' => '230px'
),
'htmlOptions' => array(
'id' => 'loginlang'
),
'value' => 'default'
)));
?>

<?php if (Yii::app()->getConfig("demoMode") === true && Yii::app()->getConfig("demoModePrefill") === true)
{ ?>
<p><?php eT("Demo mode: Login credentials are prefilled - just click the Login button."); ?></p>
<?php } ?>

</div>
</div>
<div class="row login-submit login-content">
<div class="col-lg-12">
<p><input type='hidden' name='action' value='login' />
<button type="submit" class="btn btn-default" name='login_submit' value='<?php eT("Login"); ?>' >Submit</button><br />
<br/>
<?php
if (Yii::app()->getConfig("display_user_password_in_email") === true)
{
?>
<a href='<?php echo $this->createUrl("admin/authentication/sa/forgotpassword"); ?>'><?php eT("Forgot your password?"); ?></a><br />
<?php
}
?>
</p>
<div class="col-lg-3 col-lg-offset-4 col-sm-6 col-sm-offset-3">
<div class="panel panel-primary login-pannel" id="pannel-1">

<!-- Header -->
<div class="panel-body">
<div class="row">
<div class="col-lg-12">
<img id="profile-img" class="profile-img-card img-responsive center-block" src="<?php echo Yii::app()->getBaseUrl(true);?>/images/Limesurvey_logo.png" />
<p>Dashboard</p>
</div>
</div>

</div>
<?php echo CHtml::endForm(); ?>
</div>


</div>
</div>

</div>
</div>

<!-- Action Name -->
<div class="row login-title login-content">
<div class="col-lg-12">
<h3><?php eT("Log In");?></h3>
</div>
</div>

<!-- Form -->
<?php echo CHtml::form(array('admin/authentication/sa/login'), 'post', array('id'=>'loginform', 'name'=>'loginform'));?>
<div class="row login-content login-content-form">
<div class="col-lg-12">
<?php
$pluginNames = array_keys($pluginContent);
if (!isset($defaultAuth))
{
// Make sure we have a default auth, if not set, use the first one we find
$defaultAuth = reset($pluginNames);
}

if (count($pluginContent)>1)
{
$selectedAuth = App()->getRequest()->getParam('authMethod', $defaultAuth);
if (!in_array($selectedAuth, $pluginNames))
{
$selectedAuth = $defaultAuth;
}
?>

<label for='authMethod'><?php eT("Authentication method"); ?></label>
<?php
$possibleAuthMethods = array();
foreach($pluginNames as $plugin)
{
$info = App()->getPluginManager()->getPluginInfo($plugin);
$possibleAuthMethods[$plugin] = $info['pluginName'];
}
$this->widget('yiiwheels.widgets.select2.WhSelect2', array(

'name' => 'authMethod',
'pluginOptions' => array(
'value' => $selectedAuth,
'data' => $possibleAuthMethods,
'options' => array(
'onChange'=>'this.form.submit();'
)
)));


}
else
{
echo CHtml::hiddenField('authMethod', $defaultAuth);
$selectedAuth = $defaultAuth;
}
if (isset($pluginContent[$selectedAuth]))
{
$blockData = $pluginContent[$selectedAuth];
/* @var $blockData PluginEventContent */
echo $blockData->getContent();
}

$languageData = array(
'default' => gT('Default')
);
foreach (getLanguageDataRestricted(true) as $sLangKey => $aLanguage)
{
$languageData[$sLangKey] = html_entity_decode($aLanguage['nativedescription'], ENT_NOQUOTES, 'UTF-8') . " - " . $aLanguage['description'];
}
echo CHtml::label(gT('Language'), 'loginlang');

//$this->widget('bootstrap.widgets.TbSelect2', array(

$this->widget('yiiwheels.widgets.select2.WhSelect2', array(
'name' => 'loginlang',
'data' => $languageData,
'pluginOptions' => array(
'options' => array(
'width' => '230px'
),
'htmlOptions' => array(
'id' => 'loginlang'
),
'value' => 'default'
)));
?>

<?php if (Yii::app()->getConfig("demoMode") === true && Yii::app()->getConfig("demoModePrefill") === true)
{ ?>
<p><?php eT("Demo mode: Login credentials are prefilled - just click the Login button."); ?></p>
<?php
} ?>
</div>
</div>

<!-- Buttons -->
<div class="row login-submit login-content">
<div class="col-lg-12">
<p><input type='hidden' name='action' value='login' />
<button type="submit" class="btn btn-default" name='login_submit' value='<?php eT("Login"); ?>' >Submit</button><br />
<br/>
<?php
if (Yii::app()->getConfig("display_user_password_in_email") === true)
{
?>
<a href='<?php echo $this->createUrl("admin/authentication/sa/forgotpassword"); ?>'><?php eT("Forgot your password?"); ?></a><br />
<?php
}
?>
</p>
</div>

</div>
<?php echo CHtml::endForm(); ?>
</div>
</div>
</div>
</div>





<!-- Set focus on user input -->
<script type='text/javascript'>
document.getElementById('user').focus();
</script>

0 comments on commit 74dc4fc

Please sign in to comment.