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} + + + + + + + + + + + +

Create a new ticket

+ + + + + + + + + + + + +
+ + +
+
+ + +
+ + +
+ + +
+
+ + + + + + + + + + + + + + + + +
Title: + +
Category: + +
Description:
+ + + + + {if $ingame} + + + + + + + + + + + + + + + + + + {/if} + +
+
+
+
+
+
+ + + +{/block} + + diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/dashboard.tpl b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/dashboard.tpl new file mode 100644 index 000000000..24b8c7878 --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/dashboard.tpl @@ -0,0 +1,81 @@ +{block name=content} + + + + + + + + + + + +

{$home_title}

+ + + + + + + + + + + + +
+ + +
+
+ + + + +
+ + +
+ + +
+ + + + + + + + + + + + + +
Tickets Waiting for Direct ActionTickets TodoNewest TicketTotal amount of Tickets
{$nrAssignedWaiting}{$nrToDo}{$newestTicketTitle}{$nrTotalTickets}
+
+
+
+ + +
+ + +
+

{$home_info}

+

This is the GSOC project of Daan Janssens mentored by Matthew Lagoe.

+
+
+
+
+ + + + + + + + + +{/block} + diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/index.tpl b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/index.tpl new file mode 100644 index 000000000..82495ff89 --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/index.tpl @@ -0,0 +1,81 @@ +{config_load file="ams_lib.conf" section="setup"} + +
+
+{* bold and title are read from the config file *}
+{if #bold#}{/if}
+{* capitalize the first letters of each word of the title *}
+Title: {#title#|capitalize}
+{if #bold#}{/if}
+
+The current date and time is {$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}
+
+The value of global assigned variable $SCRIPT_NAME is {$SCRIPT_NAME}
+
+Example of accessing server environment variable SERVER_NAME: {$smarty.server.SERVER_NAME}
+
+The value of {ldelim}$Name{rdelim} is {$Name}
+
+variable modifier example of {ldelim}$Name|upper{rdelim}
+
+{$Name|upper}
+
+
+An example of a section loop:
+
+{section name=outer 
+loop=$FirstName}
+{if $smarty.section.outer.index is odd by 2}
+	{$smarty.section.outer.rownum} . {$FirstName[outer]} {$LastName[outer]}
+{else}
+	{$smarty.section.outer.rownum} * {$FirstName[outer]} {$LastName[outer]}
+{/if}
+{sectionelse}
+	none
+{/section}
+
+An example of section looped key values:
+
+{section name=sec1 loop=$contacts}
+	phone: {$contacts[sec1].phone}
+ fax: {$contacts[sec1].fax}
+ cell: {$contacts[sec1].cell}
+{/section} +

+ +testing strip tags +{strip} + + + + +
+ + This is a test + +
+{/strip} + +

+ +This is an example of the html_select_date function: + +
+{html_select_date start_year=1998 end_year=2010} +
+ +This is an example of the html_select_time function: + +
+{html_select_time use_24_hours=false} +
+ +This is an example of the html_options function: + +
+ +
+ +{include file="footer.tpl"} diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/layout.tpl b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/layout.tpl new file mode 100644 index 000000000..c98768e52 --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/layout.tpl @@ -0,0 +1,34 @@ + + + + + Ryzom Account Management System + + + + + + + + + {block name=content}{/block} + + + +
+ + + + + {block name=menu}{/block} + + + +
+
+ + + + + + diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/layout_admin.tpl b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/layout_admin.tpl new file mode 100644 index 000000000..afe29e778 --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/layout_admin.tpl @@ -0,0 +1,19 @@ +{extends file="layout.tpl"} +{block name=menu} +
Dashboard
+ +
Profile
+ +
Settings
+ + | + +
Users
+ +
Queues
+ +
Support Groups
+ + +{/block} + diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/layout_mod.tpl b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/layout_mod.tpl new file mode 100644 index 000000000..65d10c611 --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/layout_mod.tpl @@ -0,0 +1,18 @@ +{extends file="layout.tpl"} +{block name=menu} +
Dashboard
+ +
Profile
+ +
Settings
+ + | + +
Users
+ +
Queues
+ +
Support Groups
+ +{/block} + diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/layout_user.tpl b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/layout_user.tpl new file mode 100644 index 000000000..233ba2ad4 --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/layout_user.tpl @@ -0,0 +1,13 @@ +{extends file="layout.tpl"} +{block name=menu} +
Profile
+ +
Settings
+ + | + +
Create New Ticket
+ + +{/block} + diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/login.tpl b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/login.tpl new file mode 100644 index 000000000..03d0bd7aa --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/login.tpl @@ -0,0 +1,39 @@ +

 

+ +
+
+

{$login_info}

+
+
+
+

+ Username: + +

+ +

+ Password: + +

+ +

+ Remember me: +

Remember me +

+ +

+ + +

+ +
+ + {if isset($login_error) and $login_error eq "TRUE"} +

+ {$login_error_message} +

+ {/if} +

+ {$login_register_message} {$login_register_message_here}! +

+
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/register.tpl b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/register.tpl new file mode 100644 index 000000000..9c38b34a2 --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/register.tpl @@ -0,0 +1,115 @@ +{config_load file="ams_lib.conf" section="setup"} +
+ {$title} +
+ +
+ {$welcome_message} +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{$username_tag} + + {if isset($Username)}{$Username}{/if}
{$password_tag} + + {if isset($PASSWORD_ERROR) && $PASSWORD_ERROR eq "TRUE"}{$Password}{/if}
{$cpassword_tag} + {if isset($CPASSWORD_ERROR) && $CPASSWORD_ERROR eq "TRUE"}{$ConfirmPass}{/if}
{$email_tag} + + {if isset($EMAIL_ERROR) && $EMAIL_ERROR eq "TRUE"}{$Email}{/if}
{$tac_tag}{$tac_message}
+ +
+ +
+ +
+ +
+ +
+ {$username_tooltip} +
+ + +
+ {$password_message} +
+ +
+ {$cpassword_message} +
+ +
+ {$email_message} +
+ +
diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/settings.tpl b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/settings.tpl new file mode 100644 index 000000000..4e94e633c --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/settings.tpl @@ -0,0 +1,161 @@ +{block name=content} + + + + + + + + +
+ + + + +
+ + + + + {if isset($isAdmin) and $isAdmin eq 'TRUE' and $target_id neq 1} + {if $userPermission eq 1} + + + {else if $userPermission eq 2 } + + + {else if $userPermission eq 3 } + + + {/if} + {/if} + +
Browse UserSend TicketMake ModeratorMake AdminDemote to UserMake AdminDemote to UserDemote to Moderator
+
+
+ + + + + + + + + + + + +

Change Settings of {$target_username}

+ + + + + + + + + + + + +
+ + +
+
+ + + +
+ + +
+ + +
+ +

Change Password

+ +
+ + {if !isset($changesOther) or $changesOther eq "FALSE"} + + + +

+ + {/if} + + + +
+ Current Password: + + + {if isset($MATCH_ERROR) and $MATCH_ERROR eq "TRUE"}The password is incorrect{/if} +
+ New Password: + + + {if isset($NEWPASSWORD_ERROR) and $NEWPASSWORD_ERROR eq "TRUE"}{$newpass_error_message}{/if} +
+ Confirm New Password: + + + {if isset($CNEWPASSWORD_ERROR) and $CNEWPASSWORD_ERROR eq "TRUE"}{$confirmnewpass_error_message}{/if} +
+ {if isset($SUCCESS_PASS) and $SUCCESS_PASS eq "OK"} +

+ The password has been changed! +

+ {/if} + + + + + +

+ +
+ +
+
+
+ + +
+ + +
+

Change Email

+ +
+ + +
+ New Email: + + + {if isset($EMAIL_ERROR) and $EMAIL_ERROR eq "TRUE"}{$EMAIL}{/if} +
+ {if isset($SUCCESS_MAIL) and $SUCCESS_MAIL eq "OK"} +

+ The email has been changed! +

+ {/if} + + + +

+ +

+ +
+
+
+
+ + + +{/block} + diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/sgroup_list.tpl b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/sgroup_list.tpl new file mode 100644 index 000000000..3a6dcc52f --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/sgroup_list.tpl @@ -0,0 +1,146 @@ +{block name=content} + + + + + + + + + + + +

Support Groups

+ + + + + + + + + + + + +
+ + +
+
+ + {if isset($isAdmin) && $isAdmin eq 'TRUE'} + + {/if} + +
+ + +
+ + +
+

Add a Support group

+ +
+ + + + + + +
+ + + + + + + + + + + + + + + +
Group name:
Group Tag:
Group EmailAddress:
+
+ + + + + + + + + + + + + + + +
IMAP MailServer IP:
IMAP Username:
IMAP Password:
+
+ +

+ + + {if isset($RESULT_OF_ADDING) and $RESULT_OF_ADDING eq "SUCCESS"} +

+ {$group_success} +

+ {else if isset($RESULT_OF_ADDING) and $RESULT_OF_ADDING eq "NAME_TAKEN"} +

+ {$group_name_taken} +

+ {else if isset($RESULT_OF_ADDING) and $RESULT_OF_ADDING eq "TAG_TAKEN"} +

+ {$group_tag_taken} +

+ {else if isset($RESULT_OF_ADDING) and $RESULT_OF_ADDING eq "SIZE_ERROR"} +

+ {$group_size_error} +

+ {/if} +
+
+
+
+ + +
+ + +
+

All groups

+ + + + + + + {if isset($isAdmin) && $isAdmin eq 'TRUE'}{/if} + + + {foreach from=$grouplist item=group} + + + + + + {if isset($isAdmin) && $isAdmin eq 'TRUE'}{/if} + + {/foreach} +
IDNameTagEmailAction
{$group.sGroupId}{$group.name}{$group.tag}{$group.groupemail}Delete
+
+
+
+
+ + + +{/block} + diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/show_queue.tpl b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/show_queue.tpl new file mode 100644 index 000000000..956b5e20d --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/ingame_templates/show_queue.tpl @@ -0,0 +1,222 @@ +{block name=content} + + + + + + + + +
+ + + + +
+ + + + + + + + +
Todo ticketsAll ticketsAll open ticketsTicket ArchiveNot Assigned Tickets
+
+
+ + + + + + + + + + + + +

Ticket Queue: {$queue_view}

+ + + + + + + + + + + + +{/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} + + + + +{/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} + + + + + +{/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} + + + + + +{/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} + + + + +{/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} + + + + + +{/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} + + + +{/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
+ + +
+
+ + + +
+ + + {if isset($ACTION_RESULT)} + +
+ + + +
+

Tickets

+

+

+ + + + + + + + + + + + + + + + +
Show + + tickets + + to + + : + + or + + + + +
+
+

+

+ + + + + + + + + + + + {foreach from=$tickets item=ticket} + + + + + + + + + + + {/foreach} +
IDTitleAssignedTimestampCategoryStatusSupportGroupActions
{$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 from=$links item=link} + + {/foreach} + + +
«{$link}»
+
+
+ + + + + + +
+ {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} +
+ + {/if} +
+
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + +
Show TicketShow Ticket Log
+
+
+
+ + + + + + + + + +

Reply ID#{$reply_id} of Ticket #{$ticket_id}

+
+ + + + + + + + + + +
+ + +
+
+ + +
+ + +
+ + +
+

Reply:

+

+ + + + +
+

+ {$reply_timestamp} + {if $author_permission eq '1'} + {if isset($isMod) and $isMod eq "TRUE"} {$authorName}{else} {$authorName} {/if} + {else if $reply.permission gt '1'} + {if isset($isMod) and $isMod eq "TRUE"} {$authorName}{else} {$authorName} {/if} + {/if}

+

{$reply_content}

+
+

+
+
+
+
+ +
+ + + + + + + + + +

Support Group: {$groupsname}

+
+ + + + + + + + + + +
+ + +
+
+ + + + +
+ + +
+ + +
+

Add user to the list

+ {if isset($isAdmin) && $isAdmin eq 'TRUE'} +
+ + + + + +
Username:
+ + + +

+ +

+ + {if isset($RESULT_OF_ADDING) and $RESULT_OF_ADDING eq "SUCCESS"} +

+ {$add_to_group_success} +

+ {else if isset($RESULT_OF_ADDING) and $RESULT_OF_ADDING eq "ALREADY_ADDED"} +

+ {$user_already_added} +

+ {else if isset($RESULT_OF_ADDING) and $RESULT_OF_ADDING eq "GROUP_NOT_EXISTING"} +

+ {$group_not_existing} +

+ {else if isset($RESULT_OF_ADDING) and $RESULT_OF_ADDING eq "USER_NOT_EXISTING"} +

+ {$user_not_existing} +

+ {else if isset($RESULT_OF_ADDING) and $RESULT_OF_ADDING eq "NOT_MOD_OR_ADMIN"} +

+ {$not_mod_or_admin} +

+ {/if} +
+ {/if} +
+
+
+ + +
+ + +
+

All members

+ + + + + {if isset($isAdmin) && $isAdmin eq 'TRUE'}{/if} + + + {foreach from=$userlist item=user} + + + + {if isset($isAdmin) && $isAdmin eq 'TRUE'}{/if} + + {/foreach} +
IDNameAction
{$user.tUserId}{$user.name}Delete
+
+
+
+ + +
+ + +
+

Mail settings

+
+ + + + + + + + + + + + + + + + + + + + + + +
Group Email:
IMAP Mail Server:
IMAP Username:
IMAP Password:
+ + + + +

+ +

+ + {if isset($RESULT_OF_MODIFYING) and $RESULT_OF_MODIFYING eq "SUCCESS"} +

+ {$modify_mail_of_group_success} +

+ {else if isset($RESULT_OF_MODIFYING) and $RESULT_OF_MODIFYING eq "EMAIL_NOT_VALID"} +

+ {$email_not_valid} +

+ {else if isset($RESULT_OF_MODIFYING) and $RESULT_OF_MODIFYING eq "NO_PASSWORD"} +

+ {$no_password_given} +

+ {/if} + +
+
+
+
+
+ +
+ + + + + + + +
+ + + + +
+ + + {if isset($isMod) and $isMod eq "TRUE"}{/if} + + {if $hasInfo}{/if} + +
Show Ticket LogSend Other TicketShow Additional Info
+
+
+
+ + + + + + + + + +

[{$t_title}-#{$ticket_tId}] {$ticket_title}

+
+ + + + + + + + + + +
+ + +
+
+ + +
+ + +
+ + +
+ + + + + {if isset($isMod) and $isMod eq "TRUE"} + +
+ + +
+ + + + + + + + + + + + + + + + +
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} + + + + {/if} + + + + +
+ + +
+

+ {$reply.timestamp} + {if $reply.permission eq '1'} + {if isset($isMod) and $isMod eq "TRUE"} {$reply.author}{else} {$reply.author} {/if} + {else if $reply.permission gt '1'} + {if isset($isMod) and $isMod eq "TRUE"} {$reply.author}{else} {$reply.author} {/if} + {/if} +

+

{$reply.replyContent}

+
+
+ + +
+

[Ticket is closed]

+
+
+ +
+ + + + + + {if $ticket_status neq 3} + + + + {if isset($isMod) and $isMod eq "TRUE"} + + + + {/if} + {/if} + + + + + + +
+

{$t_reply}:

+
Hide reply for user.
+ {if isset($isMod) and $isMod eq "TRUE"} + + + + + +
+ Change status to + + + Change priority to + +
+ {/if} +
+ + + +
+
+
+
+ + +
+ + + + + +
+

+ 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: +

+ + + + + +
+

+ {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} + +
+
+
+
+
+ +
+ + + + + + + +
+ + + + +
+ + + {if isset($isMod) and $isMod eq "TRUE"}{/if} + + + +
Show Ticket LogSend Other TicketShow Ticket
+
+
+
+ + + + + + + + + +

Additional Info For Ticket [#{$ticket_id}]

+
+ + + + + + + + + + +
+ + +
+
+ + +
+ + +
+ + +
+ + + + +
+ + +
+

Ingame related

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Shard ID: {$shard_id}
User_Id: {$user_id}
User Position: {$user_position}
View Position: {$view_position}
Client_Version: {$client_version}
Patch_Version: {$patch_version}
Server_Tick: {$server_tick}
+
+
+ + +
+

Hardware & Software related

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Memory: {$memory}
Processor: {$processor}
Cpu_Id: {$cpu_id}
Cpu_Mask: {$cpu_mask}
HT: {$ht}
OS: {$os}
NeL3D: {$nel3d}
+
+
+ + +
+

Network related

+ + + + + + + + + + +
Connect_State: {$connect_state}
Local_Address: {$local_address}
+
+
+
+
+
+
+ +
+ + + + + + + +
+ + + + +
+ + + + +
Show Ticket
+
+
+
+ + + + + + + + + +

Log of Ticket #{$ticket_id}

+
+ + + + + + + + + + +
+ + +
+
+ + +
+ + +
+ + +
+

Title: {$ticket_title}

+

+ + + + + + + + {foreach from=$ticket_logs item=log} + + + + + + {/foreach} + +
IDTimestampQuery
{$log.tLogId}{$log.timestamp}{$log.query}
+

+
+
+
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + {if isset($isAdmin) and $isAdmin eq 'TRUE' and $target_id neq 1} + {if $userPermission eq 1} + + + {else if $userPermission eq 2 } + + + {else if $userPermission eq 3 } + + + {/if} + {/if} + +
Edit UserSend TicketMake ModeratorMake AdminDemote to UserMake AdminDemote to UserDemote to Moderator
+
+
+
+ + + + + + + + + +

Profile of {$target_name}

+
+ + + + + + + + + + +
+ + +
+
+ + + +
+ + +
+ + +
+ +

Info

+ + + + + + + + + + + + {if $firstName neq ""} + + + + + {/if} + {if $lastName neq ""} + + + + + {/if} + {if $country neq ""} + + + + + {/if} + {if $gender neq 0} + + + {if $gender eq 1} + + {else if $gender eq 2} + + {/if} + + {/if} + +
Email:{$mail}
Role: + {if $userPermission eq 1}User{/if} + {if $userPermission eq 2}Moderator{/if} + {if $userPermission eq 3}Admin{/if} +
Firstname:{$firstName}
LastName:{$lastName}
Country:{$country}
Gender:
+
+
+
+ + +
+ + +
+

Tickets

+ + + + + + + + + + + {foreach from=$ticketlist item=ticket} + + + + + + + + + {/foreach} + +
IDTitleTimestampCategoryStatus
{$ticket.tId}{$ticket.title}{$ticket.timestamp}{$ticket.category}{if $ticket.status eq 0} {/if} {$ticket.statusText}
+
+
+
+
+ +
+ + + + + + + + + +

Members

+
+ + + + + + + + + + +
+ + +
+
+ + +
+ + +
+ + + +
+

All Acounts

+ + + + + + + + + + {foreach from=$userlist item=element} + + + + + {if $element.permission eq 1}{/if} + {if $element.permission eq 2}{/if} + {if $element.permission eq 3}{/if} + + + + {/foreach} +
IdUsernameEmailPermissionAction
{$element.id}{$element.username}{$element.email}UserModeratorAdmin + 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 from=$links item=link} + + {/foreach} + + +
«{$link}»
+
+
+
+
+ +