mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 18:49:17 -07:00
Detect user language
This commit is contained in:
parent
05b76fefb2
commit
2bd84f00f9
6 changed files with 72 additions and 13 deletions
|
@ -74,14 +74,8 @@ if ((!empty($_POST['user'])) && (!empty($_POST['code'])) && (!empty($_POST['pass
|
|||
}
|
||||
}
|
||||
|
||||
// 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';
|
||||
}
|
||||
// Detect language
|
||||
if (empty($_SESSION['language'])) $_SESSION['language'] = detect_user_language();
|
||||
|
||||
if (empty($_GET['action'])) {
|
||||
require_once '../templates/header.html';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue