Sorry, I haven't been able to get to this yet.

On Monday, August 26, 2013, Ben Edmunds 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');
>
> I'll try to get it done this weekend unless you want to beat me to it with
> a PR? I'd owe you a beer or three.
> -Ben Edmunds On Aug 16, 2013, at 1:53 PM, Dave Hagler <
> notifications@github.com <javascript:_e({}, 'cvml',
> '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'); 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<javascript:_e({}, 'cvml', '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>
> . — Reply to this email directly or view it on GitHub<
> https://github.com/benedmunds/CodeIgniter-Ion-Auth/pull/488/files#r5821535>
> .
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/benedmunds/CodeIgniter-Ion-Auth/pull/488/files#r5985317>
> .
>