diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/dblayer.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/dblayer.php
index 240eda426..a96fd98ea 100644
--- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/dblayer.php
+++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/dblayer.php
@@ -41,4 +41,17 @@ class DBLayer{
}
}
+ public function executeReturnId($query,$params){
+ try{
+ $statement = $this->PDO->prepare($query);
+ $this->PDO->beginTransaction();
+ $statement->execute($params);
+ $lastId =$this->PDO->lastInsertId();
+ $this->PDO->commit();
+ return $lastId;
+ }catch (PDOException $e) {
+ throw $e;
+ }
+ }
+
}
\ No newline at end of file
diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/sync.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/sync.php
index 170a1c4bf..1c68b822b 100644
--- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/sync.php
+++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/sync.php
@@ -25,13 +25,27 @@ class Sync{
switch($record['type']) {
case 'createPermissions':
- case 'user_edit':
+ case 'change_pass':
+ $decode = json_decode($record['query']);
+ $values = array('user' => $decode[0], 'pass' => $decode[1]);
+ //make connection with and put into shard db & delete from the lib
+ $dbs->execute("SET Password = :pass WHERE Login = :user",$values);
+ $dbl->execute("DELETE FROM ams_querycache WHERE SID=:SID",array('SID' => $record['SID']));
+ break;
+ case 'change_mail':
+ $decode = json_decode($record['query']);
+ $values = array('user' => $decode[0], 'mail' => $decode[1]);
+ //make connection with and put into shard db & delete from the lib
+ $dbs->execute("SET Email = :mail WHERE Login = :user",$values);
+ $dbl->execute("DELETE FROM ams_querycache WHERE SID=:SID",array('SID' => $record['SID']));
+ break;
case 'createUser':
$decode = json_decode($record['query']);
- $query = array('login' => $decode[0], 'pass' => $decode[1], 'mail' => $decode[2] );
+ $values = array('login' => $decode[0], 'pass' => $decode[1], 'mail' => $decode[2] );
//make connection with and put into shard db & delete from the lib
- $dbs->execute("INSERT INTO user (Login, Password, Email) VALUES (:login, :pass, :mail)",$query);
+ $dbs->execute("INSERT INTO user (Login, Password, Email) VALUES (:login, :pass, :mail)",$values);
$dbl->execute("DELETE FROM ams_querycache WHERE SID=:SID",array('SID' => $record['SID']));
+ break;
}
}
print('Syncing completed');
diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket.php
new file mode 100644
index 000000000..f8f9f10e3
--- /dev/null
+++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket.php
@@ -0,0 +1,169 @@
+execute("SELECT * FROM ticket INNER JOIN ticket_user ON ticket.Author = ticket_user.TUserId and ticket_user.ExternId=:id", array('id' => $author));
+ $row = $statement->fetchAll();
+ $result = Array();
+ foreach($row as $ticket){
+ $instance = new self($db_data);
+ $instance->setTimestamp($ticket['Timestamp']);
+ $instance->setTitle($ticket['Title']);
+ $instance->setStatus($ticket['Status']);
+ $instance->setQueue($ticket['Queue']);
+ $instance->setTicket_Category($ticket['Ticket_Category']);
+ $instance->setAuthor($ticket['Author']);
+ $result[] = $instance;
+ }
+ return $result;
+ }
+
+
+ /*FUNCTION: create_Ticket()
+ * creates a ticket + first initial reply and fills in the content of it!
+ *
+ */
+ public static function create_Ticket( $title, $content, $category, $author, $db_data) {
+
+ $ticket = new Ticket($db_data);
+ $ticket->set($title,0,0,$category,$author);
+ $ticket->create();
+ $ticket_id = $ticket->getTId();
+
+
+ $ticket_content = new Ticket_Content($db_data);
+ $ticket_content->setContent($content);
+ $ticket_content->create();
+ $content_id = $ticket_content->getTContentId();
+
+
+ $ticket_reply = new Ticket_Reply($db_data);
+ $ticket_reply->set($ticket_id, $content_id, $author);
+ $ticket_reply->create();
+
+ }
+
+ ////////////////////////////////////////////Methods////////////////////////////////////////////////////
+ public function __construct($db_data) {
+ $this->db = $db_data;
+ }
+
+
+ //Set ticket object
+ public function set($t,$s,$q,$t_c,$a){
+ $this->title = $t;
+ $this->status = $s;
+ $this->queue = $q;
+ $this->ticket_category = $t_c;
+ $this->author = $a;
+ }
+
+ //create ticket by writing private data to DB.
+ public function create(){
+ $dbl = new DBLayer($this->db);
+ $query = "INSERT INTO ticket (Timestamp, Title, Status, Queue, Ticket_Category, Author) VALUES (now(), :title, :status, :queue, :tcat, :author)";
+ $values = Array('title' => $this->title, 'status' => $this->status, 'queue' => $this->queue, 'tcat' => $this->ticket_category, 'author' => $this->author);
+ $this->tId = $dbl->executeReturnId($query, $values); ;
+ }
+
+ //return constructed element based on TId
+ public function load_With_TId( $id) {
+ $dbl = new DBLayer($this->db);
+ $statement = $dbl->execute("SELECT * FROM ticket WHERE TId=:id", array('id' => $id));
+ $row = $statement->fetch();
+ $this->tId = $row['TId'];
+ $this->timestamp = $row['Timestamp'];
+ $this->title = $row['Title'];
+ $this->status = $row['Status'];
+ $this->queue = $row['Queue'];
+ $this->ticket_category = $row['Ticket_Category'];
+ $this->author = $row['Author'];
+ }
+
+
+ //update private data to DB.
+ public function update(){
+ $dbl = new DBLayer($this->db);
+ $query = "UPDATE ticket SET Timestamp = :timestamp, Title = :title, Status = :status, Queue = :queue, Ticket_Category = :tcat, Author = :author WHERE TId=:id";
+ $values = Array('id' => $this->tId, 'timestamp' => $this->timestamp, 'title' => $this->title, 'status' => $this->status, 'queue' => $this->queue, 'tcat' => $this->ticket_category, 'author' => $this->author);
+ $statement = $dbl->execute($query, $values);
+ }
+
+
+ ////////////////////////////////////////////Getters////////////////////////////////////////////////////
+
+ public function getTId(){
+ return $this->tId;
+ }
+
+ public function getTimestamp(){
+ return $this->timestamp;
+ }
+
+ public function getTitle(){
+ return $this->title;
+ }
+
+ public function getStatus(){
+ return $this->status;
+ }
+
+ public function getQueue(){
+ return $this->queue;
+ }
+
+ public function getTicket_Category(){
+ return $this->ticket_category;
+ }
+
+ public function getAuthor(){
+ return $this->author;
+ }
+
+ ////////////////////////////////////////////Setters////////////////////////////////////////////////////
+
+ public function setTId($id){
+ $this->tId = $id;
+ }
+
+ public function setTimestamp($ts){
+ $this->timestamp = $ts;
+ }
+
+ public function setTitle($t){
+ $this->title = $t;
+ }
+
+ public function setStatus($s){
+ $this->status = $s;
+ }
+
+ public function setQueue($q){
+ $this->queue = $q;
+ }
+
+ public function setTicket_Category($tc){
+ $this->ticket_category = $tc;
+ }
+
+ public function setAuthor($a){
+ $this->author = $a;
+ }
+
+}
\ No newline at end of file
diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_category.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_category.php
new file mode 100644
index 000000000..1fe7227b7
--- /dev/null
+++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_category.php
@@ -0,0 +1,94 @@
+ $name);
+ $dbl->execute($query, $values);
+
+ }
+
+
+ //return constructed element based on TCategoryId
+ public static function constr_TCategoryId( $id, $db_data) {
+ $instance = new self($db_data);
+ $instance->setTCategoryId($id);
+ return $instance;
+ }
+
+ //returns list of all category objects
+ public static function getAllCategories($db_data) {
+ $dbl = new DBLayer($db_data);
+ $statement = $dbl->executeWithoutParams("SELECT * FROM ticket_category");
+ $row = $statement->fetchAll();
+ $result = Array();
+ foreach($row as $category){
+ $instance = new self($db_data);
+ $instance->tCategoryId = $category['TCategoryId'];
+ $instance->name = $category['Name'];
+ $result[] = $instance;
+ }
+ return $result;
+ }
+
+
+ ////////////////////////////////////////////Methods////////////////////////////////////////////////////
+
+ public function __construct($db_data) {
+ $this->db = $db_data;
+ }
+
+ //return constructed element based on TCategoryId
+ public function load_With_TCategoryId( $id) {
+ $dbl = new DBLayer($this->db);
+ $statement = $dbl->execute("SELECT * FROM ticket_category WHERE TCategoryId=:id", array('id' => $id));
+ $row = $statement->fetch();
+ $this->tCategoryId = $row['TCategoryId'];
+ $this->name = $row['Name'];
+ }
+
+
+ //update private data to DB.
+ public function update(){
+ $dbl = new DBLayer($this->db);
+ $query = "UPDATE ticket_category SET Name = :name WHERE TCategoryId=:id";
+ $values = Array('id' => $this->tCategoryId, 'name' => $this->name);
+ $statement = $dbl->execute($query, $values);
+ }
+
+ ////////////////////////////////////////////Getters////////////////////////////////////////////////////
+
+ public function getName(){
+ if ($this->name == ""){
+ $this->load_With_TCategoryId($this->tCategoryId);
+ }
+ return $this->name;
+ }
+
+
+ public function getTCategoryId(){
+ return $this->tCategoryId;
+ }
+
+
+ ////////////////////////////////////////////Setters////////////////////////////////////////////////////
+
+ public function setName($n){
+ $this->name = $n;
+ }
+
+ public function setTCategoryId($id){
+ $this->tCategoryId = $id;
+ }
+
+
+}
\ No newline at end of file
diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_content.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_content.php
new file mode 100644
index 000000000..62130d1d9
--- /dev/null
+++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_content.php
@@ -0,0 +1,75 @@
+setTContentId($id);
+ return $instance;
+ }
+
+
+ ////////////////////////////////////////////Methods////////////////////////////////////////////////////
+
+ public function __construct($db_data) {
+ $this->db = $db_data;
+ }
+
+ //Creates a ticket_content entry in the DB
+ public function create() {
+ $dbl = new DBLayer($this->db);
+ $query = "INSERT INTO ticket_content (Content) VALUES (:content)";
+ $values = Array('content' => $this->content);
+ $this->tContentId = $dbl->executeReturnId($query, $values); ;
+ }
+
+ //return constructed element based on TContentId
+ public function load_With_TContentId( $id) {
+ $dbl = new DBLayer($this->db);
+ $statement = $dbl->execute("SELECT * FROM ticket_content WHERE TContentId=:id", array('id' => $id));
+ $row = $statement->fetch();
+ $this->tContentId = $row['TContentId'];
+ $this->content = $row['Content'];
+ }
+
+ //update private data to DB.
+ public function update(){
+ $dbl = new DBLayer($this->db);
+ $query = "UPDATE ticket_content SET Content = :content WHERE TContentId=:id";
+ $values = Array('id' => $this->tContentId, 'content' => $this->content);
+ $statement = $dbl->execute($query, $values);
+ }
+
+ ////////////////////////////////////////////Getters////////////////////////////////////////////////////
+
+ public function getContent(){
+ if ($this->content == ""){
+ $this->load_With_TContentId($this->tContentId);
+ }
+ return $this->content;
+ }
+
+
+ public function getTContentId(){
+ return $this->tContentId;
+ }
+
+
+ ////////////////////////////////////////////Setters////////////////////////////////////////////////////
+
+ public function setContent($c){
+ $this->content = $c;
+ }
+
+ public function setTContentId($c){
+ $this->tContentId = $c;
+ }
+
+}
\ No newline at end of file
diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_reply.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_reply.php
new file mode 100644
index 000000000..8f14a9f5f
--- /dev/null
+++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_reply.php
@@ -0,0 +1,110 @@
+setTReplyId($id);
+ return $instance;
+ }
+
+ ////////////////////////////////////////////Methods////////////////////////////////////////////////////
+
+ public function __construct($db_data) {
+ $this->db = $db_data;
+ }
+
+
+ //Set ticket_reply object
+ public function set($t,$c,$a){
+ $this->ticket = $t;
+ $this->content = $c;
+ $this->author = $a;
+ }
+
+ //create ticket by writing private data to DB.
+ public function create(){
+ $dbl = new DBLayer($this->db);
+ $query = "INSERT INTO ticket_reply (Ticket, Content, Author, Timestamp) VALUES (:ticket, :content, :author, now())";
+ $values = Array('ticket' => $this->ticket, 'content' => $this->content, 'author' => $this->author);
+ $dbl->execute($query, $values);
+ }
+
+ //return constructed element based on TId
+ public function load_With_TReplyId( $id) {
+ $dbl = new DBLayer($this->db);
+ $statement = $dbl->execute("SELECT * FROM ticket_reply WHERE TReplyId=:id", array('id' => $id));
+ $row = $statement->fetch();
+ $this->tReplyId = $row['TReplyId'];
+ $this->ticket = $row['Ticket'];
+ $this->content = $row['Content'];
+ $this->author = $row['Author'];
+ $this->timestamp = $row['Timestamp'];
+ }
+
+ //update private data to DB.
+ public function update(){
+ $dbl = new DBLayer($this->db);
+ $query = "UPDATE ticket SET Ticket = :ticket, Content = :content, Author = :author, Timestamp = :timestamp WHERE TReplyId=:id";
+ $values = Array('id' => $this->tReplyId, 'timestamp' => $this->timestamp, 'ticket' => $this->ticket, 'content' => $this->content, 'author' => $this->author);
+ $statement = $dbl->execute($query, $values);
+ }
+
+ ////////////////////////////////////////////Getters////////////////////////////////////////////////////
+
+ public function getTicket(){
+ return $this->ticket;
+ }
+
+
+ public function getContent(){
+ return $this->content;
+ }
+
+ public function getAuthor(){
+ return $this->author;
+ }
+
+ public function getTimestamp(){
+ return $this->timestamp;
+ }
+
+
+ public function getTReplyId(){
+ return $this->tReplyId;
+ }
+
+
+ ////////////////////////////////////////////Setters////////////////////////////////////////////////////
+
+ public function setTicket($t){
+ $this->ticket = $t;
+ }
+
+
+ public function setContent($c){
+ $this->content = $c;
+ }
+
+ public function setAuthor($a){
+ $this->author = $a;
+ }
+
+ public function setTimestamp($t){
+ $this->timestamp = $t;
+ }
+
+
+ public function setTReplyId($i){
+ $this->tReplyId = $i;
+ }
+}
\ No newline at end of file
diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_user.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_user.php
new file mode 100644
index 000000000..b61c99f68
--- /dev/null
+++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_user.php
@@ -0,0 +1,101 @@
+ $permission, 'ext_id' => $extern_id);
+ $dbl->execute($query, $values);
+
+ }
+
+
+ //return constructed element based on TUserId
+ public static function constr_TUserId( $id, $db_data) {
+ $instance = new self($db_data);
+ $instance->setTUserId($id);
+ return $instance;
+
+ }
+
+ //return constructed element based on ExternId
+ public static function constr_ExternId( $id, $db_data ) {
+ $instance = new self($db_data);
+ $dbl = new DBLayer($instance->db);
+ $statement = $dbl->execute("SELECT * FROM ticket_user WHERE ExternId=:id", array('id' => $id));
+ $row = $statement->fetch();
+ $instance->tUserId = $row['TUserId'];
+ $instance->permission = $row['Permission'];
+ $instance->externId = $row['ExternId'];
+ return $instance;
+
+ }
+
+
+ ////////////////////////////////////////////Methods////////////////////////////////////////////////////
+ public function __construct($db_data) {
+ $this->db = $db_data;
+ }
+
+ //return constructed element based on TUserId
+ public function load_With_TUserId( $id) {
+ $dbl = new DBLayer($this->db);
+ $statement = $dbl->execute("SELECT * FROM ticket_user WHERE TUserId=:id", array('id' => $id));
+ $row = $statement->fetch();
+ $instance->tUserId = $row['TUserId'];
+ $instance->permission = $row['Permission'];
+ $instance->externId = $row['ExternId'];
+ return $instance;
+ }
+
+ //update private data to DB.
+ public function update(){
+ $dbl = new DBLayer($this->db);
+ $query = "UPDATE ticket_user SET Permission = :perm, ExternId = :ext_id WHERE TUserId=:id";
+ $values = Array('id' => $this->tUserId, 'perm' => $this->permission, 'ext_id' => $this->externId);
+ $statement = $dbl->execute($query, $values);
+ }
+
+ ////////////////////////////////////////////Getters////////////////////////////////////////////////////
+
+ public function getPermission(){
+ if ($this->permission == ""){
+ $this->load_With_TUserId($this->tUserId);
+ }
+ return $this->permission;
+ }
+
+
+ public function getExternId(){
+ if ($this->ExternId == ""){
+ $this->load_With_TUserId($this->tUserId);
+ }
+ return $this->externId;
+ }
+
+
+ public function getTUserId(){
+ return $this->tUserId;
+ }
+
+
+ ////////////////////////////////////////////Setters////////////////////////////////////////////////////
+
+ public function setPermission($perm){
+ $this->permission = $perm;
+ }
+
+
+ public function setExternId($id){
+ $this->externId = $id;
+ }
+
+}
\ No newline at end of file
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 7373bc4a3..9ce16aa37 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
@@ -156,7 +156,7 @@ class Users{
* @takes $email
* @return
*/
- private function checkEmail( $email )
+ public function checkEmail( $email )
{
if ( isset( $email ) ){
if ( !Users::validEmail( $email ) ){
@@ -284,12 +284,13 @@ class Users{
* @takes $array with name,pass and mail
* @return ok if it's get correctly added to the shard, else return lib offline and put in libDB, if libDB is also offline return liboffline.
*/
- public function createUser($values){
+ public function createUser($values, $user_id){
try {
//make connection with and put into shard db
global $cfg;
$dbs = new DBLayer($cfg['db']['shard']);
$dbs->execute("INSERT INTO user (Login, Password, Email) VALUES (:name, :pass, :mail)",$values);
+ ticket_user::createTicketUser( $user_id , 1, $cfg['db']['lib'] );
return "ok";
}
catch (PDOException $e) {
@@ -298,6 +299,7 @@ class Users{
$dbl = new DBLayer($cfg['db']['lib']);
$dbl->execute("INSERT INTO ams_querycache (type, query) VALUES (:type, :query)",array("type" => "createUser",
"query" => json_encode(array($values["name"],$values["pass"],$values["mail"]))));
+ ticket_user::createTicketUser( $user_id , 1, $cfg['db']['lib'] );
return "shardoffline";
}catch (PDOException $e) {
print_r($e);
@@ -365,25 +367,51 @@ class Users{
}
}
- protected function setPassword($user, $pass){
+ protected function setAmsPassword($user, $pass){
+
+ global $cfg;
+ $values = Array('user' => $user, 'pass' => $pass);
+
try {
//make connection with and put into shard db
- global $cfg;
$dbs = new DBLayer($cfg['db']['shard']);
$dbs->execute("UPDATE user SET Password = :pass WHERE Login = :user ",$values);
return "ok";
}
catch (PDOException $e) {
//oh noooz, the shard is offline! Put in query queue at ams_lib db!
- /*try {
- $dbl = new DBLayer($cfg['db']['lib']);
- $dbl->execute("INSERT INTO ams_querycache (type, query) VALUES (:type, :query)",array("type" => "createUser",
- "query" => json_encode(array($values["name"],$values["pass"],$values["mail"]))));
+ try {
+ $dbl = new DBLayer($cfg['db']['lib']);
+ $dbl->execute("INSERT INTO ams_querycache (type, query) VALUES (:type, :query)",array("type" => "change_pass",
+ "query" => json_encode(array($values["user"],$values["pass"]))));
return "shardoffline";
}catch (PDOException $e) {
- print_r($e);
return "liboffline";
- }*/
+ }
+ }
+ }
+
+ protected function setAmsEmail($user, $mail){
+
+ global $cfg;
+ $values = Array('user' => $user, 'mail' => $mail);
+
+ try {
+ //make connection with and put into shard db
+ $dbs = new DBLayer($cfg['db']['shard']);
+ $dbs->execute("UPDATE user SET Email = :mail WHERE Login = :user ",$values);
+ return "ok";
+ }
+ catch (PDOException $e) {
+ //oh noooz, the shard is offline! Put in query queue at ams_lib db!
+ try {
+ $dbl = new DBLayer($cfg['db']['lib']);
+ $dbl->execute("INSERT INTO ams_querycache (type, query) VALUES (:type, :query)",array("type" => "change_mail",
+ "query" => json_encode(array($values["user"],$values["mail"]))));
+ return "shardoffline";
+ }catch (PDOException $e) {
+ return "liboffline";
+ }
}
}
}
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 56c07761f..858c3020f 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
@@ -20,14 +20,24 @@ name = "Name"
email = "Email"
action = "Action"
+[show_user]
+
+[createticket]
+
+[error]
+title404 = "Not
Found!"
+title403 = "Forbidden!"
+error_message404 = "This is not the page you are looking for.."
+error_message403 = "You cannot access this page!"
+go_home = "Go Home"
[userlist]
userlist_info = "welcome to the userlist"
[login]
login_info = "Please login with your Username and Password."
-login_error_message = "The filled in username/password were not correct!"
-login_register_message ="RegisterIf you dont have an account yet, create one"
+login_error_message = "The username/password were not correct!"
+login_register_message ="Register If you don't have an account yet, create one"
login_register_message_here = "here"
[logout]
@@ -67,6 +77,7 @@ email_tooltip = "Email Address to which a confirmation email will be sent."
email_message = "Please verify that the e-mail address you enter here is valid and will remain valid in the future. It will only be used to manage your Ryzom Core account."
email_default = "Email"
-tac_tag = "YES, I agree to the terms of service."
+tac_tag1= "YES, I agree to the "
+tac_tag2="terms of service"
tac_message = "You must accept the Terms of Service."
diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/fr.ini b/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/fr.ini
index 56c07b555..150a62c6b 100644
--- a/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/fr.ini
+++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/fr.ini
@@ -20,6 +20,17 @@ name = "Nom"
email = "Email"
action = "Action"
+[createticket]
+
+[show_user]
+
+[error]
+title404 = "Pas
trouvez!"
+title403 = "Interdit!"
+error_message404 = "Ce page que vous cherchez n'existe pas."
+error_message403 = "Vous n'avez pas permission d'access ce page!"
+go_home = "Allez au main page"
+
[userlist]
userlist_info = "bienvenue sur le userlist page!"
@@ -66,5 +77,6 @@ email_tooltip = "Adresse de courriel (pour qui un email de confirmation vous ser
email_message = "Veuillez vérifier que l'adresse e-mail que vous entrez ici est valable et restera valable à l'avenir. Elle ne sera utilisée que pour gérer votre compte de base de Ryzom."
email_default = "email"
-tac_tag = "OUI, j'accepte les termes de service."
+tac_tag1 = "OUI, j'accepte les "
+tac_tag2 = "termes de service"
tac_message = "Vous devez accepter les Conditions d'utilisation."
\ No newline at end of file
diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/autoload/webusers.php b/code/ryzom/tools/server/ryzom_ams/www/html/autoload/webusers.php
index 91c7bc317..6c22c57f8 100644
--- a/code/ryzom/tools/server/ryzom_ams/www/html/autoload/webusers.php
+++ b/code/ryzom/tools/server/ryzom_ams/www/html/autoload/webusers.php
@@ -50,7 +50,15 @@ class WebUsers extends Users{
}
}
-
+ public function getId($username){
+ global $cfg;
+
+ $dbw = new DBLayer($cfg['db']['web']);
+ $statement = $dbw->execute("SELECT * FROM ams_user WHERE Login=:username", array('username' => $username));
+ $row = $statement->fetch();
+ return $row['UId'];
+ }
+
public function getUsername($id){
global $cfg;
@@ -60,6 +68,25 @@ class WebUsers extends Users{
return $row['Login'];
}
+ public function getEmail($id){
+ global $cfg;
+
+ $dbw = new DBLayer($cfg['db']['web']);
+ $statement = $dbw->execute("SELECT * FROM ams_user WHERE UId=:id", array('id' => $id));
+ $row = $statement->fetch();
+ return $row['Email'];
+ }
+
+ public function getInfo($id){
+ global $cfg;
+
+ $dbw = new DBLayer($cfg['db']['web']);
+ $statement = $dbw->execute("SELECT * FROM ams_user WHERE UId=:id", array('id' => $id));
+ $row = $statement->fetch();
+ $result = Array('FirstName' => $row['FirstName'], 'LastName' => $row['LastName'], 'Gender' => $row['Gender'], 'Country' => $row['Country']);
+ return $result;
+ }
+
public function isLoggedIn(){
if(isset($_SESSION['user'])){
return true;
@@ -74,4 +101,40 @@ class WebUsers extends Users{
return false;
}
+ public function setPassword($user, $pass){
+ global $cfg;
+ $reply = WebUsers::setAmsPassword($user, $pass);
+ $values = Array('user' => $user, 'pass' => $pass);
+ try {
+ //make connection with and put into shard db
+ $dbw = new DBLayer($cfg['db']['web']);
+ $dbw->execute("UPDATE ams_user SET Password = :pass WHERE Login = :user ",$values);
+ }
+ catch (PDOException $e) {
+ //ERROR: the web DB is offline
+ }
+ return $reply;
+ }
+
+ public function setEmail($user, $mail){
+ global $cfg;
+ $reply = WebUsers::setAmsEmail($user, $mail);
+ $values = Array('user' => $user, 'mail' => $mail);
+ try {
+ //make connection with and put into shard db
+ $dbw = new DBLayer($cfg['db']['web']);
+ $dbw->execute("UPDATE ams_user SET Email = :mail WHERE Login = :user ",$values);
+ }
+ catch (PDOException $e) {
+ //ERROR: the web DB is offline
+ }
+ return $reply;
+ }
+
+ public function getUsers(){
+ global $cfg;
+ $dbl = new DBLayer($cfg['db']['web']);
+ $data = $dbl->executeWithoutParams("SELECT * FROM ams_user");
+ return $data;
+ }
}
\ No newline at end of file
diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/error.php b/code/ryzom/tools/server/ryzom_ams/www/html/error.php
index 4d701a543..b84bd7de7 100644
--- a/code/ryzom/tools/server/ryzom_ams/www/html/error.php
+++ b/code/ryzom/tools/server/ryzom_ams/www/html/error.php
@@ -73,7 +73,7 @@