<commit_before><?php
require_once("gacl_admin.inc.php");

//GET takes precedence.
if ($_GET['group_type'] != '') {
	$group_type = $_GET['group_type'];
} else {
	$group_type = $_POST['group_type'];	
}

switch(strtolower(trim($group_type))) {
    case 'axo':
        $group_type = 'axo';
		$group_table = 'axo_groups';
		$group_sections_table = 'axo_sections';
        break;
    default:
        $group_type = 'aro';
		$group_table = 'aro_groups';
		$group_sections_table = 'aro_sections';
        break;
}

switch ($_POST[action]) {
    case Delete:
	    $gacl_api->debug_text("Delete!!");

		//Parse the form values
		//foreach ($_POST['delete_assigned_aro'] as $aro_value) {
		while (list(,$object_value) = @each($_POST['delete_assigned_object'])) {						
				$split_object_value = explode("^", $object_value);
				$selected_object_array[$split_object_value[0]][] = $split_object_value[1];
		}

        //Insert Object -> GROUP mappings
        while (list($object_section_value,$object_array) = @each($selected_object_array)) {
            $gacl_api->debug_text("Assign: Object ID: $object_section_value to Group: $_POST[group_id]");   

			foreach ($object_array as $object_value) {
                $gacl_api->del_group_object($_POST['group_id'], $object_section_value, $object_value, $group_type);
			}
        }
         
        //Return page.
        $gacl_api->return_page("$PHP_SELF?group_type=".$_POST['group_type']."&group_id=".$_POST['group_id']."");
		
        break;
    case Submit:
        $gacl_api->debug_text("Submit!!");

		//showarray($_POST['selected_'.$_POST['group_type']]);
		//Parse the form values
		//foreach ($_POST['selected_aro'] as $aro_value) {
		while (list(,$object_value) = @each($_POST['selected_'.$_POST['group_type']])) {
				$split_object_value = explode("^", $object_value);
				$selected_object_array[$split_object_value[0]][] = $split_object_value[1];
		}

        //Insert ARO -> GROUP mappings
        while (list($object_section_value,$object_array) = @each($selected_object_array)) {
            $gacl_api->debug_text("Assign: Object ID: $object_section_value to Group: $_POST[group_id]");   

			foreach ($object_array as $object_value) {
				$gacl_api->add_group_object($_POST['group_id'], $object_section_value, $object_value, $group_type);
			}
        }
                
        $gacl_api->return_page();

        break;    
    default:
        //
        //Grab all ARO sections for select box
        //
        $query = "select value, name from $group_sections_table order by order_value";
        $rs = $db->Execute($query);

        $rows = $rs->GetRows();

        //showarray($rows);

        $i=0;
        while (list(,$row) = @each($rows)) {
            list($id, $value) = $row;
            
            if ($i==0) {
                $section_value=$value;   
            }

            $options_sections[$id] = $value;<commit_msg>no message<commit_after><?php
require_once("gacl_admin.inc.php");

//GET takes precedence.
if ($_GET['group_type'] != '') {
	$group_type = $_GET['group_type'];
} else {
	$group_type = $_POST['group_type'];	
}

switch(strtolower(trim($group_type))) {
    case 'axo':
        $group_type = 'axo';
		$group_table = 'axo_groups';
		$group_sections_table = 'axo_sections';
        break;
    default:
        $group_type = 'aro';
		$group_table = 'aro_groups';
		$group_sections_table = 'aro_sections';
        break;
}

switch ($_POST[action]) {
    case Delete:
	    $gacl_api->debug_text("Delete!!");

		//Parse the form values
		//foreach ($_POST['delete_assigned_aro'] as $aro_value) {
		while (list(,$object_value) = @each($_POST['delete_assigned_object'])) {						
				$split_object_value = explode("^", $object_value);
				$selected_object_array[$split_object_value[0]][] = $split_object_value[1];
		}

        //Insert Object -> GROUP mappings
        while (list($object_section_value,$object_array) = @each($selected_object_array)) {
            $gacl_api->debug_text("Assign: Object ID: $object_section_value to Group: $_POST[group_id]");   

			foreach ($object_array as $object_value) {
                $gacl_api->del_group_object($_POST['group_id'], $object_section_value, $object_value, $group_type);
			}
        }
         
        //Return page.
        $gacl_api->return_page("$PHP_SELF?group_type=".$_POST['group_type']."&group_id=".$_POST['group_id']."");
		
        break;
    case Submit:
        $gacl_api->debug_text("Submit!!");

		//showarray($_POST['selected_'.$_POST['group_type']]);
		//Parse the form values
		//foreach ($_POST['selected_aro'] as $aro_value) {
		while (list(,$object_value) = @each($_POST['selected_'.$_POST['group_type']])) {
				$split_object_value = explode("^", $object_value);
				$selected_object_array[$split_object_value[0]][] = $split_object_value[1];
		}

        //Insert ARO -> GROUP mappings
        while (list($object_section_value,$object_array) = @each($selected_object_array)) {
            $gacl_api->debug_text("Assign: Object ID: $object_section_value to Group: $_POST[group_id]");   

			foreach ($object_array as $object_value) {
				$gacl_api->add_group_object($_POST['group_id'], $object_section_value, $object_value, $group_type);
			}
        }
                
        $gacl_api->return_page("$PHP_SELF?group_type=".$_POST['group_type']."&group_id=".$_POST['group_id']."");

        break;    
    default:
        //
        //Grab all ARO sections for select box
        //
        $query = "select value, name from $group_sections_table order by order_value";
        $rs = $db->Execute($query);

        $rows = $rs->GetRows();

        //showarray($rows);

        $i=0;
        while (list(,$row) = @each($rows)) {
            list($id, $value) = $row;
            
            if ($i==0) {
                $section_value=$value;   
            }

            $options_sections[$id] = $value;
{'fraction_non_alphanumeric': 0.1676330150068213, 'fraction_numerical': 0.0020463847203274215, 'mean_word_length': 3.0560165975103732, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4295075', 'n_tokens_mistral': 2062, 'n_tokens_neox': 1928, 'n_words': 310}