From 45c3b80d46fe53859ff7aaef345540863a7d3144 Mon Sep 17 00:00:00 2001 From: katagia Date: Thu, 29 Jan 2004 20:11:05 +0000 Subject: [PATCH] added support for profile in account_container. With the new functions it should be possible to create --- lam/lib/account.inc | 57 ++++++++++++++++++++++++++------ lam/lib/modules/posixAccount.inc | 2 +- 2 files changed, 47 insertions(+), 12 deletions(-) diff --git a/lam/lib/account.inc b/lam/lib/account.inc index 02e70a66..8535e818 100644 --- a/lam/lib/account.inc +++ b/lam/lib/account.inc @@ -772,20 +772,22 @@ class accountContainer { */ function check_attributes() { $return = array(); - // get named list of attributes - $attributes = array_keys($this->attributes); - for ($i=0; $iattributes[$attributes[$i]]); - for ($j=0; $jattributes[$attributes[$i]][$singleattribute[$j]]=='MUST') { - // Check if attribute is set - if ($this->module[$singleattribute[$j]]->attributes[$attributes[$i]]=='') - if (!in_array($singleattribute[$j], $return)) $return[] = $singleattribute[$j]; + if (is_array($this->attributes)) { + // get named list of attributes + $attributes = array_keys($this->attributes); + for ($i=0; $iattributes[$attributes[$i]]); + for ($j=0; $jattributes[$attributes[$i]][$singleattribute[$j]]=='MUST') { + // Check if attribute is set + if ($this->module[$singleattribute[$j]]->attributes[$attributes[$i]]=='') + if (!in_array($singleattribute[$j], $return)) $return[] = $singleattribute[$j]; + } } } + return $return; } - return $return; } /* This function adds an objectClass class (module) to accountContainer @@ -854,6 +856,39 @@ class accountContainer { return 0; } + function display_profile($post) { + $return = array(); + $post = array(); + $module = array_keys ($this->module); + foreach ($module as $singlemodule) { + // get list of display functions. + $list = $this->module[$singlemodule]->pages(); + foreach ($list as $item) { + $function = 'display_html_' . $item; + $page = $this->module[$singlemodule]->$function($post,true); + //eval($function); + $return = array_merge($return, $page); + } + } + return $return; + } + + function process_profile($post) { + $return = array(); + $module = array_keys ($this->module); + foreach ($module as $singlemodule) { + // get list of display functions. + $list = $this->module[$singlemodule]->pages(); + foreach ($list as $item) { + $function = 'display_html_' . $item; + $page = $this->module[$singlemodule]->$function($post,true); + //eval($function); + $return = array_merge($return, $page); + } + } + return $return; + } + /* This function will prepare the object * for a new account */ diff --git a/lam/lib/modules/posixAccount.inc b/lam/lib/modules/posixAccount.inc index 74f66131..81cf4065 100644 --- a/lam/lib/modules/posixAccount.inc +++ b/lam/lib/modules/posixAccount.inc @@ -151,7 +151,7 @@ class posixAccount { * error checkings */ function pages() { - return array('attributes', 'groups'); + return array('attributes', 'group'); } /*