mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-25 16:18:57 +01:00
More work on creating the functions for the LDAP admin section
This commit is contained in:
parent
0295005a6e
commit
689f013abc
@ -86,4 +86,6 @@
|
||||
$t->pparse("out","footer");
|
||||
|
||||
$phpgw->common->phpgw_footer();
|
||||
|
||||
account_close();
|
||||
?>
|
||||
|
@ -62,4 +62,5 @@
|
||||
|
||||
Header("Location: " . $phpgw->link("accounts.php","cd=$cd"));
|
||||
}
|
||||
account_close();
|
||||
?>
|
||||
|
@ -227,5 +227,6 @@
|
||||
</center>
|
||||
</form>
|
||||
<?php
|
||||
$phpgw->common->phpgw_footer();
|
||||
account_close();
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
||||
|
@ -14,6 +14,15 @@
|
||||
// Sections of code where taking from slapda http://www.jeremias.net/projects/sldapa by
|
||||
// Jason Jeremias <jason@jeremias.net>
|
||||
|
||||
|
||||
$ldap = ldap_connect($phpgw_info["server"]["ldap_host"]);
|
||||
|
||||
if (! ldap_bind($ldap, $phpgw_info["server"]["ldap_root_dn"], $phpgw_info["server"]["ldap_root_pw"])) {
|
||||
echo "<p><b>Error binding to LDAP server. Check your config</b>";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
function account_read($method,$start,$sort,$order)
|
||||
{
|
||||
|
||||
@ -21,7 +30,7 @@
|
||||
|
||||
function account_add($account_info)
|
||||
{
|
||||
global $phpgw_info;
|
||||
global $phpgw_info, $ldap;
|
||||
|
||||
if ($phpgw_info["server"]["ldap_encryption_type"] == "DES") {
|
||||
$salt = randomstring(2);
|
||||
@ -33,13 +42,6 @@
|
||||
$userpassword = md5cryptpass($account_info["passwd"], $salt);
|
||||
}
|
||||
|
||||
$ldap = ldap_connect($phpgw_info["server"]["ldap_host"]);
|
||||
|
||||
if (! ldap_bind($ldap, $phpgw_info["server"]["ldap_root_dn"], $phpgw_info["server"]["ldap_root_pw"])) {
|
||||
echo "<p><b>Error binding to LDAP server. Check your config</b>";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Create our entry
|
||||
$entry["uid"] = $uid;
|
||||
$entry["uidNumber"] = $uidnumber;
|
||||
@ -92,10 +94,22 @@
|
||||
|
||||
function account_delete($account_id)
|
||||
{
|
||||
global $ldap;
|
||||
|
||||
$searchline = getSearchLine($searchstring);
|
||||
$result = ldap_search($ldap, $BASEDN, $searchline);
|
||||
$entry = ldap_get_entries($ldap, $result);
|
||||
$numentries = $entry["count"];
|
||||
|
||||
@ldap_delete($ldap, $button);
|
||||
}
|
||||
|
||||
function account_exsists($loginid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function account_close()
|
||||
{
|
||||
@ldap_close($ldap);
|
||||
}
|
||||
|
@ -243,3 +243,9 @@
|
||||
|
||||
return $phpgw->db->f(0);
|
||||
}
|
||||
|
||||
// This is need for LDAP, so this is a dummy function.
|
||||
function account_close()
|
||||
{
|
||||
return True;
|
||||
}
|
||||
|
@ -138,5 +138,7 @@
|
||||
|
||||
$t->set_var("lang_button",Lang("Add"));
|
||||
$t->pparse("out","form");
|
||||
|
||||
account_close();
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user