本文整理汇总了PHP中Ldap::lda_del方法的典型用法代码示例。如果您正苦于以下问题:PHP Ldap::lda_del方法的具体用法?PHP Ldap::lda_del怎么用?PHP Ldap::lda_del使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ldap
的用法示例。
在下文中一共展示了Ldap::lda_del方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
//}
print "<tr><td align='right'>Alias actif :</td>\n <td align='left'><input type='checkbox' name='isactive'\n {$isactive} tabindex='" . $tab++ . "' /></td></tr>\n";
print "<tr><td> ,</td><td align='left'>";
print "<p><input type='submit' class='button' \n value='Valider' name='valider' tabindex='" . $tab++ . "' /></p>\n";
print "</td></tr>";
print "</table>\n";
print '</form>';
}
} elseif (isset($_GET['del'])) {
$cn = Html::clean($_GET['del']);
if (isset($_GET['modif']) && $_GET['modif'] == 'yes') {
print "<center>";
print "<p>Suppression {$cn} en cours...</p>";
// TODO : Verifier que l'objet existe avant sa suppression
$ldapconn = Ldap::lda_connect(LDAP_ADMIN_DN, LDAP_ADMIN_PASS);
$sr = Ldap::lda_del($ldapconn, "cn=" . $cn . "," . $rdn);
if ($sr) {
print "<p class='strong'>Suppression {$cn} effectuée.</p>";
EvoLog::log("Del alias " . $cn);
} else {
print "<p class='error>Erreur, suppression non effectuée.</p>";
EvoLog::log("Delete {$cn} failed");
}
print "</center>";
} else {
print "<center>";
print "<p>Vous allez effacer l'alias <b>{$cn}</b>...<br />";
print "<a href='alias.php?del={$cn}&modif=yes'>Confirmer la suppression</a>";
print "</center>";
}
} else {
示例2: failed
$uid = Html::clean($_GET['del']);
if (isset($_GET['modif']) && $_GET['modif'] == 'yes') {
$ldapconn = Ldap::lda_connect(LDAP_ADMIN_DN, LDAP_ADMIN_PASS);
print "<center>";
print "<p>Suppression {$uid} en cours...</p>";
// Verify if person exists...
// TODO : /!\ il faudrait verifier le DN plutot que le uid
if (!Ldap::is_uid($uid)) {
print "<p class='error>Erreur, compte inexistant</p>";
EvoLog::log("Delete {$uid} failed (user doesn't exist).");
// *Try* to verify if user is always in aliases...
} elseif (Ldap::is_what($uid, 'maildrop') > 1) {
print "<p class='error>Erreur, compte encore présent dans certains alias</p>";
EvoLog::log("Delete {$uid} failed (user always in aliases).");
// LDAP deletion
} elseif (Ldap::lda_del($ldapconn, "uid=" . $uid . "," . $rdn)) {
if (!$conf['domaines']['ldap']['virtual']) {
// script suppression systeme
unix_del($uid);
}
// TODO : suppression params HORDE
// $query = 'delete from horde_prefs where pref_uid="' .$uid. '"';
print "<p class='strong'>Suppression {$uid} effectuée.</p>";
EvoLog::log("Del user " . $uid);
} else {
print "<p class='error>Erreur, suppression non effectuée.</p>";
EvoLog::log("Delete {$uid} failed");
}
print "</center>";
} else {
print "<center>";