Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Mirror create_user methods
  • Loading branch information
boonebgorges committed Jun 23, 2011
1 parent 16938a3 commit 9abcb6a
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions ad-integration.php
Expand Up @@ -58,7 +58,6 @@ public function create_user( $username, $userinfo = false, $display_name = false

}


return $this->_create_user( $username, $userinfo[0], false, false, false, true );
}
}
Expand All @@ -72,13 +71,14 @@ public function create_user( $username, $userinfo = false, $display_name = false

// Connect to Active Directory
try {
$this->_adldap = @new adLDAP( array(
$this->_adldap = @new SIU_adLDAP( array(
"base_dn" => $this->_base_dn,
"domain_controllers" => explode(';', $this->_domain_controllers),
"ad_port" => $this->_port, // AD port
"use_tls" => $this->_use_tls, // secure?
"network_timeout" => $this->_network_timeout, // network timeout
'ad_username' => $ad_settings['username'], 'ad_password' => $ad_settings['password']
"ad_username" => $ad_settings['username'],
"ad_password" => $ad_settings['password']
) );
} catch (Exception $e) {
$this->_log(ADI_LOG_ERROR,'adLDAP exception: ' . $e->getMessage());
Expand All @@ -91,8 +91,16 @@ public function create_user( $username, $userinfo = false, $display_name = false
$account_suffix = trim($account_suffix);
$this->_log(ADI_LOG_NOTICE,'trying account suffix "'.$account_suffix.'"');
$this->_adldap->set_account_suffix($account_suffix);

$userinfo = $this->_adldap->user_info($username, $this->_all_user_attributes);

// Find user by email address
$un = $this->_adldap->find_user_by_email( $username );

if ( empty( $un ) )
return false;

// Get all userdata
$userinfo = $this->_adldap->user_info( $un[0], $this->_all_user_attributes );

}

return $this->_create_user( $username, $userinfo[0], false, false, false, true );
Expand Down

0 comments on commit 9abcb6a

Please sign in to comment.