} else {
$domain = $p[1];
$dn = "mail=$user,ou=Users,domainName=$domain,$CFG->ldap_base_dn";
} else {
$domain = $p[1];
$dn = "mail=$user,ou=Users,domainName=$domain,$CFG->ldap_base_dn";
$ds = @ldap_connect($CFG->ldap_dsn);
if ($ds) {
@ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
$r = @ldap_bind($ds, $dn, $pw);
if ($r) {
$sr = @ldap_search($ds, $CFG->ldap_base_dn, $filter, array('mail','domainglobaladmin'));
$ds = @ldap_connect($CFG->ldap_dsn);
if ($ds) {
@ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
$r = @ldap_bind($ds, $dn, $pw);
if ($r) {
$sr = @ldap_search($ds, $CFG->ldap_base_dn, $filter, array('mail','domainglobaladmin'));
if ($info['count'] > 0) {
// Log in to wblistadm server and get CSRFPreventionToken
if ($this->getRestTicket($user, $pw)) {
if ($info['count'] > 0) {
// Log in to wblistadm server and get CSRFPreventionToken
if ($this->getRestTicket($user, $pw)) {