protected function searchLdapWithNetid($netid) { // Production $ldap = new NuLdap(Config::get('ldap.rdn'), Config::get('ldap.password')); $metadata = $ldap->searchNetid($netid); /* For local development, no need to test ldap stuff so comment the previous two lines because I made that package, and it's FLAWLESS!!! $metadata = [ 'givenname' => ['Steve'], 'sn' => ['Wussup'], 'mail' => ['*****@*****.**'] ]; */ $result[$this->getFirstNameColString()] = $metadata['givenname'][0]; $result[$this->getLastNameColString()] = $metadata['sn'][0]; $result[$this->getEmailColString()] = $metadata['mail'][0]; return $result; }
/** * Get Info on Ldap netid * @param \Illuminate\Auth\UserInterface $user * @return array */ private function retrieveLdapUserInfo($netid) { $ldap = new NuLdap(Config::get('ldap.rdn'), Config::get('ldap.password')); $user = $ldap->parseUser($ldap->searchNetid($netid)); if ($user === []) { return null; } return $user; }
/** * Get Info on Ldap netid * @param \Illuminate\Auth\UserInterface $user * @return array */ private function retrieveLdapUserInfo($netid) { $ldap = new NuLdap(Config::get('ldap.rdn'), Config::get('ldap.password')); $metadata = $ldap->searchNetid($netid); $result['first_name'] = $metadata['givenname'][0]; $result['last_name'] = $metadata['sn'][0]; $result['email'] = $metadata['mail'][0]; return $result; }