forked from extern/egroupware
Add homedirectory and loginshell to ldap
This commit is contained in:
parent
3690501ca1
commit
c7b682d525
@ -83,7 +83,10 @@
|
|||||||
$this->data["firstname"] = $allValues[0]["givenname"][0];
|
$this->data["firstname"] = $allValues[0]["givenname"][0];
|
||||||
$this->data["lastname"] = $allValues[0]["sn"][0];
|
$this->data["lastname"] = $allValues[0]["sn"][0];
|
||||||
$this->data["fullname"] = $allValues[0]["cn"][0];
|
$this->data["fullname"] = $allValues[0]["cn"][0];
|
||||||
|
if ($phpgw_info["server"]["ldap_extra_attributes"]) {
|
||||||
|
$this->data["homedirectory"] = $allValues[0]["homedirectory"][0];
|
||||||
|
$this->data["loginshell"] = $allValues[0]["loginshell"][0];
|
||||||
|
}
|
||||||
$this->db->query("select * from phpgw_accounts where account_id='" . $this->data["account_id"] . "'",__LINE__,__FILE__);
|
$this->db->query("select * from phpgw_accounts where account_id='" . $this->data["account_id"] . "'",__LINE__,__FILE__);
|
||||||
$this->db->next_record();
|
$this->db->next_record();
|
||||||
|
|
||||||
@ -109,6 +112,11 @@
|
|||||||
$entry["sn"] = $this->data["lastname"];
|
$entry["sn"] = $this->data["lastname"];
|
||||||
$entry["givenname"] = $this->data["firstname"];
|
$entry["givenname"] = $this->data["firstname"];
|
||||||
|
|
||||||
|
if ($phpgw_info["server"]["ldap_extra_attributes"]) {
|
||||||
|
$entry["homedirectory"] = $this->data["homedirectory"];
|
||||||
|
$entry["loginshell"] = $this->data["loginshell"];
|
||||||
|
}
|
||||||
|
|
||||||
ldap_modify($ds, $allValues[0]["dn"], $entry);
|
ldap_modify($ds, $allValues[0]["dn"], $entry);
|
||||||
#print ldap_error($ds);
|
#print ldap_error($ds);
|
||||||
|
|
||||||
@ -289,7 +297,7 @@
|
|||||||
return $rtrn;
|
return $rtrn;
|
||||||
}
|
}
|
||||||
|
|
||||||
function create($account_type, $account_lid, $account_pwd, $account_firstname, $account_lastname, $account_status, $account_id='')
|
function create($account_type, $account_lid, $account_pwd, $account_firstname, $account_lastname, $account_status, $account_id='',$account_home='',$account_shell='')
|
||||||
{
|
{
|
||||||
global $phpgw_info, $phpgw;
|
global $phpgw_info, $phpgw;
|
||||||
|
|
||||||
@ -328,6 +336,26 @@
|
|||||||
$entry["objectclass"][3] = 'posixAccount';
|
$entry["objectclass"][3] = 'posixAccount';
|
||||||
$entry["objectclass"][4] = 'shadowAccount';
|
$entry["objectclass"][4] = 'shadowAccount';
|
||||||
|
|
||||||
|
if ($phpgw_info["server"]["ldap_extra_attributes"]) {
|
||||||
|
if ($account_home)
|
||||||
|
{
|
||||||
|
$entry["homedirectory"] = $account_home;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$entry["homedirectory"] = $phpgw_info["server"]["ldap_account_home"].SEP.$account_lid;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($account_shell)
|
||||||
|
{
|
||||||
|
$entry["loginshell"] = $account_shell;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$entry["loginshell"] = $phpgw_info["server"]["ldap_account_shell"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($allValues[0]["dn"]) {
|
if ($allValues[0]["dn"]) {
|
||||||
// This should keep the password from being overwritten here ?
|
// This should keep the password from being overwritten here ?
|
||||||
unset($entry["userpassword"]);
|
unset($entry["userpassword"]);
|
||||||
|
@ -204,8 +204,9 @@
|
|||||||
return $this->db->f(0) > 0;
|
return $this->db->f(0) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function create($account_type, $account_lid, $account_pwd, $account_firstname, $account_lastname, $account_status)
|
function create($account_type, $account_lid, $account_pwd, $account_firstname, $account_lastname, $account_status,$account_home='',$account_shell='')
|
||||||
{
|
{
|
||||||
|
// $account_home and $account_shell not used here
|
||||||
$this->db->query("insert into phpgw_accounts (account_lid, account_type, account_pwd, "
|
$this->db->query("insert into phpgw_accounts (account_lid, account_type, account_pwd, "
|
||||||
. "account_firstname, account_lastname, account_status) values ('" . $account_lid
|
. "account_firstname, account_lastname, account_status) values ('" . $account_lid
|
||||||
. "','" . $account_type . "','" . md5($account_pwd) . "', '" . $account_firstname
|
. "','" . $account_type . "','" . md5($account_pwd) . "', '" . $account_firstname
|
||||||
|
Loading…
Reference in New Issue
Block a user