From 5c752f71e9bd07d2e8f9ffd4b246cf4216c7a85f Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Thu, 18 Sep 2014 09:15:24 +0200 Subject: Fix a serie of undefined index (app/install.php) --- app/install.php | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) (limited to 'app/install.php') diff --git a/app/install.php b/app/install.php index 362ffec48..4449cd063 100644 --- a/app/install.php +++ b/app/install.php @@ -149,7 +149,7 @@ function saveStep2() { $config_array = array( 'language' => $_SESSION['language'], - 'theme' => $_SESSION['theme'], + 'theme' => 'Origine', 'old_entries' => $_SESSION['old_entries'], 'mail_login' => $_SESSION['mail_login'], 'passwordHash' => $_SESSION['passwordHash'], @@ -337,9 +337,15 @@ function checkStep2() { isset($_SESSION['mail_login']) && !empty($_SESSION['default_user']); - $form = $_SESSION['auth_type'] != 'form' || !empty($_SESSION['passwordHash']); + $form = ( + isset($_SESSION['auth_type']) && + ($_SESSION['auth_type'] != 'form' || !empty($_SESSION['passwordHash'])) + ); - $persona = $_SESSION['auth_type'] != 'persona' || !empty($_SESSION['mail_login']); + $persona = ( + isset($_SESSION['auth_type']) && + ($_SESSION['auth_type'] != 'persona' || !empty($_SESSION['mail_login'])) + ); $defaultUser = empty($_POST['default_user']) ? null : $_POST['default_user']; if ($defaultUser === null) { @@ -600,16 +606,17 @@ function printStep2() {
- - - - - + + + +
@@ -618,7 +625,7 @@ function printStep2() {
- /> + />
@@ -628,7 +635,7 @@ function printStep2() {
- /> + />
@@ -653,7 +660,7 @@ function printStep2() { toggles[i].addEventListener('click', toggle_password); } - function auth_type_change() { + function auth_type_change(focus) { var auth_value = document.getElementById('auth_type').value, password_input = document.getElementById('passwordPlain'), mail_input = document.getElementById('mail_login'); @@ -661,15 +668,21 @@ function printStep2() { if (auth_value === 'form') { password_input.required = true; mail_input.required = false; + if (focus) { + password_input.focus(); + } } else if (auth_value === 'persona') { password_input.required = false; mail_input.required = true; + if (focus) { + mail_input.focus(); + } } else { password_input.required = false; mail_input.required = false; } } - auth_type_change(); + auth_type_change(false);
-- cgit v1.2.3