-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathldapConfig.php
More file actions
36 lines (31 loc) · 863 Bytes
/
ldapConfig.php
File metadata and controls
36 lines (31 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
session_start();
if(!isset($_SESSION["user"])){
die("Please Login!");
}
$ldaptree = "OU=User, DC=win, DC=tu-berlin, DC=de";
$ldapserver = "win.tu-berlin.de";
$ldapport = "389";
$ldapuser = $_SESSION["user"] ."@".$ldapserver;
$ldappw = $_SESSION["password"];
/*
$ldaphost = 'win.tu-berlin.de';
$ldapport = 389;
$ds = ldap_connect($ldaphost, $ldapport) or die ("Connection Failure LDAP");
$user .= "@".$ldaphost;
if(ldap_bind($ds, $user, $pw)){
$search = ldap_search($ds, "CN=huehnerhose,OU=H,OU=User,dc=win,dc=tu-berlin,dc=de", "(objectclass=*)");
$search = ldap_get_entries($ds, $search);
if($search["count"] == 1){
$groups = $search[0]["memberof"];
foreach ($groups as $group) {
$group = preg_split('/,/', $group);
$group = $group[0];
if($group == "CN=soz.itadmin"){
return true;
}
}
}
}
*/
?>