Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $username = "uid";
- $password = "secret";
- $ds = ldap_connect("ldaps://bv1.ruf.uni-freiburg.de", "636");
- if (ldap_bind($ds, "uid={$username},ou=people,dc=uni-freiburg,dc=de", $password))
- {
- // Suchen des Nachnamen-Eintrags
- $sr = ldap_search($ds, "ou=people,dc=uni-freiburg,dc=de", "uid={$username}");
- $info = ldap_get_entries($ds, $sr);
- echo "<h1>Willkommen {$info[0]['givenname'][0]} {$info[0]['sn'][0]}</h1>
- <h2>Fakultaet: No.{$info[0]['ruffakultaet'][0]} - {$info[0]['rufaccounttype'][0]}</h2>";
- ldap_close($ds);
- } else {
- echo("permission denied");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement