| @@ 163-169 (lines=7) @@ | ||
| 160 | } |
|
| 161 | } |
|
| 162 | ||
| 163 | if ($this->dx_auth->captcha_registration) { |
|
| 164 | if ($this->dx_auth->use_recaptcha) { |
|
| 165 | $val->set_rules('recaptcha_response_field', lang('Code protection', 'auth'), 'trim|xss_clean|required|callback_captcha_check'); |
|
| 166 | } else { |
|
| 167 | $val->set_rules('captcha', lang('Code protection', 'auth'), 'trim|xss_clean|required|callback_captcha_check'); |
|
| 168 | } |
|
| 169 | } |
|
| 170 | // Run form validation and register user if it's pass the validation |
|
| 171 | $this->load->helper('string'); |
|
| 172 | $key = random_string('alnum', 5); |
|
| @@ 121-127 (lines=7) @@ | ||
| 118 | $val->set_rules('remember', 'Remember me', 'integer'); |
|
| 119 | ||
| 120 | // Set captcha rules if login attempts exceed max attempts in config |
|
| 121 | if ($this->dx_auth->is_max_login_attempts_exceeded()) { |
|
| 122 | if ($this->dx_auth->use_recaptcha) { |
|
| 123 | $val->set_rules('recaptcha_response_field', lang('Code protection', 'auth'), 'trim|xss_clean|required|callback_captcha_check'); |
|
| 124 | } else { |
|
| 125 | $val->set_rules('captcha', lang('Code protection', 'auth'), 'trim|required|xss_clean|callback_captcha_check'); |
|
| 126 | } |
|
| 127 | } |
|
| 128 | ||
| 129 | if ($val->run($this) AND $this->dx_auth->login($val->set_value('email'), $val->set_value('password'), $val->set_value('remember'))) { |
|
| 130 | // Redirect to homepage |
|
| @@ 225-231 (lines=7) @@ | ||
| 222 | } |
|
| 223 | } |
|
| 224 | ||
| 225 | if ($this->dx_auth->captcha_registration) { |
|
| 226 | if ($this->dx_auth->use_recaptcha) { |
|
| 227 | $val->set_rules('recaptcha_response_field', lang('Code protection', 'auth'), 'trim|xss_clean|required|callback_captcha_check'); |
|
| 228 | } else { |
|
| 229 | $val->set_rules('captcha', lang('Code protection', 'auth'), 'trim|xss_clean|required|callback_captcha_check'); |
|
| 230 | } |
|
| 231 | } |
|
| 232 | ||
| 233 | // Run form validation and register user if it's pass the validation |
|
| 234 | $this->load->helper('string'); |
|