public function __get($key) { switch ($key) { case "name": return $this->ldap_entry["uid"][0]; case "guest": return false; case "id": return $this->ldap_entry["uidnumber"][0]; case "groups": return IdentityProvider_Ldap_Driver::groups_for($this); case "locale": // @todo return null; case "admin": return in_array($this->ldap_entry["uid"][0], IdentityProvider_Ldap_Driver::$_params["admins"]); case "email": return $this->ldap_entry["mail"][0]; case "full_name": return $this->ldap_entry["cn"][0]; case "dn": return $this->ldap_entry["dn"]; case "url": // @todo return null; default: throw new Exception("@todo UNKNOWN_KEY ({$key})"); } }
public function groups() { return IdentityProvider_Ldap_Driver::groups_for($this); }