From eedb053d2d83180891ca6c923f6e345cbd035a80 Mon Sep 17 00:00:00 2001 From: Bevin Date: Wed, 13 Jan 2016 09:44:39 +0200 Subject: [PATCH] Updated optional name param to use false instead of string --- application/libraries/Aauth.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/libraries/Aauth.php b/application/libraries/Aauth.php index 0fedf52..fb158f7 100644 --- a/application/libraries/Aauth.php +++ b/application/libraries/Aauth.php @@ -695,7 +695,7 @@ class Aauth { * @param string $name User's name * @return int|bool False if create fails or returns user id if successful */ - public function create_user($email, $pass, $name = 'default') { + public function create_user($email, $pass, $name = FALSE) { $valid = TRUE; @@ -705,7 +705,7 @@ class Aauth { $valid = FALSE; } } - if ($this->user_exist_by_name($name) && $name != 'default') { + if ($this->user_exist_by_name($name) && $name != FALSE) { $this->error($this->CI->lang->line('aauth_error_username_exists')); $valid = FALSE; } @@ -723,7 +723,7 @@ class Aauth { $this->error($this->CI->lang->line('aauth_error_password_invalid')); $valid = FALSE; } - if ($name !='' && !ctype_alnum(str_replace($this->config_vars['valid_chars'], '', $name))){ + if ($name != FALSE && !ctype_alnum(str_replace($this->config_vars['valid_chars'], '', $name))){ $this->error($this->CI->lang->line('aauth_error_username_invalid')); $valid = FALSE; } @@ -734,7 +734,7 @@ class Aauth { $data = array( 'email' => $email, 'pass' => $this->hash_password($pass, 0), // Password cannot be blank but user_id required for salt, setting bad password for now - 'name' => ($name === 'default') ? '' : $name , + 'name' => (!$name) ? '' : $name , ); if ( $this->aauth_db->insert($this->config_vars['users'], $data )){