From 28d0a8e6b971fe76689881fd6bcbeb8c9129c5d0 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Tue, 24 Jan 2006 14:23:42 +0000 Subject: [PATCH] less PHP notices --- lam/lib/baseModule.inc | 4 ++-- lam/lib/cache.inc | 2 ++ lam/lib/config.inc | 4 ++-- lam/lib/lists.inc | 2 +- lam/lib/modules.inc | 12 ++++++------ lam/lib/modules/inetOrgPerson.inc | 3 ++- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/lam/lib/baseModule.inc b/lam/lib/baseModule.inc index 28b68eb4..059dfe4a 100644 --- a/lam/lib/baseModule.inc +++ b/lam/lib/baseModule.inc @@ -89,8 +89,8 @@ class baseModule { function init($base) { $this->base = $base; // Create Arrays with ldap attributes - $this->attributes =& $_SESSION[$this->base]->get_module_attributes(get_class($this)); - $this->orig =& $_SESSION[$this->base]->get_module_attributes(get_class($this), true); + $this->attributes = $_SESSION[$this->base]->get_module_attributes(get_class($this)); + $this->orig = $_SESSION[$this->base]->get_module_attributes(get_class($this), true); $line=-1; for ($i=0; $iobjectClasses) || $i==-1; $i++) { if (strpos(strtolower($_SESSION['ldap']->objectClasses[$i]), strtolower("NAME '".get_class($this)."'"))) $line = $i; diff --git a/lam/lib/cache.inc b/lam/lib/cache.inc index 72c923ea..f04c5d11 100644 --- a/lam/lib/cache.inc +++ b/lam/lib/cache.inc @@ -86,6 +86,7 @@ class cache { else $scopes = array($scopelist); // Add cache entry dynamic if (!is_array($attributes)) $attributes = array($attributes); + $add = array(); foreach ($scopes as $scope) { for ($i = 0; $i < sizeof($attributes); $i++) { if (!@in_array($attributes[$i], $this->attributes[$scope])) $add[$scope][] = $attributes[$i]; @@ -124,6 +125,7 @@ class cache { if (is_array($scopelist)) $scopes = $scopelist; else $scopes = array($scopelist); // Add cache entry dynamic + $add = array(); foreach ($scopes as $scope) { if (!@in_array($attribute ,$this->attributes[$scope])) $add[$scope][] = $attribute; } diff --git a/lam/lib/config.inc b/lam/lib/config.inc index 6a2ed81c..ef7da414 100644 --- a/lam/lib/config.inc +++ b/lam/lib/config.inc @@ -237,8 +237,8 @@ class Config { $scopes = $this->get_ActiveTypes(); for ($s = 0; $s < sizeof($scopes); $s++) { $scope = $scopes[$s]; - $moduleVar = $scope . "modules"; - $modules = explode(",", $this->$moduleVar); + $moduleVar = "modules_" . $scope; + $modules = explode(",", $this->typeSettings[$moduleVar]); $available = getAvailableModules($scope); // only return available modules $ret = array(); diff --git a/lam/lib/lists.inc b/lam/lib/lists.inc index 47b2e705..f1874c06 100644 --- a/lam/lib/lists.inc +++ b/lam/lib/lists.inc @@ -604,7 +604,7 @@ class lamList { if (isset($_GET["sort"])) $this->sortColumn = $_GET["sort"]; else $this->sortColumn = strtolower($this->attrArray[0]); // check search suffix - if ($_POST['suffix']) $this->suffix = $_POST['suffix']; // new suffix selected via combobox + if (isset($_POST['suffix'])) $this->suffix = $_POST['suffix']; // new suffix selected via combobox elseif (!$this->suffix) $this->suffix = $_SESSION["config"]->get_Suffix($this->type); // default suffix // check if LDAP data should be refreshed $this->refresh = true; diff --git a/lam/lib/modules.inc b/lam/lib/modules.inc index fedc0492..e107cec5 100644 --- a/lam/lib/modules.inc +++ b/lam/lib/modules.inc @@ -631,7 +631,7 @@ function parseHtml($module, $input, $values, $restricted, &$tabindex, &$tabindex // merge both option arrays and sort them. $options = array_merge ($input[$i][$j]['options'], $input[$i][$j]['options_selected'] ); $options = array_unique($options); - if (!$input[$i][$j]['noSorting']) { + if (!isset($input[$i][$j]['noSorting']) || !$input[$i][$j]['noSorting']) { sort($options); } foreach ($options as $option) { @@ -772,7 +772,7 @@ class accountContainer { */ function continue_main($post) { if ($this->subpage=='') $this->subpage='attributes'; - if ($post['form_main_reset']) { + if (isset($post['form_main_reset'])) { $this->load_account($this->dn_orig); } else { @@ -780,12 +780,12 @@ class accountContainer { if ($this->subpage=='attributes') { $result = 0; // change dn - if ($post['suffix']!='') $this->dn = $post['suffix']; + if (isset($post['suffix']) && ($post['suffix'] != '')) $this->dn = $post['suffix']; // change RDN if (isset($post['rdn'])) $this->rdn = $post['rdn']; // load profile - if ($post['selectLoadProfile'] && $post['loadProfile']) { + if (isset($post['selectLoadProfile']) && isset($post['loadProfile'])) { $profile = loadAccountProfile($post['selectLoadProfile'], $this->type); // pass profile to each module $modules = array_keys($this->module); @@ -801,7 +801,7 @@ class accountContainer { $result = 0; } // save account - if ($post['create']) { + if (isset($post['create'])) { $errors = $this->save_account(); if (is_array($errors)) { $result = array($errors); @@ -867,7 +867,7 @@ class accountContainer { } } // change module page if requested - if ($post['form_main_main']) { + if (isset($post['form_main_main'])) { $this->current_page = 0; $this->subpage='attributes'; } diff --git a/lam/lib/modules/inetOrgPerson.inc b/lam/lib/modules/inetOrgPerson.inc index c9b8cbe1..5e906b29 100644 --- a/lam/lib/modules/inetOrgPerson.inc +++ b/lam/lib/modules/inetOrgPerson.inc @@ -618,6 +618,7 @@ class inetOrgPerson extends baseModule { 'maxlength' => '255', 'value' => $this->attributes['employeeType'][0] ), 2 => array ('kind' => 'help', 'value' => 'employeeType')); if (isset($this->attributes['host'])) { + $hostvalue = ""; if (is_array($this->attributes['host'])) { $hostvalue .= implode(",", $this->attributes['host']); } @@ -647,7 +648,7 @@ class inetOrgPerson extends baseModule { // photo $photoFile = '../../graphics/userDefault.png'; $noPhoto = true; - if ($this->attributes['jpegPhoto'][0]) { + if (isset($this->attributes['jpegPhoto'][0])) { $jpeg_filename = 'jpg' . $_SESSION['ldap']->new_rand() . '.jpg'; $outjpeg = @fopen($_SESSION['lampath'] . 'tmp/' . $jpeg_filename, "wb"); fwrite($outjpeg, $this->attributes['jpegPhoto'][0]);