Group Permissions: Fix search, filter after submit and PHP 8.1 updates.
This commit is contained in:
@@ -60,6 +60,13 @@
|
|||||||
$language = new text;
|
$language = new text;
|
||||||
$text = $language->get();
|
$text = $language->get();
|
||||||
|
|
||||||
|
|
||||||
|
//get the http post data
|
||||||
|
$view = $_REQUEST['view'] ?? '';
|
||||||
|
// $action = $_POST['action'] ?? '';
|
||||||
|
$search = $_REQUEST['search'] ?? '';
|
||||||
|
$group_permissions = $_POST['group_permissions'] ?? '';
|
||||||
|
|
||||||
//process permission reload
|
//process permission reload
|
||||||
if (!empty($_GET['action']) && $_GET['action'] == 'reload' && !empty($group_uuid)) {
|
if (!empty($_GET['action']) && $_GET['action'] == 'reload' && !empty($group_uuid)) {
|
||||||
if (is_array($_SESSION["groups"]) && @sizeof($_SESSION["groups"]) != 0) {
|
if (is_array($_SESSION["groups"]) && @sizeof($_SESSION["groups"]) != 0) {
|
||||||
@@ -94,17 +101,11 @@
|
|||||||
|
|
||||||
//set message and redirect
|
//set message and redirect
|
||||||
message::add($text['message-permissions_reloaded'],'positive');
|
message::add($text['message-permissions_reloaded'],'positive');
|
||||||
header('Location: group_permissions.php?group_uuid='.urlencode($_GET['group_uuid']));
|
header('Location: group_permissions.php?group_uuid='.urlencode($_GET['group_uuid']).($view ? '&view='.urlencode($view) : null).($search ? '&search='.urlencode($search) : null));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//get the http post data
|
|
||||||
$view = $_REQUEST['view'] ?? '';
|
|
||||||
$action = $_POST['action'] ?? '';
|
|
||||||
$search = $_POST['search'] ?? '';
|
|
||||||
$group_permissions = $_POST['group_permissions'] ?? '';
|
|
||||||
|
|
||||||
//get the list
|
//get the list
|
||||||
$sql = "select ";
|
$sql = "select ";
|
||||||
$sql .= " distinct p.permission_name, \n";
|
$sql .= " distinct p.permission_name, \n";
|
||||||
@@ -243,7 +244,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//save the save array
|
//save the save array
|
||||||
if (is_array($array['save']) && @sizeof($array['save']) != 0) {
|
if (!empty($array['save']) && is_array($array['save']) && @sizeof($array['save']) != 0) {
|
||||||
$database = new database;
|
$database = new database;
|
||||||
$database->app_name = 'groups';
|
$database->app_name = 'groups';
|
||||||
$database->app_uuid = '2caf27b0-540a-43d5-bb9b-c9871a1e4f84';
|
$database->app_uuid = '2caf27b0-540a-43d5-bb9b-c9871a1e4f84';
|
||||||
@@ -252,7 +253,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//delete the delete array
|
//delete the delete array
|
||||||
if (is_array($array['delete']) && @sizeof($array['delete']) != 0) {
|
if (!empty($array['delete']) && is_array($array['delete']) && @sizeof($array['delete']) != 0) {
|
||||||
if (permission_exists('group_permission_delete')) {
|
if (permission_exists('group_permission_delete')) {
|
||||||
$database = new database;
|
$database = new database;
|
||||||
$database->app_name = 'groups';
|
$database->app_name = 'groups';
|
||||||
@@ -265,7 +266,7 @@
|
|||||||
message::add($text['message-update']);
|
message::add($text['message-update']);
|
||||||
|
|
||||||
//redirect
|
//redirect
|
||||||
header('Location: group_permissions.php?group_uuid='.urlencode($group_uuid));
|
header('Location: group_permissions.php?group_uuid='.urlencode($group_uuid).($view ? '&view='.urlencode($view) : null).($search ? '&search='.urlencode($search) : null));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -282,7 +283,7 @@
|
|||||||
echo " <div class='heading'><b>".$text['title-group_permissions']." (".escape($group_name).")</b></div>\n";
|
echo " <div class='heading'><b>".$text['title-group_permissions']." (".escape($group_name).")</b></div>\n";
|
||||||
echo " <div class='actions'>\n";
|
echo " <div class='actions'>\n";
|
||||||
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','style'=>'margin-right: 15px;','collapse'=>'hide-sm-dn','link'=>'groups.php']);
|
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','style'=>'margin-right: 15px;','collapse'=>'hide-sm-dn','link'=>'groups.php']);
|
||||||
echo button::create(['type'=>'button','label'=>$text['button-reload'],'icon'=>$_SESSION['theme']['button_icon_reload'],'link'=>'?group_uuid='.urlencode($group_uuid).'&action=reload']);
|
echo button::create(['type'=>'button','label'=>$text['button-reload'],'icon'=>$_SESSION['theme']['button_icon_reload'],'link'=>'?group_uuid='.urlencode($group_uuid).'&action=reload'.($view ? '&view='.urlencode($view) : null).($search ? '&search='.urlencode($search) : null)]);
|
||||||
if (permission_exists('group_member_view')) {
|
if (permission_exists('group_member_view')) {
|
||||||
echo button::create(['type'=>'button','label'=>$text['button-members'],'icon'=>'users','link'=>'group_members.php?group_uuid='.urlencode($group_uuid)]);
|
echo button::create(['type'=>'button','label'=>$text['button-members'],'icon'=>'users','link'=>'group_members.php?group_uuid='.urlencode($group_uuid)]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user