Ignore:
Timestamp:
08/05/11 14:33:32 (13 years ago)
Author:
rafaelraymundo
Message:

Ticket #2186 - Pesquisa rápida de contatos com aspas

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.3/expressoMail1_2/inc/class.ldap_functions.inc.php

    r3909 r4906  
    8484                $functions = new functions; 
    8585 
     86//              $search_for     = utf8_encode($params['search_for']); 
     87  //Testa se a busca foi realizada com aspas 
    8688                $search_for     = utf8_encode($params['search_for']); 
     89                $search_len = (strlen($search_for)) - 1; 
     90                $quote_status=false; 
     91 
     92                if((($search_for{0}) == "\"") && (($search_for{$search_len}) == "\"")){ 
     93                    $search_for{0} = " "; 
     94                    $search_for{$search_len} = " "; 
     95                    $quote_status=true; 
     96                } 
     97 
     98 
     99 
    87100                $field          = $params['field']; 
    88101                $ID                     = $params['ID']; 
     
    133146                        else 
    134147                        { 
    135                                 $filter="(& (phpgwAccountType=u)(cn=*$search_for*) (!(phpgwaccountvisible=-1)) )"; 
     148                                if($quote_status){ 
     149                                        $filter="(& (phpgwAccountType=u) (|(cn=* $search_for *)(cn=$search_for *)(cn=* $search_for)) (!(phpgwaccountvisible=-1)) )"; 
     150                                } 
     151                                else{ 
     152                                        $filter="(& (phpgwAccountType=u)(cn=*$search_for*) (!(phpgwaccountvisible=-1)) )"; 
     153                                } 
     154                        //      $filter="(& (phpgwAccountType=u)(cn=*$search_for*) (!(phpgwaccountvisible=-1)) )"; 
    136155                                if($extendedinfo) 
    137156                                $justthese = array("cn", "mail", "telephoneNumber", "mobile", "phpgwAccountVisible","jpegPhoto", "uid", "employeeNumber", "ou"); 
Note: See TracChangeset for help on using the changeset viewer.