From 35b0cb7dbac21a7d03e41efbe0e395d89b014856 Mon Sep 17 00:00:00 2001 From: Quitta Date: Fri, 20 Sep 2013 05:33:39 +0200 Subject: [PATCH] Made it possible to redirect to a specific page after login in --- code/ryzom/client/src/client_cfg.cpp | 2 +- .../tools/server/ryzom_ams/www/html/func/login.php | 13 +++++++++++-- .../tools/server/ryzom_ams/www/html/inc/login.php | 8 ++++++++ .../ryzom/tools/server/ryzom_ams/www/html/index.php | 11 ++++++++++- .../server/ryzom_ams/www/html/templates/login.tpl | 2 +- 5 files changed, 31 insertions(+), 5 deletions(-) diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index bba2187cd..b06495c44 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -325,7 +325,7 @@ CClientConfig::CClientConfig() DisplayAccountButtons = true; CreateAccountURL = "http://shard.ryzomcore.org/ams/index.php?page=register"; ConditionsTermsURL = "https://secure.ryzom.com/signup/terms_of_use.php"; - EditAccountURL = "https://secure.ryzom.com/payment_profile/index.php"; + EditAccountURL = "http://shard.ryzomcore.org/ams/index.php?page=settings"; BetaAccountURL = "http://www.ryzom.com/profile"; ForgetPwdURL = "https://secure.ryzom.com/payment_profile/lost_secure_password.php"; FreeTrialURL = "http://www.ryzom.com/join/?freetrial=1"; diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/func/login.php b/code/ryzom/tools/server/ryzom_ams/www/html/func/login.php index 3c104e947..b0b6b5add 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/func/login.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/func/login.php @@ -21,12 +21,21 @@ function login(){ $_SESSION['ticket_user'] = serialize(Ticket_User::constr_ExternId($_SESSION['id'])); $user = new WebUsers($_SESSION['id']); $_SESSION['Language'] = $user->getLanguage(); + + $GETString = ""; + foreach($_GET as $key => $value){ + $GETString = $GETString . $key . '=' . $value . "&"; + } + if($GETString != ""){ + $GETString = '?'.$GETString; + } + //go back to the index page. if (Helpers::check_if_game_client()) { - header( 'Location: '. $INGAME_WEBPATH ); + header( 'Location: '. $INGAME_WEBPATH . $GETString); }else{ - header( 'Location: '. $WEBPATH ); + header( 'Location: '. $WEBPATH . $GETString); } exit; }else{ 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 4a52f0513..b40d3bc1d 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 @@ -26,6 +26,14 @@ function login(){ } } $pageElements['ingame_webpath'] = $INGAME_WEBPATH; + $GETString = ""; + foreach($_GET as $key => $value){ + $GETString = $GETString . $key . '=' . $value . "&"; + } + if($GETString != ""){ + $GETString = '?'.$GETString; + } + $pageElements['getstring'] = $GETString; return $pageElements; } diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/index.php b/code/ryzom/tools/server/ryzom_ams/www/html/index.php index dd8aa1c0b..b7b12e11b 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/index.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/index.php @@ -30,7 +30,16 @@ if ( ! isset( $_GET["page"]) ){ $page = 'login'; } }else{ - $page = $_GET["page"]; + if(isset($_SESSION['user'])){ + $page = $_GET["page"]; + }else{ + if($_GET["page"] == 'register'){ + $page = 'register'; + }else{ + $page = 'login'; + } + + } } //check if ingame & page= register diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/login.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/login.tpl index 2fbde3b50..15d18f3e3 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/login.tpl +++ b/code/ryzom/tools/server/ryzom_ams/www/html/templates/login.tpl @@ -12,7 +12,7 @@
{$login_info}
-
+