less PHP notices

This commit is contained in:
Roland Gruber 2006-01-24 14:23:42 +00:00
parent 35a0fac1ab
commit 28d0a8e6b9
6 changed files with 15 additions and 12 deletions

View File

@ -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; $i<count($_SESSION['ldap']->objectClasses) || $i==-1; $i++) {
if (strpos(strtolower($_SESSION['ldap']->objectClasses[$i]), strtolower("NAME '".get_class($this)."'"))) $line = $i;

View File

@ -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;
}

View File

@ -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();

View File

@ -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;

View File

@ -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';
}

View File

@ -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]);