autologin works
This commit is contained in:
parent
b3b39bd15f
commit
70a98da8a8
2 changed files with 4 additions and 3 deletions
|
@ -123,7 +123,8 @@ class Helpers{
|
||||||
$statement = $dbr->execute("SELECT * FROM ring_users WHERE user_id=:id AND cookie =:cookie", array('id' => $id, 'cookie' => $_COOKIE['ryzomId']));
|
$statement = $dbr->execute("SELECT * FROM ring_users WHERE user_id=:id AND cookie =:cookie", array('id' => $id, 'cookie' => $_COOKIE['ryzomId']));
|
||||||
if ($statement->rowCount() ){
|
if ($statement->rowCount() ){
|
||||||
$entry = $statement->fetch();
|
$entry = $statement->fetch();
|
||||||
return array('id' => $id, 'name' => $entry['user_name']);
|
//print_r($entry);
|
||||||
|
return array('id' => $entry['user_id'], 'name' => $entry['user_name']);
|
||||||
}else{
|
}else{
|
||||||
return "FALSE";
|
return "FALSE";
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,11 +6,11 @@ function login(){
|
||||||
if( $result != "FALSE"){
|
if( $result != "FALSE"){
|
||||||
//handle successful login
|
//handle successful login
|
||||||
$_SESSION['user'] = $result['name'];
|
$_SESSION['user'] = $result['name'];
|
||||||
$_SESSION['id'] = WebUsers::getId($result['id']);
|
$_SESSION['id'] = WebUsers::getId($result['name']);
|
||||||
$_SESSION['ticket_user'] = Ticket_User::constr_ExternId($_SESSION['id']);
|
$_SESSION['ticket_user'] = Ticket_User::constr_ExternId($_SESSION['id']);
|
||||||
//go back to the index page.
|
//go back to the index page.
|
||||||
header( 'Location: index.php' );
|
header( 'Location: index.php' );
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue