feedback on registering early version, also added an installer.php in the previous revision, forgot to mention that
--HG-- branch : quitta-gsoc-2013
This commit is contained in:
parent
5a163663cc
commit
c59e3d0b47
4 changed files with 50 additions and 4 deletions
|
@ -272,7 +272,7 @@ class Users{
|
||||||
|
|
||||||
try {
|
try {
|
||||||
//make connection with and put into shard db
|
//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);
|
$dbs->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||||
$statement = $dbs->prepare("INSERT INTO user (Login, Password, Email) VALUES (:name, :pass, :mail)");
|
$statement = $dbs->prepare("INSERT INTO user (Login, Password, Email) VALUES (:name, :pass, :mail)");
|
||||||
$statement->execute($values["params"]);
|
$statement->execute($values["params"]);
|
||||||
|
|
|
@ -5,6 +5,13 @@
|
||||||
|
|
||||||
[login]
|
[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]
|
[register]
|
||||||
title = "RYZOM CORE INGAME REGISTRATION"
|
title = "RYZOM CORE INGAME REGISTRATION"
|
||||||
welcome_message = "Welcome! Please fill in the following fields to get your new Ryzom Core account"
|
welcome_message = "Welcome! Please fill in the following fields to get your new Ryzom Core account"
|
||||||
|
|
|
@ -15,7 +15,11 @@ function add_user(){
|
||||||
'access' => $_SERVER['REQUEST_TIME']
|
'access' => $_SERVER['REQUEST_TIME']
|
||||||
);
|
);
|
||||||
//header( 'Location: email_sent.php' );
|
//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;
|
exit;
|
||||||
}else{
|
}else{
|
||||||
// pass error
|
// 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
|
//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);
|
$result = Users :: createUser($values);
|
||||||
|
|
||||||
try{
|
try{
|
||||||
|
@ -91,6 +96,7 @@ function write_user($newUser){
|
||||||
print_r($e);
|
print_r($e);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
print('Awesome');
|
|
||||||
}
|
return $result;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -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}
|
||||||
|
|
Loading…
Reference in a new issue