Subversion Repositories ALCASAR

Rev

Rev 3037 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 3037 Rev 3100
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 == 'Linux') && defined('PSI_SSH_HOSTNAME') && defined('PSI_SSH_USER') && defined('PSI_SSH_PASSWORD')) {
-
 
65
                $fgthost = preg_split("/:/", PSI_SSH_HOSTNAME, -1, PREG_SPLIT_NO_EMPTY);
-
 
66
                define('PSI_EMU_HOSTNAME', trim($fgthost[0]));
-
 
67
                if (isset($fgthost[1]) && (trim($fgthost[1] !== ''))) {
-
 
68
                    define('PSI_EMU_PORT', trim($fgthost[1]));
-
 
69
                } else {
-
 
70
                    define('PSI_EMU_PORT', 22);
-
 
71
                }
-
 
72
                define('PSI_EMU_USER', PSI_SSH_USER);
-
 
73
                define('PSI_EMU_PASSWORD', PSI_SSH_PASSWORD);
-
 
74
                if (defined('PSI_SSH_ADD_PATHS')) {
-
 
75
                    define('PSI_EMU_ADD_PATHS', PSI_SSH_ADD_PATHS);
-
 
76
                }
-
 
77
                if (defined('PSI_SSH_ADD_OPTIONS')) {
-
 
78
                    define('PSI_EMU_ADD_OPTIONS', PSI_SSH_ADD_OPTIONS);
-
 
79
                }
-
 
80
                if (!file_exists(PSI_APP_ROOT.'/includes/os/class.Linux.inc.php')) {
-
 
81
                    $this->error->addError("file_exists(class.Linux.inc.php)", "Linux is not currently supported");
-
 
82
                }
64
            if (((PSI_OS == 'WINNT') || (PSI_OS == 'Linux')) && defined('PSI_WMI_HOSTNAME')) {
83
            } elseif (((PSI_OS == 'WINNT') || (PSI_OS == 'Linux')) && defined('PSI_WMI_HOSTNAME')) {
65
                define('PSI_EMU_HOSTNAME', PSI_WMI_HOSTNAME);
84
                define('PSI_EMU_HOSTNAME', PSI_WMI_HOSTNAME);
66
                if (defined('PSI_WMI_USER') && defined('PSI_WMI_PASSWORD')) {
85
                if (defined('PSI_WMI_USER') && defined('PSI_WMI_PASSWORD')) {
67
                    define('PSI_EMU_USER', PSI_WMI_USER);
86
                    define('PSI_EMU_USER', PSI_WMI_USER);
68
                    define('PSI_EMU_PASSWORD', PSI_WMI_PASSWORD);
87
                    define('PSI_EMU_PASSWORD', PSI_WMI_PASSWORD);
69
                } else {
88
                } else {
Line 139... Line 158...
139
            // Create the XML
158
            // Create the XML
140
            $this->_xml = new XML($this->_completeXML, '', $this->_blockName);
159
            $this->_xml = new XML($this->_completeXML, '', $this->_blockName);
141
        } else {
160
        } else {
142
            if ((PSI_OS == 'WINNT') || (PSI_OS == 'Linux')) {
161
            if ((PSI_OS == 'WINNT') || (PSI_OS == 'Linux')) {
143
                $plugname = strtoupper(trim($this->_pluginName));
162
                $plugname = strtoupper(trim($this->_pluginName));
-
 
163
                if ((PSI_OS == 'Linux') && defined('PSI_PLUGIN_'.$plugname.'_SSH_HOSTNAME') && defined('PSI_PLUGIN_'.$plugname.'_SSH_USER') && defined('PSI_PLUGIN_'.$plugname.'_SSH_PASSWORD')) {
-
 
164
                    $fgthost = preg_split("/:/", constant('PSI_PLUGIN_'.$plugname.'_SSH_HOSTNAME'), -1, PREG_SPLIT_NO_EMPTY);
-
 
165
                    define('PSI_EMU_HOSTNAME', trim($fgthost[0]));
-
 
166
                    if (isset($fgthost[1]) && (trim($fgthost[1] !== ''))) {
-
 
167
                        define('PSI_EMU_PORT', trim($fgthost[1]));
-
 
168
                    } else {
-
 
169
                        define('PSI_EMU_PORT', 22);
-
 
170
                    }
-
 
171
                    define('PSI_EMU_USER', constant('PSI_PLUGIN_'.$plugname.'_SSH_USER'));
-
 
172
                    define('PSI_EMU_PASSWORD', constant('PSI_PLUGIN_'.$plugname.'_SSH_PASSWORD'));
-
 
173
                    if (defined('PSI_PLUGIN_'.$plugname.'_SSH_ADD_PATHS')) {
-
 
174
                        define('PSI_EMU_ADD_PATHS', constant('PSI_PLUGIN_'.$plugname.'_SSH_ADD_PATHS'));
-
 
175
                    }
-
 
176
                    if (defined('PSI_PLUGIN_'.$plugname.'_SSH_ADD_OPTIONS')) {
-
 
177
                        define('PSI_EMU_ADD_OPTIONS', constant('PSI_PLUGIN_'.$plugname.'_SSH_ADD_OPTIONS'));
-
 
178
                    }
144
                if (defined('PSI_PLUGIN_'.$plugname.'_WMI_HOSTNAME')) {
179
                } elseif (defined('PSI_PLUGIN_'.$plugname.'_WMI_HOSTNAME')) {
145
                    define('PSI_EMU_HOSTNAME', constant('PSI_PLUGIN_'.$plugname.'_WMI_HOSTNAME'));
180
                    define('PSI_EMU_HOSTNAME', constant('PSI_PLUGIN_'.$plugname.'_WMI_HOSTNAME'));
146
                    if (defined('PSI_PLUGIN_'.$plugname.'_WMI_USER') && defined('PSI_PLUGIN_'.$plugname.'_WMI_PASSWORD')) {
181
                    if (defined('PSI_PLUGIN_'.$plugname.'_WMI_USER') && defined('PSI_PLUGIN_'.$plugname.'_WMI_PASSWORD')) {
147
                        define('PSI_EMU_USER', constant('PSI_PLUGIN_'.$plugname.'_WMI_USER'));
182
                        define('PSI_EMU_USER', constant('PSI_PLUGIN_'.$plugname.'_WMI_USER'));
148
                        define('PSI_EMU_PASSWORD', constant('PSI_PLUGIN_'.$plugname.'_WMI_PASSWORD'));
183
                        define('PSI_EMU_PASSWORD', constant('PSI_PLUGIN_'.$plugname.'_WMI_PASSWORD'));
149
                    } else {
184
                    } else {
150
                        define('PSI_EMU_USER', null);
185
                        define('PSI_EMU_USER', null);
151
                        define('PSI_EMU_PASSWORD', null);
186
                        define('PSI_EMU_PASSWORD', null);
152
                    }
187
                    }
-
 
188
                } elseif ((PSI_OS == 'Linux') && defined('PSI_SSH_HOSTNAME') && defined('PSI_SSH_USER') && defined('PSI_SSH_PASSWORD')) {
-
 
189
                    $fgthost = preg_split("/:/", PSI_SSH_HOSTNAME, -1, PREG_SPLIT_NO_EMPTY);
-
 
190
                    define('PSI_EMU_HOSTNAME', trim($fgthost[0]));
-
 
191
                    if (isset($fgthost[1]) && (trim($fgthost[1] !== ''))) {
-
 
192
                        define('PSI_EMU_PORT', trim($fgthost[1]));
-
 
193
                    } else {
-
 
194
                        define('PSI_EMU_PORT', 22);
-
 
195
                    }
-
 
196
                    define('PSI_EMU_USER', PSI_SSH_USER);
-
 
197
                    define('PSI_EMU_PASSWORD', PSI_SSH_PASSWORD);
-
 
198
                    if (defined('PSI_SSH_ADD_PATHS')) {
-
 
199
                        define('PSI_EMU_ADD_PATHS', PSI_SSH_ADD_PATHS);
-
 
200
                    }
-
 
201
                    if (defined('PSI_SSH_ADD_OPTIONS')) {
-
 
202
                        define('PSI_EMU_ADD_OPTIONS', PSI_SSH_ADD_OPTIONS);
-
 
203
                    }
153
                } elseif (defined('PSI_WMI_HOSTNAME')) {
204
                } elseif (defined('PSI_WMI_HOSTNAME')) {
154
                    define('PSI_EMU_HOSTNAME', PSI_WMI_HOSTNAME);
205
                    define('PSI_EMU_HOSTNAME', PSI_WMI_HOSTNAME);
155
                    if (defined('PSI_WMI_USER') && defined('PSI_WMI_PASSWORD')) {
206
                    if (defined('PSI_WMI_USER') && defined('PSI_WMI_PASSWORD')) {
156
                        define('PSI_EMU_USER', PSI_WMI_USER);
207
                        define('PSI_EMU_USER', PSI_WMI_USER);
157
                        define('PSI_EMU_PASSWORD', PSI_WMI_PASSWORD);
208
                        define('PSI_EMU_PASSWORD', PSI_WMI_PASSWORD);