From c6040d285321cd1149ca1d663832620fa7d20e52 Mon Sep 17 00:00:00 2001 From: DJanssens Date: Wed, 31 Jul 2013 15:08:35 -0700 Subject: [PATCH] autologin works --HG-- branch : quitta-gsoc-2013 --- .../ryzom/tools/server/ryzom_ams/ams_lib/autoload/helpers.php | 3 ++- code/ryzom/tools/server/ryzom_ams/www/html/inc/login.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/helpers.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/helpers.php index 0067881ba..9af0f379b 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/helpers.php +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/helpers.php @@ -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'])); if ($statement->rowCount() ){ $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{ return "FALSE"; } diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/inc/login.php b/code/ryzom/tools/server/ryzom_ams/www/html/inc/login.php index 5b635859a..38a9ab5d8 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/inc/login.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/inc/login.php @@ -6,11 +6,11 @@ function login(){ if( $result != "FALSE"){ //handle successful login $_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']); //go back to the index page. header( 'Location: index.php' ); exit; } } -} \ No newline at end of file +}