Skip to content

Commit

Permalink
Stop using max_password_length config option
Browse files Browse the repository at this point in the history
Ion Auth 3 has deprecated the `max_password_length` config option (and
rightfylly so). Remove any references to it in our code. This fixes an
issue where password could not be changed or reset because they had to
be shorter than a `max_password_length` value that was not set.

Resolves #115
  • Loading branch information
notartom committed Apr 10, 2021
1 parent dbd5e1a commit f3bc85f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions application/controllers/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function logout()
function change_password()
{
$this->form_validation->set_rules('old', 'Old password', 'required');
$this->form_validation->set_rules('new', 'New Password', 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[new_confirm]');
$this->form_validation->set_rules('new', 'New Password', 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|matches[new_confirm]');
$this->form_validation->set_rules('new_confirm', 'Confirm New Password', 'required');

if (!$this->ion_auth->logged_in())
Expand Down Expand Up @@ -248,7 +248,7 @@ public function reset_password($code = NULL)
if ($user)
{ //if the code is valid then display the password reset form

$this->form_validation->set_rules('new', 'New Password', 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[new_confirm]');
$this->form_validation->set_rules('new', 'New Password', 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|matches[new_confirm]');
$this->form_validation->set_rules('new_confirm', 'Confirm New Password', 'required');

if ($this->form_validation->run() == false)
Expand Down Expand Up @@ -400,7 +400,7 @@ function create_user()
$this->form_validation->set_rules('phone2', 'Second Part of Phone', 'required|xss_clean|min_length[3]|max_length[3]');
$this->form_validation->set_rules('phone3', 'Third Part of Phone', 'required|xss_clean|min_length[4]|max_length[4]');
$this->form_validation->set_rules('company', 'Company Name', 'required|xss_clean');
$this->form_validation->set_rules('password', 'Password', 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]');
$this->form_validation->set_rules('password', 'Password', 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|matches[password_confirm]');
$this->form_validation->set_rules('password_confirm', 'Password Confirmation', 'required');

if ($this->form_validation->run() == true)
Expand Down

0 comments on commit f3bc85f

Please sign in to comment.