From a2b83bb6c7a2de38645821b33d7ef88875822df9 Mon Sep 17 00:00:00 2001 From: Quitta Date: Tue, 6 Aug 2013 04:31:01 +0200 Subject: [PATCH] userlist ingame works + fixed a bug in demoting/promoting users with roles, which was looking at the wrong id --- .../ams_lib/configs/ingame_layout.ini | 8 +- .../ams_lib/ingame_templates/show_ticket.tpl | 2 +- .../ams_lib/ingame_templates/show_user.tpl | 8 +- .../ams_lib/ingame_templates/userlist.tpl | 96 +++++++++++++++++++ .../www/html/inc/change_permission.php | 3 +- 5 files changed, 110 insertions(+), 7 deletions(-) create mode 100644 code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/userlist.tpl diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/configs/ingame_layout.ini b/code/ryzom/tools/server/ryzom_ams/ams_lib/configs/ingame_layout.ini index ea67f8093..e76cf2acf 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/configs/ingame_layout.ini +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/configs/ingame_layout.ini @@ -14,8 +14,11 @@ title_bg_color = "#303030" ;default info text color info_color = "#00CED1" -;admin/mod name color +;Account (user/admin/mod) name color team_color = "red" +user_color = "green" +mod_color = "orange" +admin_color = "red" ;main table bg color main_tbl_color = "#00000030" @@ -35,4 +38,7 @@ closed_tbl_color = "#FFE69960" ;table header tr bg color table_header_tr_color = "#00000090" +;pagination current page bg +pagination_current_page_bg = "#00CED190" + ;------------------------------------------------------------------------------- \ No newline at end of file diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/show_ticket.tpl b/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/show_ticket.tpl index e1bd7edef..5058a5776 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/show_ticket.tpl +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/show_ticket.tpl @@ -9,7 +9,7 @@ {if isset($isMod) and $isMod eq "TRUE"}{/if} - +
Show Ticket LogSend Other TicketSend Other Ticket
diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/show_user.tpl b/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/show_user.tpl index 90be13283..93110b895 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/show_user.tpl +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/show_user.tpl @@ -79,9 +79,9 @@ Role: - {if $userPermission eq 1}User{/if} - {if $userPermission eq 2}Moderator{/if} - {if $userPermission eq 3}Admin{/if} + {if $userPermission eq 1}User{/if} + {if $userPermission eq 2}Moderator{/if} + {if $userPermission eq 3}Admin{/if} {if $firstName neq ""} @@ -146,7 +146,7 @@ {/foreach} - + diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/userlist.tpl b/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/userlist.tpl new file mode 100644 index 000000000..4e5f2a4ae --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/userlist.tpl @@ -0,0 +1,96 @@ +{block name=content} + + + + + + + + + + +

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}»
+
+
+
+
+ + + +{/block} + diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/inc/change_permission.php b/code/ryzom/tools/server/ryzom_ams/www/html/inc/change_permission.php index 184b135d1..084aa3923 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/inc/change_permission.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/inc/change_permission.php @@ -10,7 +10,8 @@ function change_permission(){ if(isset($_GET['user_id']) && isset($_GET['value']) && $_GET['user_id'] != 1 && $_GET['value'] < 4 ){ $user_id = filter_var($_GET['user_id'], FILTER_SANITIZE_NUMBER_INT); $value = filter_var($_GET['value'], FILTER_SANITIZE_NUMBER_INT); - Ticket_User::change_permission($user_id, $value); + + Ticket_User::change_permission(Ticket_User::constr_ExternId($user_id)->getTUserId(), $value); header("Location: index.php?page=show_user&id=".$user_id); exit;