Merge branch 'CC-3174' into devel

This commit is contained in:
Naomi Aro 2012-04-20 16:19:29 +02:00
commit ed812159c2
5 changed files with 27 additions and 3 deletions

View File

@ -115,7 +115,7 @@ class LoginController extends Zend_Controller_Action
$auth = new Application_Model_Auth(); $auth = new Application_Model_Auth();
$auth->sendPasswordRestoreLink($user, $this->view); $auth->sendPasswordRestoreLink($user, $this->view);
$this->_helper->redirector('password-restore-after', 'auth'); $this->_helper->redirector('password-restore-after', 'login');
} }
else { else {
$form->email->addError($this->view->translate("Given email not found.")); $form->email->addError($this->view->translate("Given email not found."));
@ -146,7 +146,7 @@ class LoginController extends Zend_Controller_Action
//check validity of token //check validity of token
if (!$auth->checkToken($user_id, $token, 'password.restore')) { if (!$auth->checkToken($user_id, $token, 'password.restore')) {
echo "token not valid"; Logging::debug("token not valid");
$this->_helper->redirector('index', 'login'); $this->_helper->redirector('index', 'login');
} }

View File

@ -16,6 +16,8 @@ class Application_Model_Auth {
$info->setDbCreated(gmdate('Y-m-d H:i:s')); $info->setDbCreated(gmdate('Y-m-d H:i:s'));
$info->save(); $info->save();
Logging::debug("generated token {$token}");
return $token; return $token;
} }

View File

@ -8,6 +8,14 @@
<dd id="new-password-element"> <dd id="new-password-element">
<?php echo $this->element->getElement('password') ?> <?php echo $this->element->getElement('password') ?>
</dd> </dd>
<?php if($this->element->getElement('password')->hasErrors()): ?>
<ul class='errors'>
<?php foreach($this->element->getElement('password')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<dt id="confirm-password-label"> <dt id="confirm-password-label">
<label for="confirm-password" class="required"> <label for="confirm-password" class="required">
<?php echo $this->element->getElement('password_confirm')->getLabel() ?> <?php echo $this->element->getElement('password_confirm')->getLabel() ?>
@ -16,6 +24,13 @@
<dd id="confirm-password-element"> <dd id="confirm-password-element">
<?php echo $this->element->getElement('password_confirm') ?> <?php echo $this->element->getElement('password_confirm') ?>
</dd> </dd>
<?php if($this->element->getElement('password_confirm')->hasErrors()): ?>
<ul class='errors'>
<?php foreach($this->element->getElement('password_confirm')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<dt id="submit-label">&nbsp;</dt> <dt id="submit-label">&nbsp;</dt>
<dd id="submit-element"> <dd id="submit-element">

View File

@ -8,6 +8,13 @@
<dd id="username-element"> <dd id="username-element">
<?php echo $this->element->getElement('email') ?> <?php echo $this->element->getElement('email') ?>
</dd> </dd>
<?php if($this->element->getElement('email')->hasErrors()): ?>
<ul class='errors'>
<?php foreach($this->element->getElement('email')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<dt id="submit-label">&nbsp;</dt> <dt id="submit-label">&nbsp;</dt>

View File

@ -3,6 +3,6 @@
<h2>Email sent</h2> <h2>Email sent</h2>
<div id="login" class="login-content clearfix"> <div id="login" class="login-content clearfix">
<p class="light">An email has been sent to <?php $this->form->email->getValue() ?></p> <p class="light">An email has been sent</p>
</div> </div>
</div> </div>