From 515945b11a075b96004cd4205972b4579042d606 Mon Sep 17 00:00:00 2001 From: Raphael Jackstadt Date: Fri, 5 Jun 2015 04:54:28 +0200 Subject: [PATCH 1/3] fixed issue #42 --- application/libraries/Aauth.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/application/libraries/Aauth.php b/application/libraries/Aauth.php index 4e47312..34aaa1d 100644 --- a/application/libraries/Aauth.php +++ b/application/libraries/Aauth.php @@ -1105,16 +1105,19 @@ class Aauth { $group_id = $this->get_group_id($group_par); - $this->aauth_db->where('id',$group_id); - $query = $this->aauth_db->get($this->config_vars['groups']); - if ($query->num_rows() == 0){ - return FALSE; - } + $this->aauth_db->where('id',$group_id); + $query = $this->aauth_db->get($this->config_vars['groups']); + if ($query->num_rows() == 0){ + return FALSE; + } // bug fixed // now users are deleted from user_to_group table $this->aauth_db->where('group_id', $group_id); $this->aauth_db->delete($this->config_vars['user_to_group']); + + $this->aauth_db->where('group_id', $group_id); + $this->aauth_db->delete($this->config_vars['perm_to_group']); $this->aauth_db->where('id', $group_id); return $this->aauth_db->delete($this->config_vars['groups']); @@ -1334,7 +1337,7 @@ class Aauth { // deletes from perm_to_user table $this->aauth_db->where('perm_id', $perm_id); - $this->aauth_db->delete($this->config_vars['perm_to_group']); + $this->aauth_db->delete($this->config_vars['perm_to_user']); // deletes from permission table $this->aauth_db->where('id', $perm_id); From 43f0d83fac23e19ececed9e7ba76da9f4c9d50b7 Mon Sep 17 00:00:00 2001 From: Raphael Jackstadt Date: Mon, 8 Jun 2015 00:59:27 +0200 Subject: [PATCH 2/3] added 'min' password length like 'max' --- application/config/aauth.php | 4 +++- application/libraries/Aauth.php | 9 +++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/application/config/aauth.php b/application/config/aauth.php index c1061be..4e6cb40 100644 --- a/application/config/aauth.php +++ b/application/config/aauth.php @@ -42,8 +42,10 @@ $config['aauth']['user_variables'] = 'aauth_user_variables'; // remember time $config['aauth']['remember'] = ' +3 days'; -// pasword maximum char long (min is 4) +// pasword maximum char long $config['aauth']['max'] = 13; +// pasword minimum char long +$config['aauth']['min'] = 5; // non alphanumeric characters that are allowed in a name $config['aauth']['valid_chars'] = array(' ', '\''); diff --git a/application/libraries/Aauth.php b/application/libraries/Aauth.php index 34aaa1d..02fffc1 100644 --- a/application/libraries/Aauth.php +++ b/application/libraries/Aauth.php @@ -142,14 +142,15 @@ class Aauth { $this->CI->input->set_cookie($cookie); if( $this->config_vars['login_with_name'] == TRUE){ - if( !$identifier OR strlen($pass) < 5 OR strlen($pass) > $this->config_vars['max'] ) + + if( !$identifier OR strlen($pass) < $this->config_vars['min'] OR strlen($pass) > $this->config_vars['max'] ) { $this->error($this->CI->lang->line('aauth_error_login_failed_name')); return FALSE; } $db_identifier = 'name'; }else{ - if( !valid_email($identifier) OR strlen($pass) < 5 OR strlen($pass) > $this->config_vars['max'] ) + if( !valid_email($identifier) OR strlen($pass) < $this->config_vars['min'] OR strlen($pass) > $this->config_vars['max'] ) { $this->error($this->CI->lang->line('aauth_error_login_failed_email')); return FALSE; @@ -615,7 +616,7 @@ class Aauth { $this->error($this->CI->lang->line('aauth_error_email_invalid')); $valid = FALSE; } - if ( strlen($pass) < 5 OR strlen($pass) > $this->config_vars['max'] ){ + if ( strlen($pass) < $this->config_vars['min'] OR strlen($pass) > $this->config_vars['max'] ){ $this->error($this->CI->lang->line('aauth_error_password_invalid')); $valid = FALSE; } @@ -692,7 +693,7 @@ class Aauth { } if ($pass != FALSE) { - if ( strlen($pass) < 5 OR strlen($pass) > $this->config_vars['max'] ){ + if ( strlen($pass) < $this->config_vars['min'] OR strlen($pass) > $this->config_vars['max'] ){ $this->error($this->CI->lang->line('aauth_error_password_invalid')); $valid = FALSE; } From 35a9232e3ec17234e9fb9806375bb29fe21fea62 Mon Sep 17 00:00:00 2001 From: Raphael Jackstadt Date: Thu, 11 Jun 2015 12:49:29 +0200 Subject: [PATCH 3/3] added a fix for #46 --- application/libraries/Aauth.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/application/libraries/Aauth.php b/application/libraries/Aauth.php index 02fffc1..8ad3538 100644 --- a/application/libraries/Aauth.php +++ b/application/libraries/Aauth.php @@ -678,6 +678,8 @@ class Aauth { */ public function update_user($user_id, $email = FALSE, $pass = FALSE, $name = FALSE) { + $valid = TRUE; + $data = array(); if ($email != FALSE) {