added support for profile in account_container.
With the new functions it should be possible to create
This commit is contained in:
parent
aa3338f15b
commit
45c3b80d46
|
@ -772,20 +772,22 @@ class accountContainer {
|
||||||
*/
|
*/
|
||||||
function check_attributes() {
|
function check_attributes() {
|
||||||
$return = array();
|
$return = array();
|
||||||
// get named list of attributes
|
if (is_array($this->attributes)) {
|
||||||
$attributes = array_keys($this->attributes);
|
// get named list of attributes
|
||||||
for ($i=0; $i<count($attributes); $i++) {
|
$attributes = array_keys($this->attributes);
|
||||||
$singleattribute = array_keys ($this->attributes[$attributes[$i]]);
|
for ($i=0; $i<count($attributes); $i++) {
|
||||||
for ($j=0; $j<count($singleattribute); $j++) {
|
$singleattribute = array_keys ($this->attributes[$attributes[$i]]);
|
||||||
// found attribute which must be set
|
for ($j=0; $j<count($singleattribute); $j++) {
|
||||||
if ($this->attributes[$attributes[$i]][$singleattribute[$j]]=='MUST') {
|
// found attribute which must be set
|
||||||
// Check if attribute is set
|
if ($this->attributes[$attributes[$i]][$singleattribute[$j]]=='MUST') {
|
||||||
if ($this->module[$singleattribute[$j]]->attributes[$attributes[$i]]=='')
|
// Check if attribute is set
|
||||||
if (!in_array($singleattribute[$j], $return)) $return[] = $singleattribute[$j];
|
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
|
/* This function adds an objectClass class (module) to accountContainer
|
||||||
|
@ -854,6 +856,39 @@ class accountContainer {
|
||||||
return 0;
|
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
|
/* This function will prepare the object
|
||||||
* for a new account
|
* for a new account
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -151,7 +151,7 @@ class posixAccount {
|
||||||
* error checkings
|
* error checkings
|
||||||
*/
|
*/
|
||||||
function pages() {
|
function pages() {
|
||||||
return array('attributes', 'groups');
|
return array('attributes', 'group');
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue