function com_install($mypath = '') { error_reporting(E_ALL ^ E_NOTICE); global $database; if (is_callable(array('JFactory', 'getDBO'))) { $database = JFactory::getDBO(); } if ($mypath == '') { $mypath = dirname(__FILE__); } require_once $mypath . "/include/functions.php"; require_once $mypath . "/libraries/Archive/archive.php"; ext_RaiseMemoryLimit('50M'); $archive_name = $mypath . '/scripts.tar.gz'; $extract_dir = $mypath . '/'; $result = extArchive::extract($archive_name, $extract_dir); if (!@PEAR::isError($result)) { unlink($archive_name); } else { echo '<pre style="color:white; font-weight:bold; background-color:red;">Error! ' . $result->getMessage() . ' </pre>'; } if (!is_callable(array($database, 'loadNextRow'))) { $database->setQuery("SELECT id FROM #__components WHERE admin_menu_link = 'option=com_extplorer'"); $id = $database->loadResult(); //add new admin menu images $database->setQuery("UPDATE #__components SET admin_menu_img = '../administrator/components/com_extplorer/images/x_icon.png', admin_menu_link = 'option=com_extplorer' WHERE id={$id}"); $database->query(); } }
{ $text = str_replace('&&', '*--*', $text); $text = str_replace('&#', '*-*', $text); $text = str_replace('&', '&', $text); $text = preg_replace('|&(?![\\w]+;)|', '&', $text); $text = str_replace('*-*', '&#', $text); $text = str_replace('*--*', '&&', $text); return $text; } $mainframe = new extMainFrame(); $mypath = realpath(dirname(__FILE__) . '/..'); $archive_name = $mypath . '/scripts.tar.gz'; if (file_exists($archive_name) && !file_exists($mypath . '/scripts/functions.js.php')) { require_once $mypath . "/include/functions.php"; require_once $mypath . "/libraries/Archive/archive.php"; ext_RaiseMemoryLimit('16M'); error_reporting(E_ALL ^ E_NOTICE); $extract_dir = $mypath . '/'; $result = extArchive::extract($archive_name, $extract_dir); if (!PEAR::isError($result)) { unlink($archive_name); } else { die('<html><head><title>eXtplorer - Error!</title></head> <body><h2>Installation needs to be completed!</h2> <p>To complete the eXtplorer Installation you need to extract the contents of the file <strong>scripts.zip</strong> (you can find this file in the extplorer package) and upload it to the subdirectory <strong>/scripts</strong> of your eXtplorer installation. <br/> Please just upload the contents of the extracted folder "/scripts" into the subdirectory <strong>/scripts</strong> and do not create a subdirectory like "/scripts/scripts/". </p> </body></html>'); }
function execAction($dir, $item) { // show file contents global $action; if (@eregi($GLOBALS["images_ext"], $item)) { $html = '<img src="' . make_link('get_image', $dir, rawurlencode($item)) . '" alt="' . $GLOBALS["messages"]["actview"] . ": " . $item . '" /><br /><br />'; } elseif (@eregi($GLOBALS["editable_ext"], $item)) { $geshiFile = _EXT_PATH . '/libraries/geshi/geshi.php'; ext_RaiseMemoryLimit('32M'); // GeSHi 1.0.7 is very memory-intensive include_once $geshiFile; // Create the GeSHi object that renders our source beautiful $geshi = new GeSHi('', '', dirname($geshiFile) . '/geshi'); $file = get_abs_item($dir, $item); $pathinfo = pathinfo($file); if (ext_isFTPMode()) { $file = ext_ftp_make_local_copy($file); } if (is_callable(array($geshi, 'load_from_file'))) { $geshi->load_from_file($file); } else { $geshi->set_source(file_get_contents($file)); } if (is_callable(array($geshi, 'get_language_name_from_extension'))) { $lang = $geshi->get_language_name_from_extension($pathinfo['extension']); } else { $pathinfo = pathinfo($item); $lang = $pathinfo['extension']; } $geshi->set_language($lang); $geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS); $langs = $GLOBALS["language"]; if ($langs == "japanese") { $enc_list = array("ASCII", "ISO-2022-JP", "UTF-8", "EUCJP-WIN", "SJIS-WIN"); $_e0 = strtoupper(mb_detect_encoding($geshi->source, $enc_list, true)); if ($_e0 == "SJIS-WIN") { $_encoding = "Shift_JIS"; } elseif ($_e0 == "EUCJP-WIN") { $_e0 = "EUC-JP"; } elseif ($_e0 == "ASCII") { $_e0 = "UTF-8"; } else { $_encoding = $_e0; } $geshi->set_encoding($_encoding); } $html = $geshi->parse_code(); if ($langs == "japanese") { if (empty($lang) || strtoupper(mb_detect_encoding($html, $enc_list)) != "UTF-8") { $html = mb_convert_encoding($html, "UTF-8", $_e0); } } if (ext_isFTPMode()) { unlink($file); } $html .= '<hr /><div style="line-height:25px;vertical-align:middle;text-align:center;" class="small">Rendering Time: <strong>' . $geshi->get_time() . ' Sec.</strong></div>'; } else { $html = ' <iframe src="' . make_link('download', $dir, $item, null, null, null, '&action2=view') . '" id="iframe1" width="100%" height="100%" frameborder="0"></iframe>'; } $html = str_replace(array("\r", "\n"), array('\\r', '\\n'), addslashes($html)); ?> { "dialogtitle": "<?php echo $GLOBALS['messages']['actview'] . ": " . $item; ?> ", "height": 500, "autoScroll": true, "html": "<?php echo $html; ?> " } <?php }
require_once _EXT_PATH . "/languages/english.php"; } if (file_exists(_EXT_PATH . "/languages/" . $GLOBALS["language"] . "_mimes.php")) { require_once _EXT_PATH . "/languages/" . $GLOBALS["language"] . "_mimes.php"; } else { require_once _EXT_PATH . "/languages/english_mimes.php"; } require_once _EXT_PATH . "/config/mimes.php"; require_once _EXT_PATH . '/libraries/JSON.php'; require_once _EXT_PATH . "/libraries/File_Operations.php"; require_once _EXT_PATH . "/include/header.php"; require_once _EXT_PATH . "/include/footer.php"; require_once _EXT_PATH . "/include/result.class.php"; //------------------------------------------------------------------------------ // Raise Memory Limit ext_RaiseMemoryLimit('8M'); $GLOBALS['ext_File'] = new ext_File(); if (ext_isFTPMode()) { // Try to connect to the FTP server. HOST, PORT, TIMEOUT $ftp_host = extGetParam($_SESSION, 'ftp_host', 'localhost:21'); $url = @parse_url('ftp://' . $ftp_host); $port = empty($url['port']) ? 21 : $url['port']; $ftp = new Net_FTP($url['host'], $port, 20); /** @global Net_FTP $GLOBALS['FTPCONNECTION'] */ $GLOBALS['FTPCONNECTION'] = new Net_FTP($url['host'], $port, 20); $res = $GLOBALS['FTPCONNECTION']->connect(); if (PEAR::isError($res)) { echo $res->getMessage(); $GLOBALS['file_mode'] = $_SESSION['file_mode'] = 'file'; } else { if (empty($_SESSION['ftp_login']) && empty($_SESSION['ftp_pass'])) {
function execAction($dir, $item) { // show file contents echo '<div> <div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div> <div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc"> <h3 style="margin-bottom:5px;">' . $GLOBALS["messages"]["actview"] . ": " . $item . '</h3>'; echo '</div></div></div> <div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div> </div><hr />'; /*$index2_edit_link = str_replace('/index3.php', '/index2.php', make_link('edit', $dir, $item )); echo '<a name="top" class="componentheading" href="javascript:window.close();">[ '._PROMPT_CLOSE.' ]</a> '; $abs_item = get_abs_item($dir, $item); if( get_is_editable( $abs_item) && $GLOBALS['ext_File']->is_writable( $abs_item )) { // Edit the file in the PopUp echo '<a class="componentheading" href="'.make_link('edit', $dir, $item ).'&return_to='.urlencode($_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'] ).'">[ '.$GLOBALS["messages"]["editlink"].' ]</a> '; // Edit the file in the parent window //echo '<a class="componentheading" href="javascript:opener.location=\''.$index2_edit_link.'\'; window.close();">[ '.$GLOBALS["messages"]["editlink"].' ]</a> '; } echo '<a class="componentheading" href="#bottom">[ '._CMN_BOTTOM.' ]</a>'; echo '<br /><br />'; */ if (@eregi($GLOBALS["images_ext"], $item)) { echo '<img src="' . make_link('get_image', $dir, rawurlencode($item)) . '" alt="' . $GLOBALS["messages"]["actview"] . ": " . $item . '" /><br /><br />'; } else { $geshiFile = _EXT_PATH . '/libraries/geshi/geshi.php'; if (file_exists($geshiFile)) { ext_RaiseMemoryLimit('32M'); // GeSHi 1.0.7 is very memory-intensive include_once $geshiFile; // Create the GeSHi object that renders our source beautiful $geshi = new GeSHi('', '', dirname($geshiFile) . '/geshi'); $file = get_abs_item($dir, $item); $pathinfo = pathinfo($file); if (ext_isFTPMode()) { $file = ext_ftp_make_local_copy($file); } if (is_callable(array($geshi, 'load_from_file'))) { $geshi->load_from_file($file); } else { $geshi->set_source(file_get_contents($file)); } if (is_callable(array($geshi, 'getlanguagesuage_name_from_extension'))) { $lang = $geshi->getlanguagesuage_name_from_extension($pathinfo['extension']); } else { $pathinfo = pathinfo($item); $lang = $pathinfo['extension']; } $geshi->set_language($lang); $geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS); $text = $geshi->parse_code(); if (ext_isFTPMode()) { unlink($file); } echo $text; echo '<hr /><div style="line-height:25px;vertical-align:middle;text-align:center;" class="small">Rendering Time: <strong>' . $geshi->get_time() . ' Sec.</strong></div>'; } else { // When GeSHi is not available, just display the plain file contents echo '<div class="quote" style="text-align:left;">' . nl2br(htmlentities($GLOBALS['ext_File']->file_get_contents(get_abs_item($dir, $item)))) . '</div>'; } } //echo '<a href="#top" name="bottom" class="componentheading">[ '._CMN_TOP.' ]</a><br /><br />'; }
} require_once _EXT_PATH . "/config/mimes.php"; require_once _EXT_PATH . '/libraries/JSON.php'; require_once _EXT_PATH . "/libraries/File_Operations.php"; require_once _EXT_PATH . "/include/header.php"; require_once _EXT_PATH . "/include/result.class.php"; if ($action == 'include_javascript') { while (@ob_end_clean()) { } header("Content-Type: text/javascript; charset=" . strtolower($GLOBALS["charset"])); include _EXT_PATH . '/scripts/' . basename(extGetParam($_REQUEST, 'file')) . '.php'; ext_exit(); } //------------------------------------------------------------------------------ // Raise Memory Limit ext_RaiseMemoryLimit('80000M'); $GLOBALS['ext_File'] = new ext_File(); //------------------------------------------------------------------------------ if ($GLOBALS["require_login"]) { // LOGIN require _EXT_PATH . "/include/login.php"; if ($GLOBALS["action"] == "logout") { $auth->onLogout(); } else { if ($GLOBALS["action"] == "login") { $GLOBALS["dir"] = $dir = extGetParam($_SESSION, 'ext_' . $GLOBALS['file_mode'] . 'dir', ''); } login(); if ($GLOBALS["action"] == "login" || empty($_SESSION['credentials_' . $authentication_type]['username'])) { return; }