diff --git a/README.md b/README.md index f61693d..bb2012c 100755 --- a/README.md +++ b/README.md @@ -36,7 +36,6 @@ In version 0.7: - [ ] Display input validation with bootstrap css Validation states (http://formvalidation.io/validators/integer/) - [ ] Bootstrap-table Table Select Checkbox - [ ] Awesome checkboxes (https://github.com/designmodo/Flat-UI) - - [ ] Improve configure target settings menu - [ ] Improve nested table row handling - [ ] Add target and lvm name to url - [ ] Overview/Logical volumes VG selector diff --git a/app/controllers/targets.php b/app/controllers/targets.php index 49a98d6..d78b9ba 100755 --- a/app/controllers/targets.php +++ b/app/controllers/targets.php @@ -198,23 +198,12 @@ public function configure($param1 = false, $param2 = false) { } } else if ($param1 == 'settings') { if (isset($_POST['option'], $_POST['newvalue'], $_POST['iqn'])) { - $iqn = filter_input(INPUT_POST, 'iqn', FILTER_SANITIZE_STRING); - $option = filter_input(INPUT_POST, 'option', FILTER_SANITIZE_STRING); - $newvalue = filter_input(INPUT_POST, 'newvalue', FILTER_SANITIZE_STRING); - - $target = $this->model('target\Target', $iqn); - $target->add_setting($option, $newvalue); + $target = $this->model('target\Target', filter_input(INPUT_POST, 'iqn', FILTER_SANITIZE_STRING)); + $target->add_setting($option = filter_input(INPUT_POST, 'option', FILTER_SANITIZE_STRING), filter_input(INPUT_POST, 'newvalue', FILTER_SANITIZE_STRING)); echo json_encode($target->logging->get_action_result()); } else if (isset($_POST['iqn'])) { - $iqn = filter_input(INPUT_POST, 'iqn', FILTER_SANITIZE_STRING); - - $target = $this->model('target\Target', $iqn); - $data = $target->get_all_settings(); - // cut array in two pieces - $len = count($data); - $view_data[0] = array_slice($data, 0, $len / 2); - $view_data[1] = array_slice($data, $len / 2); - $this->view('targets/settings_table', $view_data); + $target = $this->model('target\Target', filter_input(INPUT_POST, 'iqn', FILTER_SANITIZE_STRING)); + $this->view('targets/settings_table', $target->get_all_settings()); } } else if ($param1 == 'addrule') { if (isset($_POST['iqn'], $_POST['type'], $_POST['id'])) { diff --git a/app/views/targets/settings_table.php b/app/views/targets/settings_table.php index ff064d6..4451cd7 100755 --- a/app/views/targets/settings_table.php +++ b/app/views/targets/settings_table.php @@ -6,44 +6,38 @@