fixed PHP notices

This commit is contained in:
Roland Gruber 2008-04-24 18:50:02 +00:00
parent 29dbd62d87
commit e5f0cdbbf6
5 changed files with 17 additions and 18 deletions

View File

@ -673,7 +673,7 @@ class inetOrgPerson extends baseModule {
if ( !get_preg($this->attributes['title'][0], 'title')) $errors[] = $this->messages['title'][0]; if ( !get_preg($this->attributes['title'][0], 'title')) $errors[] = $this->messages['title'][0];
if ( !get_preg($this->attributes['employeeType'][0], 'employeeType')) $errors[] = $this->messages['employeeType'][0]; if ( !get_preg($this->attributes['employeeType'][0], 'employeeType')) $errors[] = $this->messages['employeeType'][0];
if ( !get_preg($this->attributes['businessCategory'][0], 'businessCategory')) $errors[] = $this->messages['businessCategory'][0]; if ( !get_preg($this->attributes['businessCategory'][0], 'businessCategory')) $errors[] = $this->messages['businessCategory'][0];
if ($_POST['userPassword']) { if (isset($_POST['userPassword'])) {
if ($_POST['userPassword'] != $_POST['userPassword2']) { if ($_POST['userPassword'] != $_POST['userPassword2']) {
$errors[] = $this->messages['userPassword'][0]; $errors[] = $this->messages['userPassword'][0];
} }
@ -692,7 +692,9 @@ class inetOrgPerson extends baseModule {
} }
} }
} }
if ($_POST['delPhoto']) $this->attributes['jpegPhoto'] = array(); if (isset($_POST['delPhoto'])) {
$this->attributes['jpegPhoto'] = array();
}
// Return error-messages // Return error-messages
return $errors; return $errors;
} }

View File

@ -193,6 +193,9 @@ class phpGroupwareUser extends baseModule {
* @return array list of info/error messages * @return array list of info/error messages
*/ */
public function process_attributes() { public function process_attributes() {
if (isset($this->attributes['objectClass']) && in_array('phpgwAccount', $this->attributes['objectClass'])) {
$this->attributes['phpgwAccountStatus'][0] = $_POST['phpgwAccountStatus'];
}
if (isset($_POST['form_subpage_phpGroupwareUser_attributes_addObjectClass'])) { if (isset($_POST['form_subpage_phpGroupwareUser_attributes_addObjectClass'])) {
$this->attributes['objectClass'][] = 'phpgwAccount'; $this->attributes['objectClass'][] = 'phpgwAccount';
$this->attributes['phpgwAccountExpires'][0] = "-1"; $this->attributes['phpgwAccountExpires'][0] = "-1";
@ -205,9 +208,6 @@ class phpGroupwareUser extends baseModule {
} }
} }
} }
if (isset($this->attributes['objectClass']) && in_array('phpgwAccount', $this->attributes['objectClass'])) {
$this->attributes['phpgwAccountStatus'][0] = $_POST['phpgwAccountStatus'];
}
return array(); return array();
} }

View File

@ -48,7 +48,7 @@ if (isset($_POST['passwd'])) $passwd = $_POST['passwd'];
// check if password was entered // check if password was entered
// if not: load login page // if not: load login page
if (!$passwd && !isset($_SESSION['conf_isAuthenticated'])) { if (!isset($passwd) && !isset($_SESSION['conf_isAuthenticated'])) {
$_SESSION['conf_message'] = _("No password was entered!"); $_SESSION['conf_message'] = _("No password was entered!");
/** go back to login if password is empty */ /** go back to login if password is empty */
require('conflogin.php'); require('conflogin.php');
@ -62,7 +62,7 @@ $conf = &$_SESSION['conf_config'];
// check if password is valid // check if password is valid
// if not: load login page // if not: load login page
if (!$conf->check_Passwd($passwd) && !($_SESSION['conf_isAuthenticated'] === $conf->getName())) { if ((!isset($_SESSION['conf_isAuthenticated']) || !($_SESSION['conf_isAuthenticated'] === $conf->getName())) && !$conf->check_Passwd($passwd)) {
$sessionKeys = array_keys($_SESSION); $sessionKeys = array_keys($_SESSION);
for ($i = 0; $i < sizeof($sessionKeys); $i++) { for ($i = 0; $i < sizeof($sessionKeys); $i++) {
if (substr($sessionKeys[$i], 0, 5) == "conf_") unset($_SESSION[$sessionKeys[$i]]); if (substr($sessionKeys[$i], 0, 5) == "conf_") unset($_SESSION[$sessionKeys[$i]]);
@ -77,21 +77,21 @@ $_SESSION['conf_isAuthenticated'] = $conf->getName();
// check if button was pressed and if we have to save the setting or go back to login // check if button was pressed and if we have to save the setting or go back to login
if (isset($_POST['back']) || isset($_POST['submitconf']) || isset($_POST['editmodules']) || isset($_POST['edittypes'])){ if (isset($_POST['back']) || isset($_POST['submitconf']) || isset($_POST['editmodules']) || isset($_POST['edittypes'])){
// go to final page // go to final page
if ($_POST['submitconf']){ if (isset($_POST['submitconf'])){
saveSettings(); saveSettings();
} }
// go to modules page // go to modules page
elseif ($_POST['editmodules']){ elseif (isset($_POST['editmodules'])){
metaRefresh("confmodules.php"); metaRefresh("confmodules.php");
exit; exit;
} }
// go to types page // go to types page
elseif ($_POST['edittypes']){ elseif (isset($_POST['edittypes'])){
metaRefresh("conftypes.php"); metaRefresh("conftypes.php");
exit; exit;
} }
// back to login // back to login
else if ($_POST['back']){ else if (isset($_POST['back'])){
metaRefresh("../login.php"); metaRefresh("../login.php");
exit; exit;
} }
@ -465,9 +465,6 @@ echo ("<p>&nbsp;</p>");
echo ("<p>* = ". _("required") . "</p>"); echo ("<p>* = ". _("required") . "</p>");
// password for configuration
echo ("<p><input type=\"hidden\" name=\"passwd\" value=\"" . $passwd . "\"></p>\n");
echo ("</form>\n"); echo ("</form>\n");
echo ("</body>\n"); echo ("</body>\n");
echo ("</html>\n"); echo ("</html>\n");
@ -560,7 +557,7 @@ function saveSettings() {
} }
// checkboxes // checkboxes
elseif ($_SESSION['conf_types'][$element] == "checkbox") { elseif ($_SESSION['conf_types'][$element] == "checkbox") {
if ($_POST[$element] == "on") $options[$element] = array('true'); if (isset($_POST[$element]) && ($_POST[$element] == "on")) $options[$element] = array('true');
else $options[$element] = array('false'); else $options[$element] = array('false');
} }
// dropdownbox // dropdownbox

View File

@ -67,7 +67,7 @@ if (isset($_POST['postAvailable'])) {
$errors = array(); $errors = array();
// user pressed submit/abort button // user pressed submit/abort button
if ($_POST['submit']) { if (isset($_POST['submit'])) {
// check settings // check settings
$allOK = true; $allOK = true;
$postKeys = array_keys($_POST); $postKeys = array_keys($_POST);
@ -111,7 +111,7 @@ if ($_POST['submit']) {
} }
} }
// no changes // no changes
elseif ($_POST['abort']) { elseif (isset($_POST['abort'])) {
$_SESSION['conf_accountTypes'] = $_SESSION['conf_accountTypesOld']; $_SESSION['conf_accountTypes'] = $_SESSION['conf_accountTypesOld'];
metarefresh('confmain.php?typesback=true'); metarefresh('confmain.php?typesback=true');
exit; exit;

View File

@ -70,7 +70,7 @@ echo $_SESSION['header'];
<?php <?php
// check if submit button was pressed // check if submit button was pressed
if ($_POST['submit']) { if (isset($_POST['submit'])) {
// remove double slashes if magic quotes are on // remove double slashes if magic quotes are on
if (get_magic_quotes_gpc() == 1) { if (get_magic_quotes_gpc() == 1) {
$postKeys = array_keys($_POST); $postKeys = array_keys($_POST);