reduced PHP notices

This commit is contained in:
Roland Gruber 2008-07-20 15:41:12 +00:00
parent 1f6e60114d
commit 48949b42c7
1 changed files with 12 additions and 6 deletions

View File

@ -114,21 +114,27 @@ if ($_POST['submit']) {
$config = new LAMConfig($_POST['setprofile']); $config = new LAMConfig($_POST['setprofile']);
$config->set_Passwd($_POST['setpassword']); $config->set_Passwd($_POST['setpassword']);
$config->save(); $config->save();
$config = null;
$msg = _("New password set successfully."); $msg = _("New password set successfully.");
} }
else $error = _("Profile passwords are different or empty!"); else $error = _("Profile passwords are different or empty!");
} }
// set default profile // set default profile
elseif ($_POST['action'] == "setdefault") { elseif ($_POST['action'] == "setdefault") {
$config = new LAMCfgMain(); $configMain = new LAMCfgMain();
$config->default = $_POST['defaultfilename']; $configMain->default = $_POST['defaultfilename'];
$config->save(); $configMain->save();
$configMain = null;
$msg = _("New default profile set successfully."); $msg = _("New default profile set successfully.");
} }
// print messages // print messages
if ($error || $msg) { if (isset($error) || isset($msg)) {
if ($error) StatusMessage("ERROR", $error); if (isset($error)) {
if ($msg) StatusMessage("INFO", $msg); StatusMessage("ERROR", $error);
}
if (isset($msg)) {
StatusMessage("INFO", $msg);
}
} }
else exit; else exit;
} }