From 4cbc52cc22ea3544abb51b9a5431ccac5746f233 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sat, 13 Oct 2007 17:28:37 +0000 Subject: [PATCH] changed to public/private --- lam/lib/account.inc | 14 +++++++------- lam/lib/modules/kolabUser.inc | 2 +- lam/lib/modules/posixAccount.inc | 19 ++++++++++++++----- lam/lib/modules/posixGroup.inc | 2 +- lam/lib/modules/quota.inc | 2 +- lam/lib/modules/sambaAccount.inc | 16 ++++++++-------- lam/lib/modules/sambaGroupMapping.inc | 4 ++-- lam/lib/modules/sambaSamAccount.inc | 18 +++++++++--------- lam/lib/modules/shadowAccount.inc | 2 +- lam/lib/types/group.inc | 8 ++++---- lam/lib/types/user.inc | 4 ++-- 11 files changed, 50 insertions(+), 41 deletions(-) diff --git a/lam/lib/account.inc b/lam/lib/account.inc index d461b2ed..68e318ff 100644 --- a/lam/lib/account.inc +++ b/lam/lib/account.inc @@ -335,25 +335,25 @@ function cmp_domain($a, $b) { class samba3domain { /** DN */ - var $dn; + public $dn; /** Domain name */ - var $name; + public $name; /** Domain SID */ - var $SID; + public $SID; /** Next RID */ - var $nextRID; + public $nextRID; /** Next user RID */ - var $nextUserRID; + public $nextUserRID; /** Next group RID */ - var $nextGroupRID; + public $nextGroupRID; /** RID base to calculate RIDs, default 1000 */ - var $RIDbase = 1000; + public $RIDbase = 1000; } /** diff --git a/lam/lib/modules/kolabUser.inc b/lam/lib/modules/kolabUser.inc index 9bdf3f75..2bc8b3e4 100644 --- a/lam/lib/modules/kolabUser.inc +++ b/lam/lib/modules/kolabUser.inc @@ -35,7 +35,7 @@ $Id$ class kolabUser extends baseModule { /** list of invitation policies */ - var $invitationPolicies; + private $invitationPolicies; /** * Creates a new kolabUser object. diff --git a/lam/lib/modules/posixAccount.inc b/lam/lib/modules/posixAccount.inc index 83c8de3d..be32b855 100644 --- a/lam/lib/modules/posixAccount.inc +++ b/lam/lib/modules/posixAccount.inc @@ -42,11 +42,11 @@ class posixAccount extends baseModule { // Variables /* These two variables keep an array of groups the user is also member of. */ - var $groups; - var $groups_orig; - var $createhomedir; - var $lamdaemonServer; - var $clearTextPassword; + private $groups; + private $groups_orig; + private $createhomedir; + private $lamdaemonServer; + private $clearTextPassword; /** * This function fills the error message array with messages. @@ -1708,6 +1708,15 @@ class posixAccount extends baseModule { } return $return; } + + /** + * Returns the clear text password. + * + * @return string password + */ + public function getClearTextPassword() { + return $this->clearTextPassword; + } } diff --git a/lam/lib/modules/posixGroup.inc b/lam/lib/modules/posixGroup.inc index 16a87122..31bb2af3 100644 --- a/lam/lib/modules/posixGroup.inc +++ b/lam/lib/modules/posixGroup.inc @@ -39,7 +39,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA class posixGroup extends baseModule { /** change GIDs of users and hosts? */ - var $changegids; + private $changegids; /** diff --git a/lam/lib/modules/quota.inc b/lam/lib/modules/quota.inc index 5d92cd9b..ed27486a 100644 --- a/lam/lib/modules/quota.inc +++ b/lam/lib/modules/quota.inc @@ -141,7 +141,7 @@ class quota extends baseModule { } /** Saves the quota settings */ - var $quota; + private $quota; /** * Initializes the quota values. diff --git a/lam/lib/modules/sambaAccount.inc b/lam/lib/modules/sambaAccount.inc index b34364c0..486be882 100644 --- a/lam/lib/modules/sambaAccount.inc +++ b/lam/lib/modules/sambaAccount.inc @@ -424,16 +424,16 @@ class sambaAccount extends baseModule { // Variables /** use Unix password as samba password? */ - var $useunixpwd; + private $useunixpwd; /** use no password? */ - var $nopwd; + private $nopwd; /** password does not expire? */ - var $noexpire; + private $noexpire; /** account deactivated? */ - var $deactivated; + private $deactivated; /** Array of well known rids */ - var $rids; + private $rids; function module_ready() { $attrs = $this->getAccountContainer()->getAccountModule('posixAccount')->getAttributes(); @@ -591,8 +591,8 @@ class sambaAccount extends baseModule { else $this->useunixpwd = false; if ($_POST['useunixpwd']) { $this->useunixpwd = true; - $this->attributes['lmPassword'][0] = lmPassword($this->getAccountContainer()->getAccountModule('posixAccount')->clearTextPassword); - $this->attributes['ntPassword'][0] = ntPassword($this->getAccountContainer()->getAccountModule('posixAccount')->clearTextPassword); + $this->attributes['lmPassword'][0] = lmPassword($this->getAccountContainer()->getAccountModule('posixAccount')->getClearTextPassword()); + $this->attributes['ntPassword'][0] = ntPassword($this->getAccountContainer()->getAccountModule('posixAccount')->getClearTextPassword()); $this->attributes['pwdLastSet'][0] = time(); } else $this->useunixpwd = false; @@ -732,7 +732,7 @@ class sambaAccount extends baseModule { 0 => array('kind' => 'text', 'text' => _('Repeat password') ), 1 => array('kind' => 'input', 'name' => 'lmPassword2', 'type' => 'password', 'size' => '20', 'maxlength' => '255', 'value' => ''), 2 => array('kind' => 'help', 'value' => 'password')); - if (isset($this->getAccountContainer()->getAccountModule('posixAccount')->clearTextPassword)) { + if (isset($this->getAccountContainer()->getAccountModule('posixAccount')->getClearTextPassword())) { $return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _('Use Unix password') ), 1 => array ( 'kind' => 'input', 'name' => 'useunixpwd', 'type' => 'checkbox', 'checked' => $this->useunixpwd, 'value' => true), 2 => array ('kind' => 'help', 'value' => 'pwdUnix')); diff --git a/lam/lib/modules/sambaGroupMapping.inc b/lam/lib/modules/sambaGroupMapping.inc index 2bd8e4b9..d7c51c39 100644 --- a/lam/lib/modules/sambaGroupMapping.inc +++ b/lam/lib/modules/sambaGroupMapping.inc @@ -40,9 +40,9 @@ class sambaGroupMapping extends baseModule { // Variables /** Array of well known RIDs */ - var $rids; + private $rids; /** Array of sambaGroupTypes */ - var $sambaGroupTypes; + private $sambaGroupTypes; /** * Creates a new module for Samba 3 groups. diff --git a/lam/lib/modules/sambaSamAccount.inc b/lam/lib/modules/sambaSamAccount.inc index a62d9890..565f00c7 100644 --- a/lam/lib/modules/sambaSamAccount.inc +++ b/lam/lib/modules/sambaSamAccount.inc @@ -40,17 +40,17 @@ class sambaSamAccount extends baseModule { // Variables /** use Unix password as samba password? */ - var $useunixpwd; + private $useunixpwd; /** use no password? */ - var $nopwd; + private $nopwd; /** password does not expire? */ - var $noexpire; + private $noexpire; /** account deactivated? */ - var $deactivated; + private $deactivated; /** array of well known rids */ - var $rids; + private $rids; /** HEX to binary conversion table */ - var $hex2bitstring = array('0' => '0000', '1' => '0001', '2' => '0010', '3' => '0011', '4' => '0100', + private $hex2bitstring = array('0' => '0000', '1' => '0001', '2' => '0010', '3' => '0011', '4' => '0100', '5' => '0101', '6' => '0110', '7' => '0111', '8' => '1000', '9' => '1001', 'A' => '1010', 'B' => '1011', 'C' => '1100', 'D' => '1101', 'E' => '1110', 'F' => '1111'); @@ -669,8 +669,8 @@ class sambaSamAccount extends baseModule { if ($_POST['useunixpwd']) { $this->useunixpwd = true; - $this->attributes['sambaLMPassword'][0] = lmPassword($this->getAccountContainer()->getAccountModule('posixAccount')->clearTextPassword); - $this->attributes['sambaNTPassword'][0] = ntPassword($this->getAccountContainer()->getAccountModule('posixAccount')->clearTextPassword); + $this->attributes['sambaLMPassword'][0] = lmPassword($this->getAccountContainer()->getAccountModule('posixAccount')->getClearTextPassword()); + $this->attributes['sambaNTPassword'][0] = ntPassword($this->getAccountContainer()->getAccountModule('posixAccount')->getClearTextPassword()); $this->attributes['sambaPwdLastSet'][0] = time(); } else $this->useunixpwd = false; @@ -897,7 +897,7 @@ class sambaSamAccount extends baseModule { $return[] = array( 0 => array('kind' => 'text', 'text' => _('Repeat password')), 1 => array('kind' => 'input', 'name' => 'sambaLMPassword2', 'type' => 'password', 'size' => '20', 'maxlength' => '255')); - if (isset($this->getAccountContainer()->getAccountModule('posixAccount')->clearTextPassword)) { + if (isset($this->getAccountContainer()->getAccountModule('posixAccount')->getClearTextPassword())) { $return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _('Use Unix password') ), 1 => array ( 'kind' => 'input', 'name' => 'useunixpwd', 'type' => 'checkbox', 'checked' => $this->useunixpwd), 2 => array ('kind' => 'help', 'value' => 'useunixpwd')); diff --git a/lam/lib/modules/shadowAccount.inc b/lam/lib/modules/shadowAccount.inc index a30cd6c1..65cf9b61 100644 --- a/lam/lib/modules/shadowAccount.inc +++ b/lam/lib/modules/shadowAccount.inc @@ -160,7 +160,7 @@ class shadowAccount extends baseModule { ), 'shadowMin' => array ( "Headline" => _("Minimum password age"), - "Text" => _("Number of days a user has to wait until he\'s allowed to change his password again. If set value must be 0<."). ' '. _("Can be left empty.") + "Text" => _("Number of days a user has to wait until he is allowed to change his password again. If set value must be 0<."). ' '. _("Can be left empty.") ), 'shadowMax' => array ( "Headline" => _("Maximum password age"), diff --git a/lam/lib/types/group.inc b/lam/lib/types/group.inc index e7b220c9..ff6f8693 100644 --- a/lam/lib/types/group.inc +++ b/lam/lib/types/group.inc @@ -100,14 +100,14 @@ class group extends baseType { class lamGroupList extends lamList { /** Controls if include primary group members into group memebers */ - var $include_primary = ""; + private $include_primary = ""; /** Primary group members hash */ - var $primary_hash = array(); + private $primary_hash = array(); /** Controls if primary group members needs refresh */ - var $refresh_primary = false; + private $refresh_primary = false; /** Controls if primary group members are using */ // This is here for future use with primary group members listing - var $use_primary = false; + private $use_primary = false; /** * Constructor diff --git a/lam/lib/types/user.inc b/lam/lib/types/user.inc index eaaa4ec1..f1909245 100644 --- a/lam/lib/types/user.inc +++ b/lam/lib/types/user.inc @@ -106,10 +106,10 @@ class user extends baseType { class lamUserList extends lamList { /** Controls if GID number is translated to group name */ - var $trans_primary = false; + private $trans_primary = false; /** translates GID to group name */ - var $trans_primary_hash = array(); + private $trans_primary_hash = array(); /** * Constructor