fix problem if no profile exists

This commit is contained in:
Roland Gruber 2013-01-05 16:22:58 +00:00
parent dba2d5e104
commit ec77917a9e
1 changed files with 15 additions and 11 deletions

View File

@ -84,7 +84,12 @@ elseif (!empty($default_Profile)) {
$_SESSION["config"] = new LAMConfig($default_Profile); // Create new Config object
}
$_SESSION['language'] = $_SESSION["config"]->get_defaultLanguage();
if (!empty($_SESSION["config"])) {
$_SESSION['language'] = $_SESSION["config"]->get_defaultLanguage();
}
else {
$_SESSION['language'] = 'en_GB.utf8:UTF-8:English (Great Britain)';
}
if (isset($_POST['language'])) {
$_SESSION['language'] = $_POST['language']; // Write selected language in session
}
@ -94,7 +99,6 @@ $_SESSION['header'] .= "<html>\n<head>\n";
$_SESSION['header'] .= "<meta http-equiv=\"content-type\" content=\"text/html; charset=" . $current_language[1] . "\">\n";
$_SESSION['header'] .= "<meta http-equiv=\"pragma\" content=\"no-cache\">\n <meta http-equiv=\"cache-control\" content=\"no-cache\">";
/**
* Displays the login window.
*
@ -246,16 +250,16 @@ function display_LoginPage($config_object) {
<br><br>
<?php
// check extensions
$extList = getRequiredExtensions();
for ($i = 0; $i < sizeof($extList); $i++) {
if (!extension_loaded($extList[$i])) {
StatusMessage("ERROR", "A required PHP extension is missing!", $extList[$i]);
echo "<br>";
}
}
// check TLS
if (!empty($config_object)) {
// check extensions
$extList = getRequiredExtensions();
for ($i = 0; $i < sizeof($extList); $i++) {
if (!extension_loaded($extList[$i])) {
StatusMessage("ERROR", "A required PHP extension is missing!", $extList[$i]);
echo "<br>";
}
}
// check TLS
$useTLS = $config_object->getUseTLS();
if (isset($useTLS) && ($useTLS == "yes")) {
if (!function_exists('ldap_start_tls')) {