diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..499c4d3 --- /dev/null +++ b/composer.json @@ -0,0 +1,18 @@ +{ + "name": "cacti/plugin_quicktree", + "description": "plugin_quicktree plugin for Cacti", + "license": "GPL-2.0-or-later", + "require-dev": { + "pestphp/pest": "^1.23" + }, + "config": { + "allow-plugins": { + "pestphp/pest-plugin": true + } + }, + "autoload-dev": { + "files": [ + "tests/bootstrap.php" + ] + } +} diff --git a/quicktree.php b/quicktree.php index b9b8dff..1e49f2e 100644 --- a/quicktree.php +++ b/quicktree.php @@ -27,6 +27,7 @@ chdir('../../'); include_once('include/auth.php'); +include_once('plugins/quicktree/quicktree_security.php'); define('QUICKTREE_BASE_URI', $config['url_path'] . 'plugins/quicktree/'); @@ -45,6 +46,7 @@ set_default_action(); $action = get_request_var('action'); +$location = quicktree_normalize_location(get_nfilter_request_var('location')); $user = $_SESSION['sess_user_id']; /* ================= input validation ================= */ @@ -55,8 +57,6 @@ $action = $code_actions[$drp_action]; } -header('action_3_new: '. $action); - switch ($action) { case 'add': $graph = 0; @@ -152,9 +152,10 @@ html_start_box($form_actions[$drp_action], '60%', '', '3', 'center', ''); - $queryrows = db_fetch_assoc("SELECT g.id, g.name + $queryrows = db_fetch_assoc_prepared('SELECT g.id, g.name FROM graph_tree AS g - ORDER BY g.name"); + ORDER BY g.name', + array()); print '