diff --git a/plugins/personal/samba/class_sambaAccount.inc b/plugins/personal/samba/class_sambaAccount.inc
index 5a8cab0553bf96f3c0bcf3134501d9c24a8875b7..31721d67b8eca443dc299a41699ed7b93ed39823 100644 (file)
var $sambaLogonTime= "0";
var $sambaLogoffTime= "2147483647";
var $sambaKickoffTime= "2147483647";
- var $sambaPwdCanChange= "0";
+ var $sambaPwdCanChange= "";
var $sambaPwdMustChange= "0";
var $sambaAcctFlags= "[UX ]";
var $sambaHomePath= "";
var $attributes= array();
var $objectclasses= array();
+ var $CopyPasteVars = array("kickoff_time_set","logoff_time_set","logon_time_set","mungedObject","orig_sambaDomainName");
+
function sambaAccount ($config, $dn= NULL)
{
/* Load attributes depending on the samba version */
$acl= array($this->config->current['BASE'] => ":all");
$regex= $sambafilter['regex'];
$filter= "(&(objectClass=sambaSAMAccount)$exclude(uid=*$)(|(uid=$regex)(cn=$regex)))";
- $res= get_list($acl, "$filter", TRUE, $sambafilter['depselect'], array("uid"), TRUE);
+ $res= get_list($filter, $acl, $sambafilter['depselect'], array("uid"), GL_SUBSEARCH | GL_SIZELIMIT);
$wslist= array();
foreach ($res as $attrs){
$wslist[]= preg_replace('/\$/', '', $attrs['uid'][0]);
@DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
$this->attributes, "Save");
$ldap->cd($this->dn);
- $ldap->modify($this->attrs);
- show_ldap_error($ldap->get_error());
+ $this->cleanup();
+ $ldap->modify ($this->attrs);
+
+ show_ldap_error($ldap->get_error(), _("Removing Samba account failed"));
/* Optionally execute a command after we're done */
$this->handle_post_events("remove");
/* Check for input problems */
function check()
{
- $message= array();
+ /* Call common method to give check the hook */
+ $message= plugin::check();
if ($this->samba3){
{
/* Load uid and gid of this 'dn' */
$ldap= $this->config->get_ldap_link();
- $ldap->cat($this->dn);
+ $ldap->cat($this->dn, array('uidNumber', 'gidNumber'));
$tmp= $ldap->fetch();
$this->uidNumber= $tmp['uidNumber'][0];
$this->gidNumber= $tmp['gidNumber'][0];
/* Write back to ldap */
$ldap->cd($this->dn);
- $ldap->modify($this->attrs);
- show_ldap_error($ldap->get_error());
+ $this->cleanup();
+ $ldap->modify ($this->attrs);
+
+ show_ldap_error($ldap->get_error(), _("Saving Samba account failed"));
/* Optionally execute a command after we're done */
if ($this->initially_was_account == $this->is_account){