Commit 54c45cbc authored by Benoit Mortier's avatar Benoit Mortier
Browse files

Fixes: #1660 Fatal error: Call to a member function cd() on a non-object in sambaAccount

parent cdf87c4b
...@@ -107,7 +107,7 @@ class sambaAccount extends plugin ...@@ -107,7 +107,7 @@ class sambaAccount extends plugin
// Get samba domain and its sid/rid base // Get samba domain and its sid/rid base
if ($this->sambaSID != ""){ if ($this->sambaSID != ""){
$this->SID= preg_replace ("/-[^-]+$/", "", $this->sambaSID); $this->SID= preg_replace ("/-[^-]+$/", "", $this->sambaSID);
$ldap= $this->config->get_ldap_link(); $ldap = $this->config->get_ldap_link();
$ldap->cd($this->config->current['BASE']); $ldap->cd($this->config->current['BASE']);
$ldap->search ("(&(objectClass=sambaDomain)(sambaSID=$this->SID))",array("sambaAlgorithmicRidBase","sambaDomainName")); $ldap->search ("(&(objectClass=sambaDomain)(sambaSID=$this->SID))",array("sambaAlgorithmicRidBase","sambaDomainName"));
if ($ldap->count() != 0){ if ($ldap->count() != 0){
...@@ -768,7 +768,7 @@ class sambaAccount extends plugin ...@@ -768,7 +768,7 @@ class sambaAccount extends plugin
} }
/* include global link_info */ /* include global link_info */
$ldap= $this->config->get_ldap_link(); $ldap = $this->config->get_ldap_link();
plugin::remove_from_parent(); plugin::remove_from_parent();
...@@ -930,6 +930,8 @@ class sambaAccount extends plugin ...@@ -930,6 +930,8 @@ class sambaAccount extends plugin
$this->uidNumber = $user->uidNumber; $this->uidNumber = $user->uidNumber;
$this->gidNumber = $user->gidNumber; $this->gidNumber = $user->gidNumber;
$ldap = $this->config->get_ldap_link();
plugin::save(); plugin::save();
/* Remove objectClass for sambaIdmapEntry */ /* Remove objectClass for sambaIdmapEntry */
...@@ -1051,7 +1053,6 @@ class sambaAccount extends plugin ...@@ -1051,7 +1053,6 @@ class sambaAccount extends plugin
} }
// Write back to ldap // Write back to ldap
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->dn); $ldap->cd($this->dn);
$this->cleanup(); $this->cleanup();
$ldap->modify ($this->attrs); $ldap->modify ($this->attrs);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment