Yes, much cleaner.  Would also need to lowercase in update function I think.


On Fri, Aug 16, 2013 at 2:14 PM, Ben Edmunds <notifications@github.com>wrote:

> In controllers/auth.php:
>
> > @@ -208,8 +208,23 @@ function forgot_password()
> >  		else
> >  		{
> >  			// get identity for that email
> > -			$config_tables = $this->config->item('tables', 'ion_auth');
> > -			$identity = $this->db->where('email', $this->input->post('email'))->limit('1')->get($config_tables['users'])->row();
> > +			if ($this->config->item('use_mongodb', 'ion_auth')) {
> > +				$email = new MongoRegex('/^'.$this->input->post('email').'$/i');
>
> Ah ok. I really don't like doing any direct db work in the controller.
> What do you think about changing both of those (mongo and relational db) to
> just using something like this:
>
> $identity = $this->ion_auth->where('email',
> strtolower($this->input->post('email')))->users()->row();
>
> and then we will need to lowercase the emails on registration. I'm not
> sure if I care that much about casing for the example though. Thoughts?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/benedmunds/CodeIgniter-Ion-Auth/pull/488/files#r5820529>
> .
>