示例#1
0
         //}
         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>&nbsp,</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&eacute;e.</p>";
             EvoLog::log("Del alias " . $cn);
         } else {
             print "<p class='error>Erreur, suppression non effectu&eacute;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
0
 $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&eacute;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&eacute;e.</p>";
         EvoLog::log("Del user " . $uid);
     } else {
         print "<p class='error>Erreur, suppression non effectu&eacute;e.</p>";
         EvoLog::log("Delete {$uid} failed");
     }
     print "</center>";
 } else {
     print "<center>";