diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/inc/sgroup_list.php b/code/ryzom/tools/server/ryzom_ams/www/html/inc/sgroup_list.php index 01c2b16f2..3d380c2d2 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/inc/sgroup_list.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/inc/sgroup_list.php @@ -3,14 +3,17 @@ function sgroup_list(){ //if logged in if(WebUsers::isLoggedIn()){ - if(Ticket_User::isAdmin($_SESSION['ticket_user'])){ + if(Ticket_User::isMod($_SESSION['ticket_user'])){ - if(isset($_GET['delete'])){ + if(isset($_GET['delete']) && Ticket_User::isAdmin($_SESSION['ticket_user'])){ $delete_id = filter_var($_GET['delete'], FILTER_SANITIZE_NUMBER_INT); $result['delete'] = Support_Group::deleteSupportGroup( $delete_id); header("Location: index.php?page=sgroup_list"); exit; } + if(Ticket_User::isAdmin($_SESSION['ticket_user'])){ + $result['isAdmin'] = "TRUE"; + } $result['grouplist'] = Gui_Elements::make_table(Support_Group::getGroups(), Array("getSGroupId","getName","getTag"), Array("sGroupId","name","tag")); return $result; }else{ diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_sgroup.php b/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_sgroup.php index c31c4d282..e68e8d96d 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_sgroup.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_sgroup.php @@ -3,19 +3,23 @@ function show_sgroup(){ //if logged in if(WebUsers::isLoggedIn()){ - if(Ticket_User::isAdmin($_SESSION['ticket_user'])){ + if(Ticket_User::isMod($_SESSION['ticket_user'])){ if( isset($_GET['id'])){ - //['target_id'] holds the id of the group! $result['target_id'] = filter_var($_GET['id'], FILTER_SANITIZE_NUMBER_INT); - if(isset($_GET['delete'])){ + if(isset($_GET['delete']) && Ticket_User::isAdmin($_SESSION['ticket_user'])){ $delete_id = filter_var($_GET['delete'], FILTER_SANITIZE_NUMBER_INT); $result['delete'] = Support_Group::deleteUserOfSupportGroup( $delete_id, $result['target_id'] ); header("Location: index.php?page=show_sgroup&id=" . $result['target_id']); exit; } + + if(Ticket_User::isAdmin($_SESSION['ticket_user'])){ + $result['isAdmin'] = "TRUE"; + } + $group = Support_Group::getGroup($result['target_id']); $result['groupsname'] = $group->getName(); diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/inc/userlist.php b/code/ryzom/tools/server/ryzom_ams/www/html/inc/userlist.php index 347be52dc..032a61835 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/inc/userlist.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/inc/userlist.php @@ -8,7 +8,7 @@ function userlist(){ while($row = $users->fetch(PDO::FETCH_ASSOC)){ $pageResult['userlist'][$i]['id'] = $row['UId']; $pageResult['userlist'][$i]['username'] = $row['Login']; - $pageResult['userlist'][$i]['permission'] = $row['Permission']; + $pageResult['userlist'][$i]['permission'] = Ticket_User::constr_ExternId($row['UId'])->getPermission(); $pageResult['userlist'][$i]['email'] = $row['Email']; $i++; } diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/sgroup_list.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/sgroup_list.tpl index 48ba87bfc..57ab6e01f 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/sgroup_list.tpl +++ b/code/ryzom/tools/server/ryzom_ams/www/html/templates/sgroup_list.tpl @@ -19,7 +19,7 @@