From c7da1e61157c8639175411481b70d3f7d3d64fab Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Thu, 31 Jan 2013 10:29:40 +0200 Subject: [PATCH] fix for incorrect login --- web/login/index.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/web/login/index.php b/web/login/index.php index f26d96c2..a865e57f 100644 --- a/web/login/index.php +++ b/web/login/index.php @@ -33,6 +33,18 @@ if (isset($_POST['user']) && isset($_POST['password'])) { exec(VESTA_CMD ."v-check-user-password ".$v_user." ".$v_password." '".$_SERVER["REMOTE_ADDR"]."'", $output, $return_var); if ( $return_var > 0 ) { $ERROR = ""._('Invalid username or password').""; + // Set system language + exec (VESTA_CMD . "v-list-sys-config json", $output, $return_var); + $data = json_decode(implode('', $output), true); + if (!empty( $data['config']['LANGUAGE'])) { + $_SESSION['language'] = $data['config']['LANGUAGE']; + } else { + $_SESSION['language'] = 'en'; + } + + require_once($_SERVER['DOCUMENT_ROOT'].'/inc/i18n/'.$_SESSION['language'].'.php'); + require_once('../templates/header.html'); + require_once('../templates/login.html'); } else { unset($output); exec (VESTA_CMD . "v-list-user ".$v_user." json", $output, $return_var);