From 0a3020e9715b99e0242b86d714d228ae14180332 Mon Sep 17 00:00:00 2001 From: Botanic Date: Wed, 5 Jun 2013 23:39:33 -0700 Subject: [PATCH] added in-game template file --HG-- branch : rc-botanic-webdev --- .../ryzom_ams/ams_lib/autoload/helpers.php | 24 +++- .../ams_lib/ingame_templates/register.phtml | 117 ++++++++++++++++ .../ryzom_ams/www/html/autoload/register.php | 132 +++++++++--------- 3 files changed, 202 insertions(+), 71 deletions(-) create mode 100644 code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/register.phtml 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 16381ef98..2596d5c26 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 @@ -1,10 +1,20 @@ + aRYZOM CORE INGAME REGISTRATION + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + You must accept the Terms of Service';} + else { + echo ' +
id="caption-Username">Desired Username: + + width="42%">
id="caption-Password">Desired Password: + + width="42%">
id="caption-ConfirmPass">Confirm Password: + width="42%">
id="caption-Email">Email Address (to which a confirmation email will be sent): + account.', this);" /> + width="42%">
+ colspan="2">YES, I agree to the terms of + service';}; ?> +
+ +
+ +
+ +
+ +
+ +
+ 5-12 lower-case characters and numbers. The login (username) you create here will be + your login name. The name of your game characters will be chosen later on. +
+ +
+ 5-20 characters. +
+ +
+ Retype your Password +
+ +
+ Please verify that the e-mail address you enter here is valid and will remain valid + in the future. It will be used to manage your account. +
+ +
\ No newline at end of file diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/autoload/register.php b/code/ryzom/tools/server/ryzom_ams/www/html/autoload/register.php index 2532785bd..3821ccc3d 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/autoload/register.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/autoload/register.php @@ -1,67 +1,71 @@ $_POST["Username"], - 'pass' => $_POST["Password"], - 'mail' => $_POST["Email"], - 'init' => $_POST["Email"], - 'unhashpass' => $_POST["Password"], - 'status' => 1, - 'access' => REQUEST_TIME - ); - user_save(NULL, $edit); - header('Location: email_sent.php'); - exit; - } else { - $pageElements = array( - 'GAME_NAME' => $GAME_NAME, - 'WELCOME_MESSAGE' => $WELCOME_MESSAGE, - 'USERNAME' => $user, - 'PASSWORD' => $pass, - 'CPASSWORD' => $cpass, - 'EMAIL' => $email - ); - if ($user != "success") { - $pageElements['USERNAME_ERROR'] = 'TRUE'; - } else { - $pageElements['USERNAME_ERROR'] = 'FALSE'; - } - - if ($pass != "success") { - $pageElements['PASSWORD_ERROR'] = 'TRUE'; - } else { - $pageElements['PASSWORD_ERROR'] = 'FALSE'; - } - if ($cpass != "success") { - $pageElements['CPASSWORD_ERROR'] = 'TRUE'; - } else { - $pageElements['CPASSWORD_ERROR'] = 'FALSE'; - } - if ($email != "success") { - $pageElements['EMAIL_ERROR'] = 'TRUE'; - } else { - $pageElements['EMAIL_ERROR'] = 'FALSE'; - } - if (isset($_POST["TaC"])) { - $pageElements['TAC_ERROR'] = 'FALSE'; - } else { - $pageElements['TAC_ERROR'] = 'TRUE'; - } - helpers::loadtemplate('templates/register.phtml',$pageElements); - } + // check values + $user = users :: checkUser( $_POST["Username"] ); + $pass = users :: checkPassword( $_POST["Password"] ); + $cpass = users :: confirmPassword(); + $email = users :: checkEmail( $_POST["Email"] ); + }else{ + $user = ""; + $pass = ""; + $cpass = ""; + $email = ""; + } + // if all are good then create user +if ( ( $user == "success" ) and ( $pass == "success" ) and ( $cpass == "success" ) and ( $email == "success" ) and ( isset( $_POST["TaC"] ) ) ){ + $edit = array( + 'name' => $_POST["Username"], + 'pass' => $_POST["Password"], + 'mail' => $_POST["Email"], + 'init' => $_POST["Email"], + 'unhashpass' => $_POST["Password"], + 'status' => 1, + 'access' => REQUEST_TIME + ); + user_save( NULL, $edit ); + header( 'Location: email_sent.php' ); + exit; + }else{ + $pageElements = array( + 'GAME_NAME' => $GAME_NAME, + 'WELCOME_MESSAGE' => $WELCOME_MESSAGE, + 'USERNAME' => $user, + 'PASSWORD' => $pass, + 'CPASSWORD' => $cpass, + 'EMAIL' => $email + ); + if ( $user != "success" ){ + $pageElements['USERNAME_ERROR'] = 'TRUE'; + }else{ + $pageElements['USERNAME_ERROR'] = 'FALSE'; + } + + if ( $pass != "success" ){ + $pageElements['PASSWORD_ERROR'] = 'TRUE'; + }else{ + $pageElements['PASSWORD_ERROR'] = 'FALSE'; + } + if ( $cpass != "success" ){ + $pageElements['CPASSWORD_ERROR'] = 'TRUE'; + }else{ + $pageElements['CPASSWORD_ERROR'] = 'FALSE'; + } + if ( $email != "success" ){ + $pageElements['EMAIL_ERROR'] = 'TRUE'; + }else{ + $pageElements['EMAIL_ERROR'] = 'FALSE'; + } + if ( isset( $_POST["TaC"] ) ){ + $pageElements['TAC_ERROR'] = 'FALSE'; + }else{ + $pageElements['TAC_ERROR'] = 'TRUE'; + } + if ( helpers :: check_if_game_client() ){ + helpers :: loadtemplate( '../../ams_lib/ingame_templates/register.phtml', $pageElements ); + }else{ + helpers :: loadtemplate( 'templates/register.phtml', $pageElements ); + } + }