Ignore:
Timestamp:
12/28/09 15:59:20 (14 years ago)
Author:
alexandrecorreia
Message:

Ticket #860 - Corrigir quando a autenticacao do jabber nao e pelo campo uid do ldap.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/jabberit_messenger/inc/webservice.php

    r1885 r1900  
    1313class webService 
    1414{ 
     15        private $attribute; 
    1516        private $conn; 
    1617        private $contextLdap; 
     
    2324        private $fileLdapInternal = false; 
    2425        private $fileLdapExternal = false; 
     26        private $version3; 
    2527         
    2628        function __construct() 
     
    4244                        $this->fileLdapInternal = true; 
    4345                } 
     46                 
     47                $this->attribute = "uid"; 
     48                 
     49                if ( file_exists('attributeLdap.php') ) 
     50                { 
     51                        require_once('attributeLdap.php'); 
     52                        $this->attribute = trim($attributeTypeName); 
     53                } 
    4454        } 
    4555         
     
    5464                if( $this->version3 ) 
    5565                        if( !ldap_set_option($this->conn,LDAP_OPT_PROTOCOL_VERSION,3) ) 
    56                                 $this->version = false; 
     66                                $this->version3 = false; 
    5767 
    5868                ldap_set_option($this->conn, LDAP_OPT_REFERRALS, $this->refer); 
     
    179189                                if( $this->conn ) 
    180190                                { 
    181                                         $filter = "(&(phpgwaccounttype=u)(uid=".$uid.")(!(phpgwaccountvisible=-1)))"; 
    182                                         $justthese = array("uid","cn","dn"); 
     191                                        $filter = "(&(phpgwaccounttype=u)(".$this->attribute."=".$uid.")(!(phpgwaccountvisible=-1)))"; 
     192                                        $justthese = array($this->attribute,"cn","dn"); 
    183193                                        $search = ldap_search( $this->conn, $this->contextLdap, $filter,$justthese); 
    184194                                        $get_entries = ldap_get_entries( $this->conn, $search); 
     
    204214                                if( $this->conn ) 
    205215                                { 
    206                                         $filter = "(&(phpgwaccounttype=u)(uid=".$uid.")(!(phpgwaccountvisible=-1)))"; 
    207                                         $justthese = array("uid","cn","dn"); 
     216                                        $filter = "(&(phpgwaccounttype=u)(".$this->attribute."=".$uid.")(!(phpgwaccountvisible=-1)))"; 
     217                                        $justthese = array($this->attribute,"cn","dn"); 
    208218                                        $search = ldap_search( $this->conn, $this->contextLdap, $filter, $justthese); 
    209219                                        $get_entries = ldap_get_entries( $this->conn, $search); 
     
    245255                                if( $this->conn ) 
    246256                                { 
    247                                         $filter                 = "(&(phpgwaccounttype=u)(uid=".$uid.")(!(phpgwaccountvisible=-1)))"; 
    248                                         $justthese              = array("uid","jpegPhoto"); 
     257                                        $filter                 = "(&(phpgwaccounttype=u)(".$this->attribute."=".$uid.")(!(phpgwaccountvisible=-1)))"; 
     258                                        $justthese              = array($this->attribute,"jpegPhoto"); 
    249259                                        $search                 = ldap_search($this->conn,$this->contextLdap,$filter,$justthese); 
    250260                                        $get_entries    = ldap_get_entries($this->conn,$search); 
     
    277287                        if( $this->conn ) 
    278288                        { 
    279                                 $filter                 = "(&(phpgwaccounttype=u)(uid=".$uid.")(!(phpgwaccountvisible=-1)))"; 
    280                                 $justthese              = array("uid","jpegPhoto"); 
     289                                $filter                 = "(&(phpgwaccounttype=u)(".$this->attribute."=".$uid.")(!(phpgwaccountvisible=-1)))"; 
     290                                $justthese              = array($this->attribute,"jpegPhoto"); 
    281291                                $search                 = ldap_search($this->conn,$this->contextLdap,$filter,$justthese); 
    282292                                $get_entries    = ldap_get_entries($this->conn,$search); 
Note: See TracChangeset for help on using the changeset viewer.