diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/createticket.tpl b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/createticket.tpl
new file mode 100644
index 000000000..ec79cc661
--- /dev/null
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/createticket.tpl
@@ -0,0 +1,101 @@
+{block name=content}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Tickets
+
+
+
+
+
+
+ ID
+ Title
+ Assigned
+ Timestamp
+ Category
+ Status
+ SupportGroup
+ Actions
+
+ {foreach from=$tickets item=ticket}
+
+ {$ticket.tId}
+ {$ticket.title}
+ {if $ticket.assignedText neq ""} {$ticket.assignedText} {else} {$not_assigned} {/if}
+ {$ticket.timestamp}
+ {$ticket.category}
+ {if $ticket.status eq 0}{else if $ticket.status eq 1}{else if $ticket.status eq 2}{/if}{$ticket.statusText}
+
+
+ {if $ticket.forwardedGroupName eq "0"}
+ {$public_sgroup}
+ {else}
+ {$ticket.forwardedGroupName}
+ {/if}
+
+
+
+ {if $ticket.assigned eq 0}
+
+ {else if $ticket.assigned eq $user_id}
+
+ {/if}
+
+
+ {/foreach}
+
+
+
+
+
+
+ «
+ {foreach from=$links item=link}
+ {$link}
+ {/foreach}
+ »
+
+
+
+
+
+ {if isset($ACTION_RESULT)}
+
+
+
+
+
+ {if isset($ACTION_RESULT) and $ACTION_RESULT eq "SUCCESS_ASSIGNED"}
+
+ {$success_assigned}
+
+ {else if isset($ACTION_RESULT) and $ACTION_RESULT eq "SUCCESS_UNASSIGNED"}
+
+ {$success_unassigned}
+
+ {else if isset($ACTION_RESULT) and $ACTION_RESULT eq "TICKET_NOT_EXISTING"}
+
+ {$ticket_not_existing}
+
+ {else if isset($ACTION_RESULT) and $ACTION_RESULT eq "ALREADY_ASSIGNED"}
+
+ {$ticket_already_assigned}
+
+ {else if isset($ACTION_RESULT) and $ACTION_RESULT eq "NOT_ASSIGNED"}
+
+ {$ticket_not_assigned}
+
+ {/if}
+
+
+
+
+
+
+
+
+
+
+
+
+{/block}
+
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/show_reply.tpl b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/show_reply.tpl
new file mode 100644
index 000000000..9b0a6296a
--- /dev/null
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/show_reply.tpl
@@ -0,0 +1,88 @@
+{block name=content}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{/block}
+
+
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/show_sgroup.tpl b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/show_sgroup.tpl
new file mode 100644
index 000000000..2f0c29695
--- /dev/null
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/show_sgroup.tpl
@@ -0,0 +1,171 @@
+{block name=content}
+
+
+
+
+
+
+ Support Group: {$groupsname}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Add user to the list
+ {if isset($isAdmin) && $isAdmin eq 'TRUE'}
+
+ {/if}
+
+
+
+
+
+
+
+
+
+
+
All members
+
+
+ ID
+ Name
+ {if isset($isAdmin) && $isAdmin eq 'TRUE'}Action {/if}
+
+
+ {foreach from=$userlist item=user}
+
+ {$user.tUserId}
+ {$user.name}
+ {if isset($isAdmin) && $isAdmin eq 'TRUE'}Delete {/if}
+
+ {/foreach}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{/block}
+
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/show_ticket.tpl b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/show_ticket.tpl
new file mode 100644
index 000000000..97f1d3c53
--- /dev/null
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/show_ticket.tpl
@@ -0,0 +1,285 @@
+{block name=content}
+
+
+
+
+
+
+
+
+
+ [{$t_title}-#{$ticket_tId}] {$ticket_title}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Submitted: {$ticket_timestamp}
+ Last Updated: {$ticket_lastupdate}
+ Status: {if $ticket_status neq 3}Open {/if} {if $ticket_status eq 3} {$ticket_statustext} {else}{$ticket_statustext} {/if}
+
+
+ Category: {$ticket_category}
+ Priority {$ticket_prioritytext}
+ Support Group:
+
+ {if $ticket_forwardedGroupName eq "0"}
+ {$public_sgroup}
+ {else}
+ {$ticket_forwardedGroupName}
+ {/if}
+
+
+
+
+ Assigned To: {if $ticket_assignedTo neq ""} {$ticket_assignedToText} {else} {$not_assigned} {/if}
+
+
+
+
+
+
+
+
+
+ {foreach from=$ticket_replies item=reply}
+
+
+
+
+
+ {/foreach}
+
+ {if $ticket_status eq 3}
+
+
+
+
+
[Ticket is closed]
+
+
+
+
+ {/if}
+
+
+
+
+
+
+
+
+
+
+ {if isset($isMod) and $isMod eq "TRUE"}
+
+
+
+
+
+
+
+ Ticket Assigning:
+ {if $ticket_assignedTo eq 0}
+
+
+
+
+
+ {else if $ticket_assignedTo eq $user_id}
+
+
+
+
+
+ {/if}
+
+ {if isset($ACTION_RESULT) and $ACTION_RESULT eq "SUCCESS_ASSIGNED"}
+
+ {$success_assigned}
+
+ {else if isset($ACTION_RESULT) and $ACTION_RESULT eq "SUCCESS_UNASSIGNED"}
+
+ {$success_unassigned}
+
+ {else if isset($ACTION_RESULT) and $ACTION_RESULT eq "TICKET_NOT_EXISTING"}
+
+ {$ticket_not_existing}
+
+ {else if isset($ACTION_RESULT) and $ACTION_RESULT eq "ALREADY_ASSIGNED"}
+
+ {$ticket_already_assigned}
+
+ {else if isset($ACTION_RESULT) and $ACTION_RESULT eq "NOT_ASSIGNED"}
+
+ {$ticket_not_assigned}
+
+ {/if}
+
+
+
+
+
+ Forward to Group:
+
+
+
+ {foreach from=$sGroups key=k item=v}
+ {$v}
+ {/foreach}
+
+
+
+
+
+
+
+ {if isset($ACTION_RESULT) and $ACTION_RESULT eq "INVALID_SGROUP"}
+
+ {$invalid_sgroup}
+
+ {else if isset($ACTION_RESULT) and $ACTION_RESULT eq "TICKET_NOT_EXISTING"}
+
+ {$ticket_not_existing}
+
+ {else if isset($ACTION_RESULT) and $ACTION_RESULT eq "SUCCESS_FORWARDED"}
+
+ {$success_forwarded}
+
+ {/if}
+
+
+
+
+
+
+
+ {/if}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{/block}
+
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/show_ticket_info.tpl b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/show_ticket_info.tpl
new file mode 100644
index 000000000..4431331c4
--- /dev/null
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/show_ticket_info.tpl
@@ -0,0 +1,168 @@
+{block name=content}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Network related
+
+
+
+
+ Connect_State: {$connect_state}
+
+
+
+ Local_Address: {$local_address}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{/block}
+
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/show_ticket_log.tpl b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/show_ticket_log.tpl
new file mode 100644
index 000000000..f79735064
--- /dev/null
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/show_ticket_log.tpl
@@ -0,0 +1,88 @@
+{block name=content}
+
+
+
+
+
+
+
+
+ Log of Ticket #{$ticket_id}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ID
+ Timestamp
+ Query
+
+
+ {foreach from=$ticket_logs item=log}
+
+ {$log.tLogId}
+ {$log.timestamp}
+ {$log.query}
+
+ {/foreach}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{/block}
+
\ No newline at end of file
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/show_user.tpl b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/show_user.tpl
new file mode 100644
index 000000000..51c5bb77a
--- /dev/null
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/show_user.tpl
@@ -0,0 +1,163 @@
+{block name=content}
+
+
+
+
+
+
+
+
+
+ Profile of {$target_name}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Info
+
+
+
+ Email:
+ {$mail}
+
+
+
+ Role:
+
+ {if $userPermission eq 1}User {/if}
+ {if $userPermission eq 2}Moderator {/if}
+ {if $userPermission eq 3}Admin {/if}
+
+
+ {if $firstName neq ""}
+
+ Firstname:
+ {$firstName}
+
+ {/if}
+ {if $lastName neq ""}
+
+ LastName:
+ {$lastName}
+
+ {/if}
+ {if $country neq ""}
+
+ Country:
+ {$country}
+
+ {/if}
+ {if $gender neq 0}
+
+ Gender:
+ {if $gender eq 1}
+ ♂
+ {else if $gender eq 2}
+ ♀
+ {/if}
+
+ {/if}
+
+
+
+
+
+
+
+
+
+
+
+
+
Tickets
+
+
+
+ ID
+ Title
+ Timestamp
+ Category
+ Status
+
+
+ {foreach from=$ticketlist item=ticket}
+
+ {$ticket.tId}
+ {$ticket.title}
+ {$ticket.timestamp}
+ {$ticket.category}
+
+ {if $ticket.status eq 0} {/if} {$ticket.statusText}
+
+ {/foreach}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{/block}
+
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/userlist.tpl b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/userlist.tpl
new file mode 100644
index 000000000..c2e226ca3
--- /dev/null
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/userlist.tpl
@@ -0,0 +1,96 @@
+{block name=content}
+
+
+
+
+
+ Members
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
All Acounts
+
+
+ Id
+ Username
+ Email
+ Permission
+ Action
+
+
+ {foreach from=$userlist item=element}
+
+ {$element.id}
+ {$element.username}
+ {$element.email}
+ {if $element.permission eq 1}User {/if}
+ {if $element.permission eq 2}Moderator {/if}
+ {if $element.permission eq 3}Admin {/if}
+
+ Show User
+ Edit User
+ {if isset($isAdmin) and $isAdmin eq 'TRUE' and $element.id neq 1}
+ {if $element.permission eq 1}
+ Make Moderator
+ Make Admin
+ {else if $element.permission eq 2 }
+ Demote to User
+ Make Admin
+ {else if $element.permission eq 3 }
+ Demote to User
+ Demote to Moderator
+ {/if}
+ {/if}
+
+
+
+ {/foreach}
+
+
+
+
+
+ «
+ {foreach from=$links item=link}
+ {$link}
+ {/foreach}
+ »
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{/block}
+
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/autoload/webusers.php b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/autoload/webusers.php
index 779414de3..a99a4a295 100644
--- a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/autoload/webusers.php
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/autoload/webusers.php
@@ -87,7 +87,7 @@ class WebUsers extends Users{
}
public function getUsername(){
-
+
if(! isset($this->login) || $this->login == ""){
$row = db_query("SELECT * FROM {users} WHERE uid = :id", array(':id' => $this->uId))->fetchAssoc();
$this->set($row);
@@ -137,12 +137,13 @@ class WebUsers extends Users{
}
public function setPassword($user, $pass){
- $reply = WebUsers::setAmsPassword($user, $pass);
- $values = Array('user' => $user, 'pass' => $pass);
+ $hashpass = crypt($pass, WebUsers::generateSALT());
+ $reply = WebUsers::setAmsPassword($user, $hashpass);
+ $drupal_pass = user_hash_password($pass);
+ $values = Array('user' => $user, 'pass' => $drupal_pass);
try {
//make connection with and put into shard db
- $dbw = new DBLayer("web");
- $dbw->execute("UPDATE ams_user SET Password = :pass WHERE Login = :user ",$values);
+ db_query("UPDATE {users} SET pass = :pass WHERE name = :user", $values);
}
catch (PDOException $e) {
//ERROR: the web DB is offline
@@ -155,8 +156,8 @@ class WebUsers extends Users{
$values = Array('user' => $user, 'mail' => $mail);
try {
//make connection with and put into shard db
- $dbw = new DBLayer("web");
- $dbw->execute("UPDATE ams_user SET Email = :mail WHERE Login = :user ",$values);
+ db_query("UPDATE {users} SET mail = :mail WHERE name = :user", $values);
+
}
catch (PDOException $e) {
//ERROR: the web DB is offline
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/config.php b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/config.php
index 7723032f8..5cb719bc8 100644
--- a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/config.php
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/config.php
@@ -91,5 +91,7 @@ $TIME_FORMAT = "m-d-Y H:i:s";
//defines which ingame layout template should be used
$INGAME_LAYOUT = "basic";
+$FORCE_INGAME = true;
+
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/add_sgroup.php b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/add_sgroup.php
index e2ef663f1..94157192b 100644
--- a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/add_sgroup.php
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/add_sgroup.php
@@ -1,7 +1,8 @@
getUsername();
+ }
+
+ $webUser = new WebUsers($_POST['target_id']);
+ $reply = $webUser->checkEmail($_POST['NewEmail']);
+
+ global $SITEBASE;
+ require_once($SITEBASE . '/inc/settings.php');
+ $result = settings();
+
+ if ( $reply != "success" ){
+ $result['EMAIL_ERROR'] = 'TRUE';
+ }else{
+ $result['EMAIL_ERROR'] = 'FALSE';
+ }
+ $result['prevNewEmail'] = filter_var($_POST["NewEmail"], FILTER_SANITIZE_EMAIL);
+
+ if ($reply== "success"){
+ $status = WebUsers::setEmail($target_username, filter_var($_POST["NewEmail"], FILTER_SANITIZE_EMAIL) );
+ if($status == 'ok'){
+ $result['SUCCESS_MAIL'] = "OK";
+ }else if($status == 'shardoffline'){
+ $result['SUCCESS_MAIL'] = "SHARDOFF";
+ }
+ $result['permission'] = unserialize($_SESSION['ticket_user'])->getPermission();
+ $result['no_visible_elements'] = 'FALSE';
+ $result['username'] = $_SESSION['user'];
+ $result['target_id'] = $_POST['target_id'];
+ if(isset($_GET['id'])){
+ if(Ticket_User::isMod(unserialize($_SESSION['ticket_user'])) && ($_POST['target_id'] != $_SESSION['id'])){
+ $result['isMod'] = "TRUE";
+ }
+ }
+ helpers :: loadtemplate( 'settings', $result);
+ exit;
+
+ }else{
+ $result['EMAIL'] = $reply;
+ $result['permission'] = unserialize($_SESSION['ticket_user'])->getPermission();
+ $result['no_visible_elements'] = 'FALSE';
+ $result['username'] = $_SESSION['user'];
+ $result['target_id'] = $_POST['target_id'];
+ if(isset($_GET['id'])){
+ if(Ticket_User::isMod(unserialize($_SESSION['ticket_user'])) && ($_POST['target_id'] != $_SESSION['id'])){
+ $result['isMod'] = "TRUE";
+ }
+ }
+ helpers :: loadtemplate( 'settings', $result);
+ exit;
+ }
+
+ }else{
+ //ERROR: permission denied!
+ $_SESSION['error_code'] = "403";
+ header("Location: index.php?page=error");
+ exit;
+ }
+
+ }else{
+ //ERROR: The form was not filled in correclty
+ header("Location: index.php?page=settings");
+ exit;
+ }
+ }else{
+ //ERROR: user is not logged in
+ header("Location: index.php");
+ exit;
+ }
+
+ }catch (PDOException $e) {
+ //go to error page or something, because can't access website db
+ print_r($e);
+ exit;
+ }
+
+}
+
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/change_password.php b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/change_password.php
new file mode 100644
index 000000000..420d78103
--- /dev/null
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/change_password.php
@@ -0,0 +1,88 @@
+getUsername();
+ //isAdmin is true when it's the admin, but the target_id != own id
+ $adminChangesOther = true;
+ $_POST["CurrentPass"] = "dummypass";
+ }
+
+ $webUser = new WebUsers($_POST['target_id']);
+ $params = Array( 'user' => $target_username, 'CurrentPass' => $_POST["CurrentPass"], 'NewPass' => $_POST["NewPass"], 'ConfirmNewPass' => $_POST["ConfirmNewPass"], 'adminChangesOther' => $adminChangesOther);
+ $result = $webUser->check_change_password($params);
+ if ($result == "success"){
+ //edit stuff into db
+ global $SITEBASE;
+ require_once($SITEBASE . '/inc/settings.php');
+ $succresult = settings();
+ $status = WebUsers::setPassword($target_username, $_POST["NewPass"]);
+ if($status == 'ok'){
+ $succresult['SUCCESS_PASS'] = "OK";
+ }else if($status == 'shardoffline'){
+ $succresult['SUCCESS_PASS'] = "SHARDOFF";
+ }
+ $succresult['permission'] = unserialize($_SESSION['ticket_user'])->getPermission();
+ $succresult['no_visible_elements'] = 'FALSE';
+ $succresult['username'] = $_SESSION['user'];
+ $succresult['target_id'] = $_POST['target_id'];
+ helpers :: loadtemplate( 'settings', $succresult);
+ exit;
+
+ }else{
+
+ $result['prevCurrentPass'] = filter_var($_POST["CurrentPass"], FILTER_SANITIZE_STRING);
+ $result['prevNewPass'] = filter_var($_POST["NewPass"], FILTER_SANITIZE_STRING);
+ $result['prevConfirmNewPass'] = filter_var($_POST["ConfirmNewPass"], FILTER_SANITIZE_STRING);
+ $result['permission'] = unserialize($_SESSION['ticket_user'])->getPermission();
+ $result['no_visible_elements'] = 'FALSE';
+ $result['username'] = $_SESSION['user'];
+ $result['target_id'] = $_POST['target_id'];
+
+ global $SITEBASE;
+ require_once($SITEBASE . '/inc/settings.php');
+ $settings = settings();
+
+ $result = array_merge($result,$settings);
+ helpers :: loadtemplate( 'settings', $result);
+ exit;
+ }
+
+ }else{
+ //ERROR: permission denied!
+ $_SESSION['error_code'] = "403";
+ header("Location: index.php?page=error");
+ exit;
+ }
+
+ }else{
+ //ERROR: The form was not filled in correclty
+ header("Location: index.php?page=settings");
+ exit;
+ }
+ }else{
+ //ERROR: user is not logged in
+ header("Location: index.php");
+ exit;
+ }
+
+ }catch (PDOException $e) {
+ //go to error page or something, because can't access website db
+ print_r($e);
+ exit;
+ }
+
+}
+
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/create_ticket.php b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/create_ticket.php
index f50dbdd6a..cf497dabf 100644
--- a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/create_ticket.php
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/create_ticket.php
@@ -2,6 +2,8 @@
function create_ticket(){
//if logged in
+ global $INGAME_WEBPATH;
+ global $WEBPATH;
if(WebUsers::isLoggedIn() && isset($_SESSION['ticket_user'])){
if(isset($_POST['target_id'])){
@@ -19,7 +21,11 @@ function create_ticket(){
$author= Ticket_User::constr_ExternId($_POST['target_id'])->getTUserId();
}
$ticket_id = Ticket::create_Ticket($title, $content, $category, $author, unserialize($_SESSION['ticket_user'])->getTUserId(),0, $_POST);
- header("Location: ams?page=show_ticket&id=".$ticket_id);
+ if (Helpers::check_if_game_client()) {
+ header("Location: ".$INGAME_WEBPATH."?page=show_ticket&id=".$ticket_id);
+ }else{
+ header("Location: ".$WEBPATH."?page=show_ticket&id=".$ticket_id);
+ }
exit;
}catch (PDOException $e) {
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/login.php b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/login.php
index 2731de130..54d6b0672 100644
--- a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/login.php
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/login.php
@@ -1,7 +1,8 @@
getLanguage();
//go back to the index page.
- header( 'Location: '. $INGAME_WEBPATH );
+ if (Helpers::check_if_game_client()) {
+ header( 'Location: '. $INGAME_WEBPATH );
+ }else{
+ header( 'Location: '. $WEBPATH );
+ }
exit;
}else{
//handle login failure
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/modify_email_of_sgroup.php b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/modify_email_of_sgroup.php
index ade3c3af2..9befa9ae4 100644
--- a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/modify_email_of_sgroup.php
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/modify_email_of_sgroup.php
@@ -1,7 +1,8 @@
getTUserId(), $value);
- header("Location: ams?page=show_user&id=".$user_id);
+ if (Helpers::check_if_game_client()) {
+ header("Location: ".$INGAME_WEBPATH."?page=show_user&id=".$user_id);
+ }else{
+ header("Location: ".$WEBPATH."?page=show_user&id=".$user_id);
+ }
exit;
}else{
//ERROR: GET PARAMS not given or trying to change admin
- header("Location: ams?page=show_user&id=".$user_id);
+ if (Helpers::check_if_game_client()) {
+ header("Location: ".$INGAME_WEBPATH."?page=show_user&id=".$user_id);
+ }else{
+ header("Location: ".$WEBPATH."?page=show_user&id=".$user_id);
+ }
exit;
}
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/createticket.php b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/createticket.php
index 49e2263cf..3fdb54b84 100644
--- a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/createticket.php
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/createticket.php
@@ -35,6 +35,8 @@ function createticket(){
//create array of category id & names
$catArray = Ticket_Category::getAllCategories();
$result['category'] = Gui_Elements::make_table_with_key_is_id($catArray, Array("getName"), "getTCategoryId" );
+ global $INGAME_WEBPATH;
+ $result['ingame_webpath'] = $INGAME_WEBPATH;
return $result;
}else{
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/logout.php b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/logout.php
index 3e7454fe7..b7a13993a 100644
--- a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/logout.php
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/logout.php
@@ -2,5 +2,8 @@
function logout(){
session_unset();
- session_destroy();
+ session_destroy();
+ global $INGAME_WEBPATH;
+ header("Location: ". $INGAME_WEBPATH);
+ exit;
}
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/settings.php b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/settings.php
new file mode 100644
index 000000000..4b57d2e1c
--- /dev/null
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/settings.php
@@ -0,0 +1,298 @@
+getInfo();
+ if(Ticket_User::isMod(unserialize($_SESSION['ticket_user'])) && ($_GET['id']!= $_SESSION['id'])){
+ $result['changesOther'] = "TRUE";
+ }
+ $result['target_id'] = $_GET['id'];
+ $result['current_mail'] = $webUser->getEmail();
+ $result['target_username'] = $webUser->getUsername();
+ }
+ }else{
+ $webUser = new Webusers($_SESSION['id']);
+ //$result = $webUser->getInfo();
+ $result['target_id'] = $_SESSION['id'];
+ $result['current_mail'] = $webUser->getEmail();
+ $result['target_username'] = $webUser->getUsername();
+
+ }
+ //Sanitize Data
+ $result['current_mail'] = filter_var($result['current_mail'], FILTER_SANITIZE_EMAIL);
+ $result['target_username'] = filter_var($result['target_username'], FILTER_SANITIZE_STRING);
+ //$result['FirstName'] = filter_var($result['FirstName'], FILTER_SANITIZE_STRING);
+ //$result['LastName'] = filter_var($result['LastName'], FILTER_SANITIZE_STRING);
+ //$result['Country'] = filter_var($result['Country'], FILTER_SANITIZE_STRING);
+ //$result['Gender'] = filter_var($result['Gender'], FILTER_SANITIZE_NUMBER_INT);
+ //$result['ReceiveMail'] = filter_var($result['ReceiveMail'], FILTER_SANITIZE_NUMBER_INT);
+ //$result['country_array'] = getCountryArray();
+ global $INGAME_WEBPATH;
+ $result['ingame_webpath'] = $INGAME_WEBPATH;
+ return $result;
+ }else{
+ //ERROR: not logged in!
+ header("Location: index.php");
+ exit;
+ }
+}
+
+
+function getCountryArray(){
+
+$countries = array(
+'AA'=>'None Selected',
+'AF'=>'Afghanistan',
+'AL'=>'Albania',
+'DZ'=>'Algeria',
+'AS'=>'American Samoa',
+'AD'=>'Andorra',
+'AO'=>'Angola',
+'AI'=>'Anguilla',
+'AQ'=>'Antarctica',
+'AG'=>'Antigua And Barbuda',
+'AR'=>'Argentina',
+'AM'=>'Armenia',
+'AW'=>'Aruba',
+'AU'=>'Australia',
+'AT'=>'Austria',
+'AZ'=>'Azerbaijan',
+'BS'=>'Bahamas',
+'BH'=>'Bahrain',
+'BD'=>'Bangladesh',
+'BB'=>'Barbados',
+'BY'=>'Belarus',
+'BE'=>'Belgium',
+'BZ'=>'Belize',
+'BJ'=>'Benin',
+'BM'=>'Bermuda',
+'BT'=>'Bhutan',
+'BO'=>'Bolivia',
+'BA'=>'Bosnia And Herzegovina',
+'BW'=>'Botswana',
+'BV'=>'Bouvet Island',
+'BR'=>'Brazil',
+'IO'=>'British Indian Ocean Territory',
+'BN'=>'Brunei',
+'BG'=>'Bulgaria',
+'BF'=>'Burkina Faso',
+'BI'=>'Burundi',
+'KH'=>'Cambodia',
+'CM'=>'Cameroon',
+'CA'=>'Canada',
+'CV'=>'Cape Verde',
+'KY'=>'Cayman Islands',
+'CF'=>'Central African Republic',
+'TD'=>'Chad',
+'CL'=>'Chile',
+'CN'=>'China',
+'CX'=>'Christmas Island',
+'CC'=>'Cocos (Keeling) Islands',
+'CO'=>'Columbia',
+'KM'=>'Comoros',
+'CG'=>'Congo',
+'CK'=>'Cook Islands',
+'CR'=>'Costa Rica',
+'CI'=>'Cote D\'Ivorie (Ivory Coast)',
+'HR'=>'Croatia (Hrvatska)',
+'CU'=>'Cuba',
+'CY'=>'Cyprus',
+'CZ'=>'Czech Republic',
+'CD'=>'Democratic Republic Of Congo (Zaire)',
+'DK'=>'Denmark',
+'DJ'=>'Djibouti',
+'DM'=>'Dominica',
+'DO'=>'Dominican Republic',
+'TP'=>'East Timor',
+'EC'=>'Ecuador',
+'EG'=>'Egypt',
+'SV'=>'El Salvador',
+'GQ'=>'Equatorial Guinea',
+'ER'=>'Eritrea',
+'EE'=>'Estonia',
+'ET'=>'Ethiopia',
+'FK'=>'Falkland Islands (Malvinas)',
+'FO'=>'Faroe Islands',
+'FJ'=>'Fiji',
+'FI'=>'Finland',
+'FR'=>'France',
+'FX'=>'France, Metropolitan',
+'GF'=>'French Guinea',
+'PF'=>'French Polynesia',
+'TF'=>'French Southern Territories',
+'GA'=>'Gabon',
+'GM'=>'Gambia',
+'GE'=>'Georgia',
+'DE'=>'Germany',
+'GH'=>'Ghana',
+'GI'=>'Gibraltar',
+'GR'=>'Greece',
+'GL'=>'Greenland',
+'GD'=>'Grenada',
+'GP'=>'Guadeloupe',
+'GU'=>'Guam',
+'GT'=>'Guatemala',
+'GN'=>'Guinea',
+'GW'=>'Guinea-Bissau',
+'GY'=>'Guyana',
+'HT'=>'Haiti',
+'HM'=>'Heard And McDonald Islands',
+'HN'=>'Honduras',
+'HK'=>'Hong Kong',
+'HU'=>'Hungary',
+'IS'=>'Iceland',
+'IN'=>'India',
+'ID'=>'Indonesia',
+'IR'=>'Iran',
+'IQ'=>'Iraq',
+'IE'=>'Ireland',
+'IL'=>'Israel',
+'IT'=>'Italy',
+'JM'=>'Jamaica',
+'JP'=>'Japan',
+'JO'=>'Jordan',
+'KZ'=>'Kazakhstan',
+'KE'=>'Kenya',
+'KI'=>'Kiribati',
+'KW'=>'Kuwait',
+'KG'=>'Kyrgyzstan',
+'LA'=>'Laos',
+'LV'=>'Latvia',
+'LB'=>'Lebanon',
+'LS'=>'Lesotho',
+'LR'=>'Liberia',
+'LY'=>'Libya',
+'LI'=>'Liechtenstein',
+'LT'=>'Lithuania',
+'LU'=>'Luxembourg',
+'MO'=>'Macau',
+'MK'=>'Macedonia',
+'MG'=>'Madagascar',
+'MW'=>'Malawi',
+'MY'=>'Malaysia',
+'MV'=>'Maldives',
+'ML'=>'Mali',
+'MT'=>'Malta',
+'MH'=>'Marshall Islands',
+'MQ'=>'Martinique',
+'MR'=>'Mauritania',
+'MU'=>'Mauritius',
+'YT'=>'Mayotte',
+'MX'=>'Mexico',
+'FM'=>'Micronesia',
+'MD'=>'Moldova',
+'MC'=>'Monaco',
+'MN'=>'Mongolia',
+'MS'=>'Montserrat',
+'MA'=>'Morocco',
+'MZ'=>'Mozambique',
+'MM'=>'Myanmar (Burma)',
+'NA'=>'Namibia',
+'NR'=>'Nauru',
+'NP'=>'Nepal',
+'NL'=>'Netherlands',
+'AN'=>'Netherlands Antilles',
+'NC'=>'New Caledonia',
+'NZ'=>'New Zealand',
+'NI'=>'Nicaragua',
+'NE'=>'Niger',
+'NG'=>'Nigeria',
+'NU'=>'Niue',
+'NF'=>'Norfolk Island',
+'KP'=>'North Korea',
+'MP'=>'Northern Mariana Islands',
+'NO'=>'Norway',
+'OM'=>'Oman',
+'PK'=>'Pakistan',
+'PW'=>'Palau',
+'PA'=>'Panama',
+'PG'=>'Papua New Guinea',
+'PY'=>'Paraguay',
+'PE'=>'Peru',
+'PH'=>'Philippines',
+'PN'=>'Pitcairn',
+'PL'=>'Poland',
+'PT'=>'Portugal',
+'PR'=>'Puerto Rico',
+'QA'=>'Qatar',
+'RE'=>'Reunion',
+'RO'=>'Romania',
+'RU'=>'Russia',
+'RW'=>'Rwanda',
+'SH'=>'Saint Helena',
+'KN'=>'Saint Kitts And Nevis',
+'LC'=>'Saint Lucia',
+'PM'=>'Saint Pierre And Miquelon',
+'VC'=>'Saint Vincent And The Grenadines',
+'SM'=>'San Marino',
+'ST'=>'Sao Tome And Principe',
+'SA'=>'Saudi Arabia',
+'SN'=>'Senegal',
+'SC'=>'Seychelles',
+'SL'=>'Sierra Leone',
+'SG'=>'Singapore',
+'SK'=>'Slovak Republic',
+'SI'=>'Slovenia',
+'SB'=>'Solomon Islands',
+'SO'=>'Somalia',
+'ZA'=>'South Africa',
+'GS'=>'South Georgia And South Sandwich Islands',
+'KR'=>'South Korea',
+'ES'=>'Spain',
+'LK'=>'Sri Lanka',
+'SD'=>'Sudan',
+'SR'=>'Suriname',
+'SJ'=>'Svalbard And Jan Mayen',
+'SZ'=>'Swaziland',
+'SE'=>'Sweden',
+'CH'=>'Switzerland',
+'SY'=>'Syria',
+'TW'=>'Taiwan',
+'TJ'=>'Tajikistan',
+'TZ'=>'Tanzania',
+'TH'=>'Thailand',
+'TG'=>'Togo',
+'TK'=>'Tokelau',
+'TO'=>'Tonga',
+'TT'=>'Trinidad And Tobago',
+'TN'=>'Tunisia',
+'TR'=>'Turkey',
+'TM'=>'Turkmenistan',
+'TC'=>'Turks And Caicos Islands',
+'TV'=>'Tuvalu',
+'UG'=>'Uganda',
+'UA'=>'Ukraine',
+'AE'=>'United Arab Emirates',
+'UK'=>'United Kingdom',
+'US'=>'United States',
+'UM'=>'United States Minor Outlying Islands',
+'UY'=>'Uruguay',
+'UZ'=>'Uzbekistan',
+'VU'=>'Vanuatu',
+'VA'=>'Vatican City (Holy See)',
+'VE'=>'Venezuela',
+'VN'=>'Vietnam',
+'VG'=>'Virgin Islands (British)',
+'VI'=>'Virgin Islands (US)',
+'WF'=>'Wallis And Futuna Islands',
+'EH'=>'Western Sahara',
+'WS'=>'Western Samoa',
+'YE'=>'Yemen',
+'YU'=>'Yugoslavia',
+'ZM'=>'Zambia',
+'ZW'=>'Zimbabwe'
+);
+
+return $countries;
+
+}
+
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/sgroup_list.php b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/sgroup_list.php
index 546395ed8..0b446fc2c 100644
--- a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/sgroup_list.php
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/sgroup_list.php
@@ -1,6 +1,8 @@
CreateQueue($userid, $groupid, $what, $how, $who);
- $result['pagination_base_link'] = "ams?page=show_queue&get=create&userid=".$userid."&groupid=".$groupid."&what=".$what."&how=".$how."&who=".$who;
+
+ if (Helpers::check_if_game_client()) {
+ $result['pagination_base_link'] = $INGAME_WEBPATH."?page=show_queue&get=create&userid=".$userid."&groupid=".$groupid."&what=".$what."&how=".$how."&who=".$who;
+ }else{
+ $result['pagination_base_link'] = $WEBPATH."?page=show_queue&get=create&userid=".$userid."&groupid=".$groupid."&what=".$what."&how=".$how."&who=".$who;
+ }
+
+
$result['prev_created_userid'] = $userid;
$result['prev_created_groupid'] = $groupid;
$result['prev_created_what'] = $what;
@@ -60,7 +78,11 @@ function show_queue(){
$how = filter_var($_POST['how'], FILTER_SANITIZE_STRING);
$who = filter_var($_POST['who'], FILTER_SANITIZE_STRING);
$queue_handler->CreateQueue($userid, $groupid, $what, $how, $who);
- $result['pagination_base_link'] = "ams?page=show_queue&get=create&userid=".$userid."&groupid=".$groupid."&what=".$what."&how=".$how."&who=".$who;
+ if (Helpers::check_if_game_client()) {
+ $result['pagination_base_link'] = $INGAME_WEBPATH."?page=show_queue&get=create&userid=".$userid."&groupid=".$groupid."&what=".$what."&how=".$how."&who=".$who;
+ }else{
+ $result['pagination_base_link'] = $WEBPATH."?page=show_queue&get=create&userid=".$userid."&groupid=".$groupid."&what=".$what."&how=".$how."&who=".$who;
+ }
$result['prev_created_userid'] = $userid;
$result['prev_created_groupid'] = $groupid;
$result['prev_created_what'] = $what;
@@ -104,6 +126,8 @@ function show_queue(){
$result['teamlist'][$i]['name'] = $web_teammember->getUsername();
$i++;
}
+ global $INGAME_WEBPATH;
+ $result['ingame_webpath'] = $INGAME_WEBPATH;
return $result;
}else{
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_reply.php b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_reply.php
index 94090fa88..96cec0a6a 100644
--- a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_reply.php
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_reply.php
@@ -30,6 +30,8 @@ function show_reply(){
if(Ticket_User::isMod(unserialize($_SESSION['ticket_user']))){
$result['isMod'] = "TRUE";
}
+ global $INGAME_WEBPATH;
+ $result['ingame_webpath'] = $INGAME_WEBPATH;
return $result;
}else{
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_sgroup.php b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_sgroup.php
index 729c0eec8..edf1ba0a9 100644
--- a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_sgroup.php
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_sgroup.php
@@ -1,6 +1,8 @@
getUsername();
$i++;
}
+ global $INGAME_WEBPATH;
+ $result['ingame_webpath'] = $INGAME_WEBPATH;
return $result;
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_ticket.php b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_ticket.php
index e354e2803..4ecddb0b7 100644
--- a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_ticket.php
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_ticket.php
@@ -68,6 +68,8 @@ function show_ticket(){
$result['sGroups'] = Gui_Elements::make_table_with_key_is_id(Support_Group::getAllSupportGroups(), Array("getName"), "getSGroupId" );
}
$result['hasInfo'] = $target_ticket->hasInfo();
+ global $INGAME_WEBPATH;
+ $result['ingame_webpath'] = $INGAME_WEBPATH;
return $result;
}else{
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_ticket_info.php b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_ticket_info.php
index 6d1cf5e0f..4e43c7aad 100644
--- a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_ticket_info.php
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_ticket_info.php
@@ -37,6 +37,8 @@ function show_ticket_info(){
if(Ticket_User::isMod(unserialize($_SESSION['ticket_user']))){
$result['isMod'] = "TRUE";
}
+ global $INGAME_WEBPATH;
+ $result['ingame_webpath'] = $INGAME_WEBPATH;
return $result;
}else{
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_ticket_log.php b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_ticket_log.php
index 1974cbc66..6d1ea9701 100644
--- a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_ticket_log.php
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_ticket_log.php
@@ -1,7 +1,8 @@
getUsername();
}else if($log['action'] == 4){
- $query_backpart = "ID#" . $log['argument'] . " ";
+ if (Helpers::check_if_game_client()) {
+ $query_backpart = "ID#" . $log['argument'] . " ";
+ }else{
+ $query_backpart = "ID#" . $log['argument'] . " ";
+ }
}else if($log['action'] == 5){
$statusArray = Ticket::getStatusArray();
$query_backpart = $statusArray[$log['argument'] ];
@@ -31,7 +36,11 @@ function show_ticket_log(){
$priorityArray = Ticket::getPriorityArray();
$query_backpart = $priorityArray[$log['argument'] ];
}else if($log['action'] == 8){
- $query_backpart = "" . Support_Group::getGroup($log['argument'])->getName() . " ";
+ if (Helpers::check_if_game_client()) {
+ $query_backpart = "" . Support_Group::getGroup($log['argument'])->getName() . " ";
+ }else{
+ $query_backpart = "" . Support_Group::getGroup($log['argument'])->getName() . " ";
+ }
}
$result['ticket_logs'][$i]['query'] = $author . " " . $log_action_array[$log['action']] . " " . $query_backpart;
$result['ticket_logs'][$i]['timestamp_elapsed'] = Gui_Elements::time_elapsed_string($log['timestamp']);
@@ -40,6 +49,8 @@ function show_ticket_log(){
if(Ticket_User::isMod(unserialize($_SESSION['ticket_user']))){
$result['isMod'] = "TRUE";
}
+ global $INGAME_WEBPATH;
+ $result['ingame_webpath'] = $INGAME_WEBPATH;
return $result;
}else{
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_user.php b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_user.php
index 3a4b2acee..dc4548361 100644
--- a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_user.php
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_user.php
@@ -28,6 +28,8 @@ function show_user(){
$ticketlist = Ticket::getTicketsOf($ticket_user->getTUserId());
$result['ticketlist'] = Gui_Elements::make_table($ticketlist, Array("getTId","getTimestamp","getTitle","getStatus","getStatusText","getStatusText","getCategoryName"), Array("tId","timestamp","title","status","statustext","statusText","category"));
+ global $INGAME_WEBPATH;
+ $result['ingame_webpath'] = $INGAME_WEBPATH;
return $result;
}else{
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/userlist.php b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/userlist.php
index d8783ce32..2c408f683 100644
--- a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/userlist.php
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/userlist.php
@@ -18,6 +18,8 @@ function userlist(){
if (Ticket_User::isAdmin(unserialize($_SESSION['ticket_user']))){
$pageResult['isAdmin'] = "TRUE";
}
+ global $INGAME_WEBPATH;
+ $pageResult['ingame_webpath'] = $INGAME_WEBPATH;
return $pageResult;
}else{
//ERROR: No access!
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ryzommanage.module b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ryzommanage.module
index 7249aded2..deb8a5f40 100644
--- a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ryzommanage.module
+++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ryzommanage.module
@@ -27,6 +27,7 @@ global $WEBPATH;
global $INGAME_WEBPATH;
global $BASE_WEBPATH;
global $INGAME_LAYOUT;
+global $FORCE_INGAME;
require 'ams_lib/libinclude.php';
spl_autoload_register('__autoload');
@@ -268,9 +269,12 @@ function ryzommanage_block_view($delta = '')
-function _ams_handler()
+function _ams_handler($ingame = false)
{
global $BASE_WEBPATH;
+ global $SITEBASE;
+ global $INGAME_WEBPATH;
+
//Decide what page to load
if ( ! isset( $_GET["page"]) ){
if(isset($_SESSION['user'])){
@@ -281,7 +285,11 @@ function _ams_handler()
}
}else{
//default page
- header("Location: ".$BASE_WEBPATH."/user/login");
+ if($ingame){
+ header("Location: ".$INGAME_WEBPATH."?page=login");
+ }else{
+ header("Location: ".$BASE_WEBPATH."/user/login");
+ }
exit;
}
}else{
@@ -291,13 +299,13 @@ function _ams_handler()
//perform an action in case one is specified
//else check if a php page is included in the inc folder, else just set page to the get param
if ( isset( $_POST["function"] ) ){
- $filename = dirname( __FILE__ ).'/func/' . $_POST["function"] . '.php';
+ $filename = $SITEBASE . '/func/' . $_POST["function"] . '.php';
if(is_file($filename)){
require($filename);
$return = $_POST["function"]();
}
}else{
- $filename = dirname( __FILE__ ).'/inc/' . $page . '.php';
+ $filename = $SITEBASE . '/inc/' . $page . '.php';
if(is_file($filename)){
require_once($filename);
$return = $page();
@@ -324,7 +332,12 @@ function _ams_handler()
}
//return $page;
- return helpers :: loadTemplate( $page , $return, true);
+ if ($ingame){
+ helpers :: loadTemplate( $page , $return );
+ }else{
+ return helpers :: loadTemplate( $page , $return, true);
+ }
+
}
@@ -366,8 +379,8 @@ function _collect_register($nids, $collection)
function _collect_ingame_ams($nids, $collection)
{
//if not using ryzom core client show registration page
- if (Helpers::check_if_game_client(true)) {
- _return_ingame_httpdata();
+ if (Helpers::check_if_game_client()) {
+ _ams_handler(true);
} else {
//redirect to registration page
global $WEBPATH;
@@ -376,70 +389,6 @@ function _collect_ingame_ams($nids, $collection)
}
-function _return_ingame_httpdata(){
-
- //Decide what page to load
- if ( ! isset( $_GET["page"]) ){
- if(isset($_SESSION['user'])){
- if(Ticket_User::isMod(unserialize($_SESSION['ticket_user']))){
- $page = 'dashboard';
- }else{
- $page = 'show_user';
- }
- }else{
- //default page
- $page = 'login';
- }
- }else{
- $page = $_GET["page"];
- }
-
- //perform an action in case one is specified
- //else check if a php page is included in the inc folder, else just set page to the get param
- global $SITEBASE;
- if ( isset( $_POST["function"] ) ){
- $filename = $SITEBASE.'/func/' . $_POST["function"] . '.php';
- if(is_file($filename)){
- require($filename);
- $return = $_POST["function"]();
- }
- }else{
-
- $filename = $SITEBASE.'/inc/' . $page . '.php';
- if(is_file($filename)){
- require_once($filename);
- $return = $page();
- }
- }
-
- //add username to the return array in case logged in.
- if(isset($_SESSION['user'])){
- $return['username'] = $_SESSION['user'];
- }
-
- //Set permission
- if(isset($_SESSION['ticket_user'])){
- $return['permission'] = unserialize($_SESSION['ticket_user'])->getPermission();
- }else{
- //default permission
- $return['permission'] = 0;
- }
-
- //hide sidebar + topbar in case of login/register
- if($page == 'login' || $page == 'register' || $page == 'logout'){
- $return['no_visible_elements'] = 'TRUE';
- }else{
- $return['no_visible_elements'] = 'FALSE';
- }
-
- //handle error page
- if($page == 'error'){
- $return['permission'] = 0;
- $return['no_visible_elements'] = 'FALSE';
- }
-
- helpers :: loadTemplate( $page , $return );
-}
/**
*
* Function _collect_register