31 |
} |
} |
32 |
|
|
33 |
include './ludap.lib.php'; |
include './ludap.lib.php'; |
34 |
$ludap_version = "0.3"; |
$ludap_version = "0.5"; |
35 |
$ludap_conf = '/etc/ludap.conf'; |
$ludap_conf = '/etc/ludap.conf'; |
36 |
$conf = readconf($ludap_conf); |
$conf = readconf($ludap_conf); |
37 |
|
|
38 |
include './auth.php'; |
include './auth.php'; |
39 |
|
|
40 |
/* variables setup */ |
/* variables setup */ |
41 |
if (!$sort and !$rsort) $sort = "uid"; |
if (!$sort and !$rsort) $sort = $conf['ludap']['baseattr']; |
42 |
if ((is_array($gps) && (in_array('admin',$gps)) || ($gps == 'admin'))) { $admin = TRUE; } |
if ((is_array($gps) && (in_array('admin',$gps)) || ($gps == 'admin'))) { $admin = TRUE; } |
43 |
if ($view == 'xml') { |
if ($view == 'xml') { |
44 |
foreach ($conf[human] as $clabel=>$cbuff) { |
foreach ($conf[human] as $clabel=>$cbuff) { |
50 |
} |
} |
51 |
|
|
52 |
if ($searchx) { |
if ($searchx) { |
53 |
$search = "(|(uid=$searchx) (cn=*".utf8_encode($searchx)."*) (displayName=*".utf8_encode($searchx)."*))"; |
$search = "(|(".$conf['ludap']['baseattr']."=*".utf8_encode($searchx)."*) (displayName=*".utf8_encode($searchx)."*))"; |
54 |
$mquery = "&searchx=".urlencode($searchx); |
$mquery = "&searchx=".urlencode($searchx); |
55 |
} else { |
} else { |
56 |
$search = "(uid=*)"; |
$search = "(".$conf['ludap']['baseattr']."=*)"; |
57 |
$mquery = ''; |
$mquery = ''; |
58 |
} |
} |
59 |
|
|
60 |
|
|
61 |
$conn = ldap_connect($conf['ludap']['host']) or die("noway<hr>GULP!"); |
$conn = ldap_connect($conf['ludap']['host']) or die("noway<hr>GULP!"); |
62 |
$r = ldap_bind($conn,"uid=$me,".$conf['ludap']['basedn'],$pass); |
$r = ldap_bind($conn,$conf['ludap']['baseattr']."=".utf8_encode($me).", ".$conf['ludap']['basedn'],$pass); |
63 |
|
|
64 |
$in = $info = $output = $outgood = ''; |
$in = $info = $output = $outgood = ''; |
65 |
|
|