From 6d745f58e0a48430534d388211ab20337e44a32b Mon Sep 17 00:00:00 2001 From: Quitta Date: Wed, 26 Jun 2013 04:03:16 +0200 Subject: [PATCH] feedback on registering early version, also added an installer.php in the previous revision, forgot to mention that --- .../ryzom_ams/ams_lib/autoload/users.php | 2 +- .../ryzom_ams/ams_lib/translations/en.ini | 7 ++++ .../ryzom_ams/www/html/inc/add_user.php | 12 +++++-- .../www/html/templates/register_feedback.tpl | 33 +++++++++++++++++++ 4 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 code/ryzom/tools/server/ryzom_ams/www/html/templates/register_feedback.tpl diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/users.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/users.php index cc42c8f86..f2820f468 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/users.php +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/users.php @@ -272,7 +272,7 @@ class Users{ try { //make connection with and put into shard db - $dbs = new PDO("mysql:host='127.0.39.3';port=$shardport;dbname=$sharddbname", $shardusername, $shardpassword); + $dbs = new PDO("mysql:host=$shardhost;port=$shardport;dbname=$sharddbname", $shardusername, $shardpassword); $dbs->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $statement = $dbs->prepare("INSERT INTO user (Login, Password, Email) VALUES (:name, :pass, :mail)"); $statement->execute($values["params"]); diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/en.ini b/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/en.ini index af9f29d05..24d3dc845 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/en.ini +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/en.ini @@ -5,6 +5,13 @@ [login] +[register_feedback] +status_ok = "You registered like a baws!" +status_shardoffline = "It seems the shard is offline, you can use the web-account, but you will need to wait for the shard." +status_liboffline = "You can't register an account at this time" +login_title = "Next step: Login" +login_text = "Click here if you want to log in!" + [register] title = "RYZOM CORE INGAME REGISTRATION" welcome_message = "Welcome! Please fill in the following fields to get your new Ryzom Core account" diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/inc/add_user.php b/code/ryzom/tools/server/ryzom_ams/www/html/inc/add_user.php index 8a13a8614..64733ddb2 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/inc/add_user.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/inc/add_user.php @@ -15,7 +15,11 @@ function add_user(){ 'access' => $_SERVER['REQUEST_TIME'] ); //header( 'Location: email_sent.php' ); - write_user( $edit ); + $status = write_user( $edit ); + $pageElements['status'] = $status; + //TODO: perhaps send email! + $pageElements['no_visible_elements'] = 'TRUE'; + helpers :: loadtemplate( 'register_feedback', $pageElements); exit; }else{ // pass error @@ -77,6 +81,7 @@ function write_user($newUser){ //Create the user on the shard + in case shard is offline put copy of query in query db + //returns ok, shardoffline or liboffline $result = Users :: createUser($values); try{ @@ -91,6 +96,7 @@ function write_user($newUser){ print_r($e); exit; } - print('Awesome'); - } + + return $result; +} diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/register_feedback.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/register_feedback.tpl new file mode 100644 index 000000000..43a227eac --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/www/html/templates/register_feedback.tpl @@ -0,0 +1,33 @@ +{extends file="layout.tpl"} +{block name=content} + +
+ +
+ +
+ +
+{/block} +