Skip to content

Commit c7da1e6

Browse files
committed
fix for incorrect login
1 parent 34ae5e8 commit c7da1e6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

web/login/index.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@
3333
exec(VESTA_CMD ."v-check-user-password ".$v_user." ".$v_password." '".$_SERVER["REMOTE_ADDR"]."'", $output, $return_var);
3434
if ( $return_var > 0 ) {
3535
$ERROR = "<a class=\"error\">"._('Invalid username or password')."</a>";
36+
// Set system language
37+
exec (VESTA_CMD . "v-list-sys-config json", $output, $return_var);
38+
$data = json_decode(implode('', $output), true);
39+
if (!empty( $data['config']['LANGUAGE'])) {
40+
$_SESSION['language'] = $data['config']['LANGUAGE'];
41+
} else {
42+
$_SESSION['language'] = 'en';
43+
}
44+
45+
require_once($_SERVER['DOCUMENT_ROOT'].'/inc/i18n/'.$_SESSION['language'].'.php');
46+
require_once('../templates/header.html');
47+
require_once('../templates/login.html');
3648
} else {
3749
unset($output);
3850
exec (VESTA_CMD . "v-list-user ".$v_user." json", $output, $return_var);

0 commit comments

Comments
 (0)