feedback on registering early version, also added an installer.php in the previous revision, forgot to mention that

This commit is contained in:
Quitta 2013-06-26 04:03:16 +02:00
parent fc7bab9506
commit 8735e2f7e6
4 changed files with 50 additions and 4 deletions

View file

@ -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"]);

View file

@ -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"

View file

@ -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;
}

View file

@ -0,0 +1,33 @@
{extends file="layout.tpl"}
{block name=content}
<div class="row-fluid">
<div class="span12 center login-header">
<img src="img/mainlogo.png"/>
</div><!--/span-->
</div><!--/row-->
<div class="row-fluid">
<div class="well span5 center login-box">
{if isset($status) and $status eq "ok"}
<div class="alert alert-success">
{$status_ok}
</div>
{else if isset($status) and $status eq "shardoffline"}
<div class="alert alert-error">
{$status_shardoffline}
</div>
{else if isset($status) and $status eq "liboffline"}
<div class="alert alert-error">
{$status_liboffline}
</div>
{/if}
<div class="alert alert-info">
<strong>{$login_title}</strong>
<a href="index.php?page=register">{$login_text}</a>
</div>
</div><!--/span-->
</div>
{/block}