From 8fd703f1eb9d34e826611d5bd9e2332d0882a72e Mon Sep 17 00:00:00 2001 From: Lars Kneschke Date: Fri, 10 Nov 2000 21:11:03 +0000 Subject: [PATCH] changes for better ldap support --- admin/inc/accounts_ldap.inc.php | 37 ++++++++++++++++----------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/admin/inc/accounts_ldap.inc.php b/admin/inc/accounts_ldap.inc.php index 580cd94448..052970b651 100644 --- a/admin/inc/accounts_ldap.inc.php +++ b/admin/inc/accounts_ldap.inc.php @@ -110,7 +110,7 @@ function account_add($account_info) { global $phpgw_info, $phpgw, $ldap; - + $account_info["passwd"] = $phpgw->common->encrypt_password($account_info["passwd"]); // This method is only temp. We need to figure out the best way to assign uidnumbers and @@ -180,27 +180,26 @@ } else { $cd = 99; // Come out with a code for this } - + + // create a subtree for the phpgw settings + + $preferences["objectclass"] = "organizationalunit"; + $preferences["description"] = "subtree for phpgw preferences"; + $preferences["ou"] = "phpgwpreferences"; + + $dn = "ou=phpgwpreferences, $dn"; + + // add the entries + if (ldap_add($ldap, $dn, $preferences)) { + $cd = 28; + } else { + $cd = 99; // Come out with a code for this + } + + @ldap_close($ldap); add_default_preferences($account_info["account_id"]); - #$phpgw->db->lock(array("accounts","preferences")); - - #while ($permission = each($account_info["permissions"])) { - # if ($phpgw_info["apps"][$permission[0]]["enabled"]) { - # $phpgw->accounts->add_app($permission[0]); - # } - #} - - #$sql = "insert into accounts (account_id,account_lid,account_pwd,account_firstname," - # . "account_lastname,account_permissions,account_groups,account_status," - # . "account_lastpwd_change) values ('" . $account_info["account_id"] . "','" - # . $account_info["loginid"] . "','x','". addslashes($account_info["firstname"]) . "','" - # . addslashes($account_info["lastname"]) . "','" . $phpgw->accounts->add_app("",True) - # . "','" . $account_info["groups"] . "','A',0)"; - - #$phpgw->db->query($sql); - #$phpgw->db->unlock(); $sep = $phpgw->common->filesystem_separator();