Beispiel #1
0
 public function getIdentityObject()
 {
     $fields = array('id', 'username', 'email_address', 'display_name');
     $stdObject = $this->getResultRowObject($fields);
     $identityObject = new User();
     $identityObject->setId($stdObject->id);
     $identityObject->setUsername($stdObject->username);
     $identityObject->setDomain('local');
     $identityObject->setEmailAddress($stdObject->email_address);
     $identityObject->setDisplayName($stdObject->display_name);
     return $identityObject;
 }
Beispiel #2
0
 public function getIdentityObject()
 {
     // Grab the account object from LDAP.
     $fields = array('userprincipalname', 'mail', 'displayname');
     $stdObject = $this->getAccountObject($fields);
     // Extract username and domain from userprinciplename property.
     $arr = explode("@", $stdObject->userprincipalname);
     // Hydrate and return a User object.
     $identityObject = new User();
     $identityObject->setUsername($arr[0]);
     $identityObject->setDomain($arr[1]);
     $identityObject->setPassword('');
     if (property_exists($stdObject, 'mail')) {
         $identityObject->setEmailAddress($stdObject->mail);
     }
     $identityObject->setDisplayName($arr[0]);
     if (property_exists($stdObject, 'mail')) {
         $identityObject->setDisplayName($stdObject->displayname);
     }
     return $identityObject;
 }