Start on fetching DN from server

This commit is contained in:
Deon George
2020-09-13 21:30:04 +10:00
parent 130ae005a3
commit f323be3d7f
10 changed files with 162 additions and 52 deletions

View File

@@ -54,6 +54,27 @@ class Server
}
}
/**
* Fetch a DN from the server
*
* @param $dn
* @return |null
*/
public function fetch(string $dn,array $attributes=['*'])
{
try {
return ($x=(new Adldap)
->addProvider(config('ldap.connections.default.settings'))
->search()
->select($attributes)
->findByDn($dn)) ? $x : NULL;
// @todo Tidy up this exception
} catch (\Exception $e) {
dd(['e'=>$e]);
}
}
/**
* Query the server for a DN
*