$dnString = “mail=” . urldecode($mail) . “,ou=” .

$dnString = “mail=” . urldecode($mail) . “,ou=” . urldecode($ou) . “,” . $baseDN; The script prompts the user for the administrator’s password since this is required for deleting entries from the directory: if (!isset($adminpassword)) { generateHTMLHeader(”Administrator action:”); promptPassword($mail, $ou, “empdir_delete.php”); return; } Here the DN of the administrator user is hard-coded. Ideally there can be a whole category of administrative users and the roles and privileges of these users can be managed by using the HTTP sessions in tandem with the LDAP implementation’s authentication and authorization mechanism: $adminRDN = “cn=Admin,” . $baseDN; We connect to the server and bind as the administrator user: $linkIdentifier = connectBindServer($adminRDN, $adminpassword); if ($linkIdentifier) { The actual deletion is performed using the DN string we constructed earlier: if (ldap_delete($linkIdentifier, $dnString) == true) { generateHTMLHeader(”The entry was deleted succesfully”); returnToMain(); } else { displayErrMsg(”Deletion of entry failed !!”); closeConnection($linkIdentifier); exit; } } else { displayErrMsg(”Connection to LDAP server failed!!”); exit; } ?> This script is invoked when the user clicks on the ADD button from the main screen:

Hint: If you are looking for high quality and reliable webspace provider to host and run your jsp hosting application check Sandzak jsp web hosting provider

Comments are closed.