Exemple #1
0
<?php

$dn = $_GET['dn'] ? $_GET['dn'] : $_POST['dn'];
@($fio = $_GET['fio'] ? $_GET['fio'] : $_POST['fio']);
@($_GET['sortcolumn'] = $_GET['sortcolumn'] ? $_GET['sortcolumn'] : "ФИО");
@($_GET['sorttype'] = $_GET['sorttype'] ? $_GET['sorttype'] : "ASC");
$ldap = new LDAP($LDAPServer, $LDAPUser, $LDAPPassword);
if ($fio) {
    $dn = $ldap->getValue($OU, $LDAP_DISTINGUISHEDNAME_FIELD, "cn=" . $fio);
}
if ($DIRECT_PHOTO) {
    $Image = $ldap->getImage($dn, $GLOBALS['LDAP_PHOTO_FIELD']);
} else {
    $Image = $GLOBALS['PHOTO_DIR'] . "/" . md5($dn) . ".jpg";
    $Image = $ldap->getImage($dn, $GLOBALS['LDAP_PHOTO_FIELD'], $Image);
}
echo "<table class=\"user\">";
echo "<tr>";
echo "<td width=\"1%\">";
if ($Image) {
    echo "<div class=\"photo\"><img src=\"" . $Image . "\"></div>";
} else {
    echo "<div class=\"photo\"><img src=\"./skins/" . $CURRENT_SKIN . "/images/ldap/user.png\"></div>";
}
echo "</td>";
echo "<td>";
if ($USE_DISPLAY_NAME) {
    $Name = $ldap->getValue($dn, $DISPLAY_NAME_FIELD);
} else {
    $Name = $ldap->getValue($dn, "name");
}