1
tcendros
CONNECT WITH TWO ACTIVE DIRECTORY SERVERS
  • 2009/6/11 13:37

  • tcendros

  • Just popping in

  • Posts: 15

  • Since: 2008/10/10


I have a XOOPS with authentication mode Active Directory working fine, but I would like that the peapole can login from two difrents domains to my xoops.
My question is: Is possble config the XOOPS for authentication to 2 domains of active directory?
Thanks.

2
jorbars
Re: CONNECT WITH TWO ACTIVE DIRECTORY SERVERS
  • 2009/6/12 7:10

  • jorbars

  • Just popping in

  • Posts: 4

  • Since: 2009/6/12


I have also the same problem... I don't know how XOOPS can authenticate to two different Active Directory... It's impossible that two accounts uses the same username, so don't worry about that...
Any ideas???

3
ghia
Re: CONNECT WITH TWO ACTIVE DIRECTORY SERVERS
  • 2009/6/12 7:47

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


I have no experience at all with this, but:
Is the active domain controller not responsible to resolve that?
Did you try to add the domain as prefix to the username as in eg dom1\user1 dom2\user2 ?

4
tcendros
Re: CONNECT WITH TWO ACTIVE DIRECTORY SERVERS
  • 2009/6/12 7:48

  • tcendros

  • Just popping in

  • Posts: 15

  • Since: 2008/10/10


Someone know how save the active directory configuration, may be in the sql tables or in a archive? By the way, it possible have two XOOPS installation sharing the same data base.

5
Xend
Re: CONNECT WITH TWO ACTIVE DIRECTORY SERVERS
  • 2009/6/12 13:40

  • Xend

  • Friend of XOOPS

  • Posts: 37

  • Since: 2001/12/13


Ldap is neaded to get it to work. havent done it myself, but i now thay used this.http://sourceforge.net/projects/adldap/
"Learn from the mistakes of others; you can't live long enough to make them all yourself."

6
tcendros
Re: CONNECT WITH TWO ACTIVE DIRECTORY SERVERS
  • 2009/6/12 14:30

  • tcendros

  • Just popping in

  • Posts: 15

  • Since: 2008/10/10


Ye I'v a config XOOPS with a one DC and that work fine, the problem is because wy have a two domains in diferents forests, and of the moment only can validate with a only DC. I dont know if is posible make config XOOPS for validate with two domains of DC or ldap I supouse are the same problem.

PD. jorbars please dont reply jeje

7
ghia
Re: CONNECT WITH TWO ACTIVE DIRECTORY SERVERS
  • 2009/6/12 15:36

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Put your two servernames in the preference as servername1|servername2 and try with this replacement function for authenticate in /class/auth/auth_ldap.php
function authenticate($uname$pwd null
{
  
$authenticated false;
  if (!
extension_loaded('ldap'))
  {
    
$this->setErrors(0_AUTH_LDAP_EXTENSION_NOT_LOAD);
    return 
$authenticated;
  }
  
$ldapservers explode('|'$this->ldap_server);
  foreach (
$ldapservers as $ldapserver)
  {
    
$this->_ds ldap_connect($ldapserver$this->ldap_port);
    if (
$this->_ds)
    {
      
ldap_set_option($this->_dsLDAP_OPT_PROTOCOL_VERSION$this->ldap_version);
      if (
$this->ldap_use_TLS)
      { 
// We use TLS secure connection
        
if (!ldap_start_tls($this->_ds)) $this->setErrors(0_AUTH_LDAP_START_TLS_FAILED);
      }
            
// If the uid is not in the DN we proceed to a search
            // The uid is not always in the dn
      
$userDN $this->getUserDN($uname);
      if (
$userDN)
      {
            
// We bind as user to test the credentials
        
$authenticated ldap_bind($this->_ds$userDNstripslashes($pwd));
        if (
$authenticated)
        {
                
// We load the XOOPS User database
          
return $this->loadXoopsUser($userDN$uname$pwd);
        } else 
$this->setErrors(ldap_errno($this->_ds), ldap_err2str(ldap_errno($this->_ds)) . '(' $userDN ')');
      }
    }
    else
    {
      
$this->setErrors(0_AUTH_LDAP_SERVER_NOT_FOUND);
    }
    @
ldap_close($this->_ds);
  }
  return 
$authenticated;
}

Login

Who's Online

265 user(s) are online (135 user(s) are browsing Support Forums)


Members: 0


Guests: 265


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits