Skip to content

Commit

Permalink
fix for incorrect login
Browse files Browse the repository at this point in the history
  • Loading branch information
serghey-rodin committed Jan 31, 2013
1 parent 34ae5e8 commit c7da1e6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions web/login/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@
exec(VESTA_CMD ."v-check-user-password ".$v_user." ".$v_password." '".$_SERVER["REMOTE_ADDR"]."'", $output, $return_var);
if ( $return_var > 0 ) {
$ERROR = "<a class=\"error\">"._('Invalid username or password')."</a>";
// 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);
Expand Down

0 comments on commit c7da1e6

Please sign in to comment.