File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 33define ('NO_AUTH_REQUIRED ' ,true );
44
55
6-
76// Main include
87include ($ _SERVER ['DOCUMENT_ROOT ' ]."/inc/main.php " );
98
10- //echo $_SESSION['request_uri'];
11-
129
1310$ TAB = 'LOGIN ' ;
1411
1815}
1916
2017
18+
19+
2120// Login as someone else
2221if (isset ($ _SESSION ['user ' ])) {
2322 if ($ _SESSION ['user ' ] == 'admin ' && !empty ($ _GET ['loginas ' ])) {
7170 get_favourites ();
7271
7372 // Define language
74- if (!empty ($ data [$ v_user ]['LANGUAGE ' ])) $ _SESSION ['language ' ] = $ data [$ v_user ]['LANGUAGE ' ];
73+ $ output = '' ;
74+ exec (VESTA_CMD ."v-list-sys-languages json " , $ output , $ return_var );
75+ $ languages = json_decode (implode ('' , $ output ), true );
76+ if (in_array ($ data [$ v_user ]['LANGUAGE ' ], $ languages )){
77+ $ _SESSION ['language ' ] = $ data [$ v_user ]['LANGUAGE ' ];
78+ }
79+ else {
80+ $ _SESSION ['language ' ] = 'en ' ;
81+ }
82+
7583
7684 // Redirect request to control panel interface
7785 if (!empty ($ _SESSION ['request_uri ' ])) {
106114 if (in_array ($ lang , $ languages )){
107115 $ _SESSION ['language ' ] = $ lang ;
108116 }
117+ else {
118+ $ _SESSION ['language ' ] = 'en ' ;
119+ }
109120}
110121
111122require_once ($ _SERVER ['DOCUMENT_ROOT ' ].'/inc/i18n/ ' .$ _SESSION ['language ' ].'.php ' );
You can’t perform that action at this time.
0 commit comments