fixed some PHP notices

This commit is contained in:
Roland Gruber 2005-03-05 13:26:46 +00:00
parent 1888ebc53c
commit 53b8e701fc
2 changed files with 18 additions and 8 deletions

View File

@ -79,6 +79,7 @@ class cache {
if ($line==-1) trigger_error (sprintf(_("ObjectClass %s required but not defined in LDAP."), $objectClass), E_USER_WARNING); if ($line==-1) trigger_error (sprintf(_("ObjectClass %s required but not defined in LDAP."), $objectClass), E_USER_WARNING);
// Create list of all allowed attributes // Create list of all allowed attributes
$allowed_attributes = array();
for ($i=0; $i<count($_SESSION['ldap']->objectClasses); $i++ ) { for ($i=0; $i<count($_SESSION['ldap']->objectClasses); $i++ ) {
if (strpos($_SESSION['ldap']->objectClasses[$i], 'MUST (')) { if (strpos($_SESSION['ldap']->objectClasses[$i], 'MUST (')) {
$string_withtail = substr($_SESSION['ldap']->objectClasses[$i], strpos($_SESSION['ldap']->objectClasses[$i], 'MUST (')+6); $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', '*' ); $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); 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 // Create list of all allowed attributes
$allowed_attributes = array();
for ($i=0; $i<count($_SESSION['ldap']->objectClasses); $i++ ) { for ($i=0; $i<count($_SESSION['ldap']->objectClasses); $i++ ) {
if (strpos($_SESSION['ldap']->objectClasses[$i], 'MUST (')) { if (strpos($_SESSION['ldap']->objectClasses[$i], 'MUST (')) {
$string_withtail = substr($_SESSION['ldap']->objectClasses[$i], strpos($_SESSION['ldap']->objectClasses[$i], 'MUST (')+6); $string_withtail = substr($_SESSION['ldap']->objectClasses[$i], strpos($_SESSION['ldap']->objectClasses[$i], 'MUST (')+6);

View File

@ -649,7 +649,7 @@ class accountContainer {
$this->subpage='attributes'; $this->subpage='attributes';
} }
else for ($i=1; $i<count($this->order); $i++ ) else for ($i=1; $i<count($this->order); $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->current_page = $i;
$this->subpage='attributes'; $this->subpage='attributes';
} }
@ -798,7 +798,7 @@ class accountContainer {
switch ($input[$i][$j]['kind']) { switch ($input[$i][$j]['kind']) {
case 'text': case 'text':
echo "<td"; echo "<td";
if ($input[$i][$j]['td']['valign']!='') echo ' valign="' . $input[$i][$j]['td']['valign'] .'"'; if (isset($input[$i][$j]['td']) && $input[$i][$j]['td']['valign'] != '') echo ' valign="' . $input[$i][$j]['td']['valign'] .'"';
echo ">\n"; echo ">\n";
echo $input[$i][$j]['text'] . "</td>\n"; echo $input[$i][$j]['text'] . "</td>\n";
break; break;
@ -833,13 +833,21 @@ class accountContainer {
break; break;
case 'select': 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'])) $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 "<td"; echo "<td";
if ($input[$i][$j]['td']['valign']!='') echo ' valign="' . $input[$i][$j]['td']['valign'] .'"'; if ($input[$i][$j]['td']['valign']!='') echo ' valign="' . $input[$i][$j]['td']['valign'] .'"';
echo ">\n"; echo ">\n";
echo "<select name=\"" . $input[$i][$j]['name'] . '"'; echo "<select name=\"" . $input[$i][$j]['name'] . '"';
if ($input[$i][$j]['multiple']) echo ' multiple'; if (isset($input[$i][$j]['multiple'])) echo ' multiple';
if ($input[$i][$j]['size']) echo ' size="' . $input[$i][$j]['size'] . '"'; if (isset($input[$i][$j]['size'])) echo ' size="' . $input[$i][$j]['size'] . '"';
// Show taborder // Show taborder
echo " tabindex=$y"; echo " tabindex=$y";
$y++; $y++;
@ -1235,9 +1243,9 @@ class accountContainer {
foreach ($module as $moduleitem) { foreach ($module as $moduleitem) {
$required = $this->module[$moduleitem]->get_dependencies($this->type); $required = $this->module[$moduleitem]->get_dependencies($this->type);
$everything_found = true; $everything_found = true;
if (is_array($required['require'])) { if (is_array($required['depends'])) {
foreach ($required['require'] as $requireditem) foreach ($required['depends'] as $requireditem)
if (!in_array($reuquireditem, $modulelist)) $everthing_found = false; if (!in_array($requireditem, $modulelist)) $everthing_found = false;
} }
if ($everything_found && !in_array($moduleitem, $order) ) $order[] = $moduleitem; if ($everything_found && !in_array($moduleitem, $order) ) $order[] = $moduleitem;
} }