Revision 343

Date:
2013/05/14 13:06:08
Author:
ahitrov
Revision Log:
Session filled with proper email in use_credentials mode
Files:

Legend:

 
Added
 
Removed
 
Modified
  • utf8/plugins/users/lib/users/SQL/UserProfile.pm

     
    191 191
    192 192 sub _email_filter {
    193 193 my ($self,%opts)=@_;
    194 return undef unless ( exists($opts{email}) );
    195 if (exists $opts{ilike} && $opts{ilike} == 1) {
    196 return &SQL::Common::_generic_name_filter('d.email', $opts{email}, 0, \%opts);
    197 }else{
    198 return &SQL::Common::_generic_text_filter('d.email', $opts{email});
    194 return undef unless ( exists $opts{email} );
    195 if ( $state->{users}->use_credentials ) {
    196 my ($wheres, $values);
    197 my $op = exists $opts{like} ? 'like' : exists $opts{ilike} ? 'ilike' : '=';
    198 $wheres = "d.id IN (SELECT uid FROM profile_credentials WHERE class = 'users::Email' AND name $op ?)";
    199 $values = [$opts{email}];
    200 return $wheres, $values;
    201 } else {
    202 if (exists $opts{ilike} && $opts{ilike} == 1) {
    203 return &SQL::Common::_generic_name_filter('d.email', $opts{email}, 0, \%opts);
    204 } else {
    205 return &SQL::Common::_generic_text_filter('d.email', $opts{email});
    206 }
    199 207 }
    200 208 }
    201 209