diff --git a/htdocs/index.php b/htdocs/index.php index 9ded9d9..0ece670 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -1,5 +1,5 @@ search(null,'','objectClass=*',array('+','*'),'b on RHEL 3. */ $attrs2 = array_pop($ldapserver->search(null,'','objectClass=*',$root_dse_attributes,'base')); -foreach ($attrs2 as $attr => $values) - if (! isset($attrs[$attr])) - $attrs[$attr] = $attrs2[$attr]; +if (is_array($attrs2)) + foreach ($attrs2 as $attr => $values) + if (! isset($attrs[$attr])) + $attrs[$attr] = $attrs2[$attr]; include './header.php'; diff --git a/htdocs/template_engine.php b/htdocs/template_engine.php index 0b01255..f72c6a2 100644 --- a/htdocs/template_engine.php +++ b/htdocs/template_engine.php @@ -1,5 +1,5 @@ ','hidden',$attr,$attr,$detail['value']); - continue; + if (isset($detail['value'])) { + printf('','hidden',$attr,$attr,$detail['value']); + continue; + + } else { + pla_error(sprintf(_('Attribute [%s] is a HIDDEN attribute, however, it is missing a VALUE in your template.'),$attr)); + } } # This is a displayed attribute. @@ -324,9 +328,13 @@ if (isset($template['empty_attrs'])) { # Display the label. if (isset($detail['description']) && (trim($detail['description']))) printf('%s:',$detail['description'],$detail['display']); - else + + elseif (isset($detail['display'])) printf('%s:',$detail['display']); + else + printf('%s:',_('No DISPLAY/DESCRIPTION attribute in template file')); + echo ''; # Calculate the events. @@ -490,7 +498,7 @@ if (isset($template['empty_attrs'])) { foreach ($_REQUEST['form'] as $attr => $value) { # Remove blank attributes. - if (! $_REQUEST['form'][$attr]) { + if (! is_array($_REQUEST['form'][$attr]) && trim($_REQUEST['form'][$attr]) == '') { unset($_REQUEST['form'][$attr]); continue; } @@ -521,12 +529,14 @@ if (isset($template['empty_attrs'])) { } - echo '