Browse Source

Merge pull request #4 from killfall/name_allowed_chars

Remove allowed characters from name before alphanumeric test
develop
Emre Akay 11 years ago
parent
commit
699d729822
  1. 3
      application/config/aauth.php
  2. 2
      application/libraries/Aauth.php

3
application/config/aauth.php

@ -43,6 +43,9 @@ $config['aauth'] = array(
// pasword maximum char long (min is 4) // pasword maximum char long (min is 4)
'max' => 13, 'max' => 13,
// non alphanumeric characters that are allowed in a name
'valid_chars' => array(' ', '\''),
// it limits login attempts // it limits login attempts
'dos_protection' => true, 'dos_protection' => true,

2
application/libraries/Aauth.php

@ -308,7 +308,7 @@ class Aauth {
$this->error($this->config_vars['pass_invalid']); $this->error($this->config_vars['pass_invalid']);
$valid = false; $valid = false;
} }
if ($name !='' and !ctype_alnum($name)){ if ($name !='' and !ctype_alnum(str_replace($this->config_vars['valid_chars'], '', $name))){
$this->error($this->config_vars['name_invalid']); $this->error($this->config_vars['name_invalid']);
$valid = false; $valid = false;
} }

Loading…
Cancel
Save