Only open/close session if we are clearing a session var

This commit is contained in:
Isaac Connor 2019-08-16 15:06:56 -04:00
parent ba94e98949
commit 660eddc69d
1 changed files with 2 additions and 2 deletions

View File

@ -54,16 +54,16 @@ class Group extends ZM_Object {
public static function get_group_dropdown( ) { public static function get_group_dropdown( ) {
session_start();
$selected_group_id = 0; $selected_group_id = 0;
if ( isset($_REQUEST['groups']) ) { if ( isset($_REQUEST['groups']) ) {
$selected_group_id = $group_id = $_SESSION['groups'] = $_REQUEST['groups']; $selected_group_id = $group_id = $_SESSION['groups'] = $_REQUEST['groups'];
} else if ( isset( $_SESSION['groups'] ) ) { } else if ( isset( $_SESSION['groups'] ) ) {
$selected_group_id = $group_id = $_SESSION['groups']; $selected_group_id = $group_id = $_SESSION['groups'];
} else if ( isset($_REQUEST['filtering']) ) { } else if ( isset($_REQUEST['filtering']) ) {
zm_session_start();
unset($_SESSION['groups']); unset($_SESSION['groups']);
}
session_write_close(); session_write_close();
}
return htmlSelect( 'Group[]', Group::get_dropdown_options(), isset($_SESSION['Group'])?$_SESSION['Group']:null, array( return htmlSelect( 'Group[]', Group::get_dropdown_options(), isset($_SESSION['Group'])?$_SESSION['Group']:null, array(
'data-on-change' => 'submitThisForm', 'data-on-change' => 'submitThisForm',