From 53b8e701fc00275ab44e62aaf52e61b12e563951 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sat, 5 Mar 2005 13:26:46 +0000 Subject: [PATCH] fixed some PHP notices --- lam/lib/cache.inc | 2 ++ lam/lib/modules.inc | 24 ++++++++++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/lam/lib/cache.inc b/lam/lib/cache.inc index f684c64f..d735ba00 100644 --- a/lam/lib/cache.inc +++ b/lam/lib/cache.inc @@ -79,6 +79,7 @@ class cache { if ($line==-1) trigger_error (sprintf(_("ObjectClass %s required but not defined in LDAP."), $objectClass), E_USER_WARNING); // Create list of all allowed attributes + $allowed_attributes = array(); for ($i=0; $iobjectClasses); $i++ ) { if (strpos($_SESSION['ldap']->objectClasses[$i], 'MUST (')) { $string_withtail = substr($_SESSION['ldap']->objectClasses[$i], strpos($_SESSION['ldap']->objectClasses[$i], 'MUST (')+6); @@ -138,6 +139,7 @@ class cache { $allowed_types = array ( 'user', 'group', 'host', 'domain', '*' ); if (!in_array($singlescope, $allowed_types)) trigger_error(sprintf('Invalid scope. Valid scopes are %s.', implode(" ", $allowed_types)), E_USER_ERROR); // Create list of all allowed attributes + $allowed_attributes = array(); for ($i=0; $iobjectClasses); $i++ ) { if (strpos($_SESSION['ldap']->objectClasses[$i], 'MUST (')) { $string_withtail = substr($_SESSION['ldap']->objectClasses[$i], strpos($_SESSION['ldap']->objectClasses[$i], 'MUST (')+6); diff --git a/lam/lib/modules.inc b/lam/lib/modules.inc index c7282ff2..c759cf9a 100644 --- a/lam/lib/modules.inc +++ b/lam/lib/modules.inc @@ -649,7 +649,7 @@ class accountContainer { $this->subpage='attributes'; } else for ($i=1; $iorder); $i++ ) - if ($post['form_main_'.$this->order[$i]] && ($this->module[$this->order[$i]]->module_ready())) { + if (isset($post['form_main_'.$this->order[$i]]) && ($this->module[$this->order[$i]]->module_ready())) { $this->current_page = $i; $this->subpage='attributes'; } @@ -798,7 +798,7 @@ class accountContainer { switch ($input[$i][$j]['kind']) { case 'text': echo "\n"; echo $input[$i][$j]['text'] . "\n"; break; @@ -833,13 +833,21 @@ class accountContainer { break; case 'select': if (!is_array($input[$i][$j]['options'])) $input[$i][$j]['options'] = array ( $input[$i][$j]['options'] ); - if (!is_array($input[$i][$j]['options_selected'])) $input[$i][$j]['options_selected'] = array ( $input[$i][$j]['options_selected'] ); + if (isset($input[$i][$j]['options_selected'])) { + if (!is_array($input[$i][$j]['options_selected'])) { + // one selected element + $input[$i][$j]['options_selected'] = array ( $input[$i][$j]['options_selected'] ); + } + } + else { + $input[$i][$j]['options_selected'] = array(); + } echo "\n"; echo "