function getModuleSetting($pModuleName, $pSetting) { $vModules = parsePHPModules(); if (isset($vModules[$pModuleName][$pSetting])) { return $vModules[$pModuleName][$pSetting]; } else { return ""; } }
private function ShowSystemInfo() { // Server Information $GLOBALS['ProductVersion'] = isc_html_escape(PRODUCT_VERSION); $GLOBALS['PHPVersion'] = isc_html_escape(phpversion()); $GLOBALS['MySQLVersion'] = isc_html_escape(mysql_get_server_info()); $GLOBALS['ServerSoftware'] = isc_html_escape($_SERVER['SERVER_SOFTWARE']); if (GetConfig('DisableSystemInfoEdition')) { $GLOBALS['HideEdition'] = 'display: none'; } else { if (isset($GLOBALS['ProductEditionUpgrade'])) { $GLOBALS['ProductEdition'] .= " (<a href='" . GetConfig('SystemInfoEditionUpgradeLink') . "' target='_blank'>Upgrade</a>)"; } } if (GDEnabled()) { $php_mods = parsePHPModules(); $GLOBALS['GDVersion'] = isc_html_escape($php_mods['gd']['GD Version']); } else { $GLOBALS['GDVersion'] = GetLang('GDMissing'); } if ((bool) ini_get('safe_mode') == true) { $GLOBALS['SafeMode'] = GetLang('Enabled'); } else { $GLOBALS['SafeMode'] = GetLang('Disabled'); } $GLOBALS['MultiByteFunctions'] = array(); if (function_exists("mb_strpos")) { $GLOBALS['MultiByteFunctions'][] = "Multibyte"; } if (function_exists("iconv_strpos")) { $GLOBALS['MultiByteFunctions'][] = "iconv"; } $GLOBALS['MultiByteFunctions'] = implode("<br />", $GLOBALS['MultiByteFunctions']); if (!$GLOBALS['MultiByteFunctions']) { $GLOBALS['MultiByteFunctions'] = GetLang('NotSupported'); } $GLOBALS['RemoteConnections'] = array(); if (function_exists("curl_init")) { $GLOBALS['RemoteConnections'][] = "CURL"; } if (!(bool) ini_get('safe_mode') && ini_get('allow_url_fopen')) { $GLOBALS['RemoteConnections'][] = GetLang('RemoteFOpen'); } $GLOBALS['RemoteConnections'] = implode("<br />", $GLOBALS['RemoteConnections']); if (!$GLOBALS['RemoteConnections']) { $GLOBALS['RemoteConnections'] = GetLang('NoneSupported'); } if (function_exists('pspell_suggest')) { $GLOBALS['PSpell'] = GetLang('Enabled'); } else { $GLOBALS['PSpell'] = GetLang('NotSupported'); } $GLOBALS['OperatingSystem'] = isc_html_escape(php_uname()); $GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("sysinfo"); $GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate(); }
function getModuleSetting($pModuleName, $pSettings) { $vModules = parsePHPModules(); if (is_array($pSettings)) { foreach ($pSettings as $pSetting) { if (isset($vModules[$pModuleName][$pSetting])) { return $vModules[$pModuleName][$pSetting]; } } } else { if (isset($vModules[$pModuleName][$pSettings])) { return $vModules[$pModuleName][$pSettings]; } } return 'Не определено'; }
function load_module() { $array = parsePHPModules(); $module = $array[$_GET["load-module"]]; $html[] = "<table style='width:100%;padding:4px;margin:5px;border:1px solid #005447'>"; while (list($index, $data) = each($module)) { $html[] = "<tr>"; $html[] = "<td class=legend valign='top' style='font-size:14px'>{$index}:</td>"; $html[] = "<td><strong style='font-size:12px'>"; if (is_array($data)) { while (list($a, $b) = each($data)) { $html[] = "<li style='font-size:12px'>{$a}:{$b}</li>"; } } else { $html[] = $data; } $html[] = "</strong></td>"; $html[] = "</tr>"; } $html[] = "</table>"; echo implode("\n", $html); }
function getImapMbox() { $this->db->println("Entering getImapMbox()"); $mods = parsePHPModules(); $this->db->println("Parsing PHP Modules"); // first we will try a regular old IMAP connection: if ($this->ssltype == "") { $this->ssltype = "notls"; } if ($this->sslmeth == "") { $this->sslmeth = "novalidate-cert"; } if ($this->mail_protocol == "pop3") { $port = "110"; } else { if ($mods["imap"]["SSL Support"] == "enabled" && ($this->ssltype == "tls" || $this->ssltype == "ssl")) { $port = "993"; } else { $port = "143"; } } $this->db->println("Building connection string"); if (preg_match("/@/", $this->login_username)) { $mailparts = split("@", $this->login_username); $user = "" . trim($mailparts[0]) . ""; $domain = "" . trim($mailparts[1]) . ""; // This section added to fix a bug when connecting as user@domain.com if ($this->readonly == "true") { if ($mods["imap"]["SSL Support"] == "enabled") { $connectString = "/" . $this->ssltype . "/" . $this->sslmeth . "/user={$user}@{$domain}/readonly"; } else { $connectString = "/notls/novalidate-cert/user={$user}@{$domain}/readonly"; } } else { if ($mods["imap"]["SSL Support"] == "enabled") { $connectString = "/" . $this->ssltype . "/" . $this->sslmeth . "/user={$user}@{$domain}"; } else { $connectString = "/notls/novalidate-cert/user={$user}@{$domain}"; } } } else { if ($this->readonly == "true") { if ($mods["imap"]["SSL Support"] == "enabled") { $connectString = "/" . $this->ssltype . "/" . $this->sslmeth . "/readonly"; } else { $connectString = "/notls/novalidate-cert/readonly"; } } else { if ($mods["imap"]["SSL Support"] == "enabled") { $connectString = "/" . $this->ssltype . "/" . $this->sslmeth; } else { $connectString = "/notls/novalidate-cert"; } } } //$connectString = "{".$this->imapServerAddress."/".$this->mail_protocol.":".$port.$connectString."}".$this->mailbox; $connectString = "{" . $this->imapServerAddress . ":" . $port . "/" . $this->mail_protocol . $connectString . "}" . $this->mailbox; //Reference - http://forums.vtiger.com/viewtopic.php?p=33478#33478 - which has no tls or validate-cert $connectString1 = "{" . $this->imapServerAddress . "/" . $this->mail_protocol . ":" . $port . "}" . $this->mailbox; $this->db->println("Done Building Connection String.. {$connectString} Connecting to box"); //checking the imap support in php if (!function_exists('imap_open')) { echo "<strong>" . $mod_strings['LBL_ENABLE_IMAP_SUPPORT'] . "</strong>"; exit; } if (!($this->mbox = @imap_open($connectString, $this->login_username, $this->secretkey))) { //try second string which has no tls or validate-cert if (!($this->mbox = @imap_open($connectString1, $this->login_username, $this->secretkey))) { global $current_user, $mod_strings; $this->db->println("CONNECTION ERROR - Could not be connected to the server using imap_open function through the connection strings {$connectString} and {$connectString1}"); echo "<br> <b>" . $mod_strings['LBL_MAIL_CONNECT_ERROR'] . "<a href='index.php?module=Users&action=AddMailAccount&return_module=Webmails&return_action=index&record=" . $current_user->id . "'> " . $mod_strings['LBL_HERE'] . "</a>. " . $mod_strings['LBL_PLEASE'] . " <a href='index.php?module=Emails&action=index&parenttab=" . vtlib_purify($_REQUEST['parenttab']) . "'>" . $mod_strings['LBL_CLICK_HERE'] . "</a>" . $mod_strings['LBL_GOTO_EMAILS_MODULE'] . " </b>"; exit; } } $this->db->println("Done connecting to box"); }
/** get a module setting */ function getModuleSetting($pModuleName, $pSetting) { $vModules = parsePHPModules(); return $vModules[$pModuleName][$pSetting]; }
function cron_apc() { $array = parsePHPModules(); $array = $array["apc"]; $page = CurrentPageName(); $apc_cache_info = apc_cache_info(); //print_r($apc_cache_info); while (list($num, $val) = each($apc_cache_info)) { if (is_array($val)) { continue; } if ($num == "file_upload_progress") { continue; } if ($num == "start_time") { $val = date('M d D H:i:s', $val); } if ($num == "mem_size") { $val = FormatBytes($val / 1024); } $html = $html . "\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:14px'>{{$num}}:</td>\n\t\t\t<td><strong>{$val}</strong></td>\n\t\t</tr>\n\t\t\n\t\t"; } $html = $html . "\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:14px'>{cached_files_number}:</td>\n\t\t\t<td><strong>" . count($apc_cache_info["cache_list"]) . "</strong></td>\n\t\t</tr>\n\t"; $html = "\n\t<H1>APC V.{$array["Version"]} {$array["Revision"]}</H1>\n\t<table style='width:100%'>\n\t{$html}\n\t</table>\n\t<div style='text-align:right'>" . texttooltip("{cached_files}", "{cached_files_list}", "APCCachedFileList()") . "</div>\n\t\n\t<script>\n\t\tfunction APCCachedFileList(){\n\t\t\tYahooWin3('650','{$page}?apc-cached-file-list=yes');\n\t\t}\n\t</script>"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
} else { echo '<strong>Off</strong>'; echo '<img src="../img/famfamfam/icon_alert.gif" alt="Warning" class="icon1" />'; echo ' (check information about security risks'; echo '<a href="http://www.php.net/features.safe-mode" target="_blank">'; echo '<img src="../img/famfamfam/icon_info.gif" alt="Security risks" class="icon1" border="0" />'; echo '</a>)'; } ?> </li> <?php } ?> <li><?php $_phpinfo = parsePHPModules(); if (isset($_phpinfo['gd']['GD Support']) && $_phpinfo['gd']['GD Support'] == 'enabled' && isset($_phpinfo['gd']['GD Version'])) { $_phpinfo['gd_version'] = html_specialchars($_phpinfo['gd']['GD Version']); } else { $_phpinfo['gd_version'] = 'n.a.'; } echo '<strong>GD'; if (function_exists('imagegd2')) { echo '2</strong> ' . $_phpinfo['gd_version']; echo '<img src="../img/famfamfam/icon_accept.gif" alt="GD2" class="icon1" />'; $is_gd = true; } elseif (function_exists('imagegd')) { echo '1</strong> ' . $_phpinfo['gd_version']; echo '<img src="../img/famfamfam/icon_alert.gif" alt="GD1" class="icon1" />'; echo ' (GD2 is recommend)'; $is_gd = true;
//checking the imap support in php if (!function_exists('imap_open')) { echo "<strong>" . $mod_strings['LBL_ENABLE_IMAP_SUPPORT'] . "</strong>"; exit; } require_once 'Smarty_setup.php'; require_once "data/Tracker.php"; require_once 'include/logging.php'; require_once 'include/utils/utils.php'; require_once 'include/utils/UserInfoUtil.php'; require_once "modules/Webmails/MailBox.php"; require_once "modules/Webmails/Webmails.php"; require_once "modules/Webmails/MailParse.php"; $MailBox = new MailBox($mailbox); // Check for a valid mailbox and also make sure the needed php_imap module is installed $mods = parsePHPModules(); if (!$MailBox->mbox || !isset($mods["imap"]) || $mods["imap"] == "") { echo "<center><font color='red'><h3>" . $mod_strings['LBL_CONFIGURE_MAIL_SETTINGS'] . "</h3></font></center>"; exit; } // Set the system into degraded service mode where needed $degraded_service = 'false'; if ($MailBox->mail_protocol == "imap" || $MailBox->mail_protocol == "pop3") { $degraded_service = 'true'; } if ($_POST["command"] == "check_mbox_all") { exit; $boxes = array(); $i = 0; foreach ($_SESSION["mailboxes"] as $key => $val) { $MailBox = new MailBox($key);
$vPat3 = "/{$vPat}\\s*{$vPat}\\s*{$vPat}/"; $vPat2 = "/{$vPat}\\s*{$vPat}/"; if (preg_match($vPat3, $vOne, $vMat)) { // 3cols $vModules[$vName][trim($vMat[1])] = array(trim($vMat[2]), trim($vMat[3])); } elseif (preg_match($vPat2, $vOne, $vMat)) { // 2cols $vModules[$vName][trim($vMat[1])] = trim($vMat[2]); } } } } return $vModules; } $pi = phpinfo_array(INFO_GENERAL); $m = parsePHPModules(); if (!empty($m['mysql'])) { $pi = array_merge($pi, array('mysql' => $m['mysql'])); } if (!empty($m['mysqlnd'])) { $pi = array_merge($pi, array('pdo' => $m['mysqlnd'])); } if (!empty($m['PDO'])) { $pi = array_merge($pi, array('pdo' => $m['PDO'])); } if (!empty($m['pdo_mysql'])) { $pi = array_merge($pi, array('pdo_mysql' => $m['pdo_mysql'])); } if (!empty($m['zip'])) { $pi = array_merge($pi, array('zip' => $m['zip'])); }
function getModuleSetting($pModuleName, $pSetting) { $vModules = parsePHPModules(); if (!empty($vModules[$pModuleName][$pSetting])) { return $vModules[$pModuleName][$pSetting]; } }
function getModuleSetting($pModuleName, $pSetting) { $vModules = parsePHPModules(); return $vModules[strtolower($pModuleName)][strtolower($pSetting)]; }
function parseApacheModules() { $input = parsePHPModules(); if (isset($input['apache'])) { $modules = $input['apache']['Loaded Modules']; $mod_list = explode(",", $modules); foreach ($mod_list as $key => $value) { $mod_list[$key] = trim($value); } return $mod_list; } elseif (isset($input['apache2handler'])) { $modules = $input['apache2handler']['Loaded Modules']; $mod_list = explode(" ", $modules); foreach ($mod_list as $key => $value) { $mod_list[$key] = trim($value); } return $mod_list; } //apache2handler return array(); }