Skip to content

Commit

Permalink
Merge pull request #168 from cjsaylor/2.4.1
Browse files Browse the repository at this point in the history
2.4.1
  • Loading branch information
cjsaylor committed Jan 5, 2014
2 parents 75a4007 + 8386ac3 commit 62c54f2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 20 deletions.
1 change: 0 additions & 1 deletion app/Config/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
CakePlugin::load('GChart');
CakePlugin::load('Utility');
CakePlugin::load('Feedback');
CakePlugin::load('DebugKit');

// Features
// Site Theme
Expand Down
3 changes: 2 additions & 1 deletion app/Controller/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public function beforeFilter() {
$requires_auth = array(
'account',
'reset_password',
'auth'
);
if(in_array($this->request->action, $requires_auth)) {
$this->_secure = true;
Expand Down Expand Up @@ -174,7 +175,7 @@ public function reset_password() {
if($this->User->verifyRecoveryKey($this->Auth->user('id'), $this->request->data['User']['recovery_key'])) {
$this->request->data['User']['id'] = $this->Auth->user('id');
$this->request->data['User']['reset_password'] = '0';
$this->request->data['User']['password'] = $this->User->hashPassword($this->request->data['User']['password']);
$this->request->data['User']['password'] = $this->request->data['User']['password'];
$result = $this->User->save($this->request->data);
if($result) {
$this->Session->setFlash(__('Successfully reset password.'), 'notification/success');
Expand Down
28 changes: 15 additions & 13 deletions app/View/Users/reset_password.ctp
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<?php
echo $this->Html->script('jquery.showpassword', array('inline' => false));
echo $this->Html->script('views/users/reset_password', array('inline' => false));
?>
<h2><?php echo __('Reset Password'); ?></h2>
<?php
echo $this->Form->create('User', array('action' => 'reset_password'));
echo $this->Form->input('recovery_key', array('label' => __('Enter the recovery key provided by email'), 'style' => 'width: 250px'));
echo $this->Form->input('password', array('label' => __('Enter a new password for your account')));
echo '<br/>';
echo $this->Form->submit(__('Reset Password'), array('class' => 'large green button'));
echo $this->Form->end();
?>
<div class="container">
<div class="row">
<div class="col-lg-4 col-md-offset-4">
<h2><?php echo __('Reset Password'); ?></h2>
<?php
echo $this->Form->create('User', array('action' => 'reset_password'));
echo $this->Form->input('recovery_key', array('label' => __('Enter the recovery key provided by email'), 'class' => 'form-control input-lg'));
echo $this->Form->input('password', array('label' => __('Enter a new password for your account'), 'class' => 'form-control input-lg'));
?>
<br>
<button type="submit" class="btn btn-lg btn-default btn-block"><?php echo __('Reset Password') ?></button>
<?php echo $this->Form->end(); ?>
</div>
</div>
</div>
5 changes: 0 additions & 5 deletions app/webroot/js/views/users/reset_password.js

This file was deleted.

0 comments on commit 62c54f2

Please sign in to comment.