| Line 59... |
Line 59... |
| 59 |
* @return void
|
59 |
* @return void
|
| 60 |
*/
|
60 |
*/
|
| 61 |
private function _prepare()
|
61 |
private function _prepare()
|
| 62 |
{
|
62 |
{
|
| 63 |
if ($this->_pluginName === null) {
|
63 |
if ($this->_pluginName === null) {
|
| - |
|
64 |
if (((PSI_OS == 'WINNT') || (PSI_OS == 'Linux')) && defined('PSI_WMI_HOSTNAME')) {
|
| - |
|
65 |
define('PSI_EMU_HOSTNAME', PSI_WMI_HOSTNAME);
|
| - |
|
66 |
if (defined('PSI_WMI_USER') && defined('PSI_WMI_PASSWORD')) {
|
| - |
|
67 |
define('PSI_EMU_USER', PSI_WMI_USER);
|
| - |
|
68 |
define('PSI_EMU_PASSWORD', PSI_WMI_PASSWORD);
|
| - |
|
69 |
} else {
|
| - |
|
70 |
define('PSI_EMU_USER', null);
|
| - |
|
71 |
define('PSI_EMU_PASSWORD', null);
|
| - |
|
72 |
}
|
| - |
|
73 |
if (!file_exists(PSI_APP_ROOT.'/includes/os/class.WINNT.inc.php')) {
|
| - |
|
74 |
$this->error->addError("file_exists(class.WINNT.inc.php)", "WINNT is not currently supported");
|
| - |
|
75 |
}
|
| - |
|
76 |
} else {
|
| 64 |
// Figure out which OS we are running on, and detect support
|
77 |
// Figure out which OS we are running on, and detect support
|
| 65 |
if (!file_exists(PSI_APP_ROOT.'/includes/os/class.'.PSI_OS.'.inc.php')) {
|
78 |
if (!file_exists(PSI_APP_ROOT.'/includes/os/class.'.PSI_OS.'.inc.php')) {
|
| 66 |
$this->error->addError("file_exists(class.".PSI_OS.".inc.php)", PSI_OS." is not currently supported");
|
79 |
$this->error->addError("file_exists(class.".PSI_OS.".inc.php)", PSI_OS." is not currently supported");
|
| - |
|
80 |
}
|
| 67 |
}
|
81 |
}
|
| 68 |
|
82 |
|
| 69 |
if (!defined('PSI_MBINFO') && (!$this->_blockName || in_array($this->_blockName, array('voltage','current','temperature','fans','power','other')))) {
|
83 |
if (!defined('PSI_MBINFO') && (!$this->_blockName || in_array($this->_blockName, array('voltage','current','temperature','fans','power','other')))) {
|
| 70 |
// check if there is a valid sensor configuration in phpsysinfo.ini
|
84 |
// check if there is a valid sensor configuration in phpsysinfo.ini
|
| 71 |
$foundsp = array();
|
85 |
$foundsp = array();
|
| Line 123... |
Line 137... |
| 123 |
}
|
137 |
}
|
| 124 |
|
138 |
|
| 125 |
// Create the XML
|
139 |
// Create the XML
|
| 126 |
$this->_xml = new XML($this->_completeXML, '', $this->_blockName);
|
140 |
$this->_xml = new XML($this->_completeXML, '', $this->_blockName);
|
| 127 |
} else {
|
141 |
} else {
|
| - |
|
142 |
if ((PSI_OS == 'WINNT') || (PSI_OS == 'Linux')) {
|
| - |
|
143 |
$plugname = strtoupper(trim($this->_pluginName));
|
| - |
|
144 |
if (defined('PSI_PLUGIN_'.$plugname.'_WMI_HOSTNAME')) {
|
| - |
|
145 |
define('PSI_EMU_HOSTNAME', constant('PSI_PLUGIN_'.$plugname.'_WMI_HOSTNAME'));
|
| - |
|
146 |
if (defined('PSI_PLUGIN_'.$plugname.'_WMI_USER') && defined('PSI_PLUGIN_'.$plugname.'_WMI_PASSWORD')) {
|
| - |
|
147 |
define('PSI_EMU_USER', constant('PSI_PLUGIN_'.$plugname.'_WMI_USER'));
|
| - |
|
148 |
define('PSI_EMU_PASSWORD', constant('PSI_PLUGIN_'.$plugname.'_WMI_PASSWORD'));
|
| - |
|
149 |
} else {
|
| - |
|
150 |
define('PSI_EMU_USER', null);
|
| - |
|
151 |
define('PSI_EMU_PASSWORD', null);
|
| - |
|
152 |
}
|
| - |
|
153 |
} elseif (defined('PSI_WMI_HOSTNAME')) {
|
| - |
|
154 |
define('PSI_EMU_HOSTNAME', PSI_WMI_HOSTNAME);
|
| - |
|
155 |
if (defined('PSI_WMI_USER') && defined('PSI_WMI_PASSWORD')) {
|
| - |
|
156 |
define('PSI_EMU_USER', PSI_WMI_USER);
|
| - |
|
157 |
define('PSI_EMU_PASSWORD', PSI_WMI_PASSWORD);
|
| - |
|
158 |
} else {
|
| - |
|
159 |
define('PSI_EMU_USER', null);
|
| - |
|
160 |
define('PSI_EMU_PASSWORD', null);
|
| - |
|
161 |
}
|
| - |
|
162 |
}
|
| - |
|
163 |
}
|
| - |
|
164 |
|
| 128 |
// Create the XML
|
165 |
// Create the XML
|
| 129 |
$this->_xml = new XML(false, $this->_pluginName);
|
166 |
$this->_xml = new XML(false, $this->_pluginName);
|
| 130 |
}
|
167 |
}
|
| 131 |
}
|
168 |
}
|
| 132 |
|
169 |
|