do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); if (is_array($error_bucket)) { foreach ($error_bucket as $elem) { $input_errors[] =& $elem["error"]; } } /* if this is an AJAX caller then handle via JSON */ if (isAjax() && is_array($error_bucket)) { input_errors2Ajax(NULL, $error_bucket); exit; } if (!$input_errors) { $do_action = true; $fullname = $_POST['fullname']; $action = $_POST['action']; echo create_cmd_output($action, $a_mount, $fullname); exit; // cause of Ajax } } if (!isset($do_action)) { $do_action = false; $fullname = ''; $action = ''; } // URL GET from the disks_manage_init.php page: // we get the $disk value, must found the $fullname now if (isset($_GET['disk'])) { $disk = $_GET['disk']; $id = array_search_ex($disk, $a_mount, "mdisk"); $fullname = $a_mount[$id]['fullname'];
/* input validation */ $reqdfields = explode(" ", "disk action"); $reqdfieldsn = explode(",", "Disk,Action"); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); /* if this is an AJAX caller then handle via JSON */ if (isAjax() && is_array($error_bucket)) { input_errors2Ajax(NULL, $error_bucket); exit; } if (!$input_errors) { $do_action = true; $disk = $_POST['disk']; $action = $_POST['action']; $partition = $_POST['partitionno']; $umount = $_POST['umount']; echo create_cmd_output($action, $a_disk, $disk, $partition, $umount); exit; // cause of Ajax } } if (!isset($do_action)) { $do_action = false; $disk = ''; $action = ''; $partition = ''; $umount = false; } /* if ajax is calling, give them an update message */ if (isAjax()) { print_info_box_np($savemsg); }