~ubuntu-branches/ubuntu/maverick/cacti/maverick-security

« back to all changes in this revision

Viewing changes to cli/add_graph_template.php

  • Committer: Bazaar Package Importer
  • Author(s): Sean Finney
  • Date: 2010-08-17 22:22:02 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20100817222202-4a173d1dfbfswz71
Tags: 0.8.7g-1
* New upstream release (Closes: #592465).
* Update context in 05_no-adodb.patch to remove fuzz.
* Remove "official" patches from previous release.
* Remove 563955_undefined_index_local_data_id.patch, incorporated upstream.
* Remove CVE-2010-2092.patch, incorporated upstream.
* Import new batch of "official" upstream patches.
* Update apache configuration to work in FastCGI deployments (Closes: #593203).
   - thanks to Thijs Kinkhorst <thijs@uvt.nl> (Closes: #578909).

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
<?php
3
3
/*
4
4
 +-------------------------------------------------------------------------+
5
 
 | Copyright (C) 2004-2009 The Cacti Group                                 |
 
5
 | Copyright (C) 2004-2010 The Cacti Group                                 |
6
6
 |                                                                         |
7
7
 | This program is free software; you can redistribute it and/or           |
8
8
 | modify it under the terms of the GNU General Public License             |
59
59
                                echo "ERROR: You must supply a valid host-id to run this script!\n";
60
60
                                exit(1);
61
61
                        }
62
 
        
 
62
 
63
63
                        break;
64
64
                case "--graph-template-id":
65
65
                        $graph_template_id = $value;
67
67
                                echo "ERROR: You must supply a numeric graph-template-id for all hosts!\n";
68
68
                                exit(1);
69
69
                        }
70
 
        
 
70
 
71
71
                        break;
72
72
                case "--version":
73
73
                case "-V":
97
97
                displayHosts($hosts, $quietMode);
98
98
                exit(0);
99
99
        }
100
 
        
 
100
 
101
101
        if ($displayGraphTemplates) {
102
102
                $graphTemplates = getGraphTemplates();
103
103
                displayGraphTemplates($graphTemplates, $quietMode);
104
104
                exit(0);
105
105
        }
106
 
        
107
 
        /* 
108
 
         * verify required parameters 
109
 
         * for update / insert options 
 
106
 
 
107
        /*
 
108
         * verify required parameters
 
109
         * for update / insert options
110
110
         */
111
111
        if (!isset($host_id)) {
112
112
                echo "ERROR: You must supply a valid host-id for all hosts!\n";
118
118
                exit(1);
119
119
        }
120
120
 
121
 
        /* 
 
121
        /*
122
122
         * verify valid host id and get a name for it
123
123
         */
124
124
        $host_name = db_fetch_cell("SELECT hostname FROM host WHERE id = " . $host_id);
127
127
                exit(1);
128
128
        }
129
129
 
130
 
        /* 
 
130
        /*
131
131
         * verify valid graph template and get a name for it
132
132
         */
133
133
        $graph_template_name = db_fetch_cell("SELECT name FROM graph_templates WHERE id = " . $graph_template_id);
165
165
        echo "    [--quiet]\n\n";
166
166
        echo "Required:\n";
167
167
        echo "    --host-id             the numerical ID of the host\n";
168
 
        echo "    --graph_template-id   the numerical ID of the graph template to be added\n\n";
 
168
        echo "    --graph-template-id   the numerical ID of the graph template to be added\n\n";
169
169
        echo "List Options:\n";
170
170
        echo "    --list-hosts\n";
171
171
        echo "    --list-graph-templates\n";
172
172
        echo "    --quiet - batch mode value return\n\n";
173
173
}
174
174
 
175
 
?>
 
 
b'\\ No newline at end of file'
 
175
?>