Subversion Repositories ALCASAR

Rev

Rev 2976 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2976 Rev 3037
Line 172... Line 172...
172
     *
172
     *
173
     * @return void
173
     * @return void
174
     */
174
     */
175
    public function run()
175
    public function run()
176
    {
176
    {
177
        header("Cache-Control: no-cache, must-revalidate\n");
177
        header('Cache-Control: no-cache, must-revalidate');
178
        header("Content-Type: text/xml\n\n");
178
        header('Content-Type: text/xml');
179
        $xml = $this->_xml->getXml();
179
        $xml = $this->_xml->getXml();
180
        echo $xml->asXML();
180
        echo $xml->asXML();
181
    }
181
    }
182
 
182
 
183
    /**
183
    /**
Line 226... Line 226...
226
    public function __construct($plugin = "")
226
    public function __construct($plugin = "")
227
    {
227
    {
228
        parent::__construct();
228
        parent::__construct();
229
 
229
 
230
        if (is_string($plugin) && ($plugin !== "")) {
230
        if (is_string($plugin) && ($plugin !== "")) {
231
            $plugin = strtolower($plugin);
231
            if (preg_match('/[^A-Za-z]/', $plugin)) {
-
 
232
                $this->_blockName = ' '; // mask wrong plugin name
232
            if ($plugin === "complete") {
233
            } elseif (($plugin = strtolower($plugin)) === "complete") {
233
                $this->_completeXML = true;
234
                $this->_completeXML = true;
-
 
235
            } elseif (in_array($plugin, array('vitals','hardware','memory','filesystem','network','voltage','current','temperature','fans','power','other','ups'))) {
-
 
236
                $this->_blockName = $plugin;
-
 
237
            } elseif (in_array($plugin, CommonFunctions::getPlugins())) {
-
 
238
                $this->_pluginName = $plugin;
234
            } else {
239
            } else {
235
                $validblocks = array('vitals','hardware','memory','filesystem','network','voltage','current','temperature','fans','power','other','ups');
-
 
236
                if (in_array($plugin, $validblocks)) {
-
 
237
                    $this->_blockName = $plugin;
-
 
238
                } elseif (in_array($plugin, CommonFunctions::getPlugins())) {
-
 
239
                    $this->_pluginName = $plugin;
-
 
240
                } else {
-
 
241
                    $this->_blockName = ' '; //disable all blocks
240
                $this->_blockName = ' '; // disable all blocks
242
                }
-
 
243
            }
241
            }
244
        }
242
        }
245
        $this->_prepare();
243
        $this->_prepare();
246
    }
244
    }
247
}
245
}