From bddad0c03d9cb2b4ac6b1e1b1938b35a8b012bae Mon Sep 17 00:00:00 2001 From: jengo Date: Sun, 24 Dec 2000 09:55:51 +0000 Subject: [PATCH] Merged some duplicate code --- phpgwapi/inc/phpgw_accounts_ldap.inc.php | 14 -------------- phpgwapi/inc/phpgw_accounts_shared.inc.php | 14 ++++++++++++++ phpgwapi/inc/phpgw_accounts_sql.inc.php | 15 --------------- 3 files changed, 14 insertions(+), 29 deletions(-) diff --git a/phpgwapi/inc/phpgw_accounts_ldap.inc.php b/phpgwapi/inc/phpgw_accounts_ldap.inc.php index 542ebec531..149f9689fe 100644 --- a/phpgwapi/inc/phpgw_accounts_ldap.inc.php +++ b/phpgwapi/inc/phpgw_accounts_ldap.inc.php @@ -302,18 +302,4 @@ return $accounts; } - function accounts_const($line,$file) - { - global $phpgw, $phpgw_info; - - //echo "accounts_const called
line: $line
$file"; - - $phpgw->accounts->phpgw_fillarray(); - $phpgw->preferences->read_preferences(); - $this->groups = $this->read_groups($phpgw_info["user"]["userid"]); - $this->apps = $this->read_apps($phpgw_info["user"]["userid"]); - - $phpgw_info["user"]["apps"] = $this->apps; - } - } diff --git a/phpgwapi/inc/phpgw_accounts_shared.inc.php b/phpgwapi/inc/phpgw_accounts_shared.inc.php index 29d18e68c3..6b9bee2f7b 100644 --- a/phpgwapi/inc/phpgw_accounts_shared.inc.php +++ b/phpgwapi/inc/phpgw_accounts_shared.inc.php @@ -14,6 +14,20 @@ class accounts extends accounts_ { + function accounts_const($line,$file) + { + global $phpgw, $phpgw_info; + + //echo "accounts_const called
line: $line
$file"; + + $phpgw->accounts->phpgw_fillarray(); + $phpgw->preferences->read_preferences(); + $this->groups = $this->read_groups($phpgw_info["user"]["userid"]); + $this->apps = $this->read_apps($phpgw_info["user"]["userid"]); + + $phpgw_info["user"]["apps"] = $this->apps; + } + // use this if you make any changes to phpgw_info, including preferences, config table changes, etc function sync($line="",$file="") { diff --git a/phpgwapi/inc/phpgw_accounts_sql.inc.php b/phpgwapi/inc/phpgw_accounts_sql.inc.php index ff6d91ed41..d5eb9e28f0 100644 --- a/phpgwapi/inc/phpgw_accounts_sql.inc.php +++ b/phpgwapi/inc/phpgw_accounts_sql.inc.php @@ -210,19 +210,4 @@ return $accounts; } - - function accounts_const($line,$file) - { - global $phpgw, $phpgw_info; - - //echo "accounts_const called
line: $line
$file"; - - $phpgw->accounts->phpgw_fillarray(); - $phpgw->preferences->read_preferences(); - $this->groups = $this->read_groups($phpgw_info["user"]["userid"]); - $this->apps = $this->read_apps($phpgw_info["user"]["userid"]); - - $phpgw_info["user"]["apps"] = $this->apps; - } - }