From adaf8f29ba55ff22e587971b14f3722871d5be7c Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sat, 17 Sep 2005 08:54:40 +0000 Subject: [PATCH] fixed loading of account flags --- lam/lib/modules/sambaAccount.inc | 11 ++++++++--- lam/lib/modules/sambaSamAccount.inc | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/lam/lib/modules/sambaAccount.inc b/lam/lib/modules/sambaAccount.inc index 7c3bed16..a18cb86d 100644 --- a/lam/lib/modules/sambaAccount.inc +++ b/lam/lib/modules/sambaAccount.inc @@ -460,9 +460,14 @@ class sambaAccount extends baseModule { */ function load_attributes($attr) { parent::load_attributes($attr); - if (strpos($this->attributes['acctFlags'][0], "D")) $this->deactivated = true; - if (strpos($this->attributes['acctFlags'][0], "N")) $this->nopwd = true; - if (strpos($this->attributes['acctFlags'][0], "X")) $this->noexpire = true; + if (is_string($this->attributes['acctFlags'][0])) { + if (strpos($this->attributes['acctFlags'][0], "D")) $this->deactivated = true; + else $this->deactivated = false; + if (strpos($this->attributes['acctFlags'][0], "N")) $this->nopwd = true; + else $this->nopwd = false; + if (strpos($this->attributes['acctFlags'][0], "X")) $this->noexpire = true; + else $this->noexpire = false; + } return 0; } diff --git a/lam/lib/modules/sambaSamAccount.inc b/lam/lib/modules/sambaSamAccount.inc index bd1d2bc2..c0fef66a 100644 --- a/lam/lib/modules/sambaSamAccount.inc +++ b/lam/lib/modules/sambaSamAccount.inc @@ -451,9 +451,14 @@ class sambaSamAccount extends baseModule { */ function load_attributes($attr) { parent::load_attributes($attr); - if (strpos($this->attributes['sambaAcctFlags'][0], "D")) $this->deactivated = true; - if (strpos($this->attributes['sambaAcctFlags'][0], "N")) $this->nopwd = true; - if (strpos($this->attributes['sambaAcctFlags'][0], "X")) $this->noexpire = true; + if (is_string($this->attributes['sambaAcctFlags'][0])) { + if (strpos($this->attributes['sambaAcctFlags'][0], "D")) $this->deactivated = true; + else $this->deactivated = false; + if (strpos($this->attributes['sambaAcctFlags'][0], "N")) $this->nopwd = true; + else $this->nopwd = false; + if (strpos($this->attributes['sambaAcctFlags'][0], "X")) $this->noexpire = true; + else $this->noexpire = false; + } return 0; }