Пример #1
0
 /**
  * Perform the checks.
  */
 public function doChecks()
 {
     // Bolt requires PHP 5.3.3 or higher.
     if (!checkVersion(phpversion(), "5.3.3")) {
         $this->lowlevelError("Bolt requires PHP <u>5.3.3</u> or higher. You have PHP <u>" . phpversion() . "</u>, so Bolt will not run on your current setup.");
     }
     // Check if the vendor folder is present. If not, this is most likely because
     // the user checked out the repo from Git, without running composer.
     if (!file_exists(__DIR__ . '/../../vendor/autoload.php')) {
         $this->lowlevelError("The file <code>vendor/autoload.php</code> doesn't exist. Make sure " . "you've installed the Silex/Bolt components with Composer.");
     }
     // Check if the app/cache file is present and writable
     if (!file_exists(__DIR__ . '/../cache')) {
         $this->lowlevelError("The folder <code>app/cache/</code> doesn't exist. Make sure it's " . "present and writable to the user that the webserver is using.");
     }
     if (!is_writable(__DIR__ . '/../cache')) {
         $this->lowlevelError("The folder <code>app/cache/</code> isn't writable. Make sure it's " . "present and writable to the user that the webserver is using.");
     }
     // Check if the app/config file is present and writable
     if (!is_writable(__DIR__ . '/../config')) {
         $this->lowlevelError("The folder <code>app/config/</code> isn't writable. Make sure " . "it's present and writable to the user that the webserver is using.");
     }
     // If the config folder is OK, but the config files are missing, attempt to fix it.
     $this->lowlevelConfigFix('config.yml');
     $this->lowlevelConfigFix('menu.yml');
     $this->lowlevelConfigFix('contenttypes.yml');
     $this->lowlevelConfigFix('taxonomy.yml');
     // $this->lowlevelError("Done");
 }
Пример #2
0
 /**
  * Perform the checks.
  */
 public function doChecks()
 {
     // Bolt requires PHP 5.3.2 or higher.
     if (!checkVersion(PHP_VERSION, "5.3.2")) {
         $this->lowlevelError("Bolt requires PHP <u>5.3.2</u> or higher. " . "You have PHP <u>" . htmlspecialchars(PHP_VERSION, ENT_QUOTES) . "</u>, so Bolt will not run on your current setup.");
     }
     if (get_magic_quotes_gpc()) {
         $this->lowlevelError("Bolt requires 'Magic Quotes' to be <b>off</b>. Please send your hoster to " . "<a href='http://www.php.net/manual/en/info.configuration.php#ini.magic-quotes-gpc'>this page</a>, and point out the " . "<span style='color: #F00;'>BIG RED BANNER</span> that states that magic_quotes are <u>DEPRECATED</u>. Seriously. <br><br>" . "If you can't change it in the server-settings, or your admin won't do it for you, try adding this line to your " . "`.htaccess`-file: <pre>php_value magic_quotes_gpc off</pre>");
     }
     if (ini_get('safe_mode')) {
         $this->lowlevelError("Bolt requires 'Safe mode' to be <b>off</b>. Please send your hoster to " . "<a href='http://php.net/manual/en/features.safe-mode.php'>this page</a>, and point out the " . "<span style='color: #F00;'>BIG RED BANNER</span> that states that safe_mode is <u>DEPRECATED</u>. Seriously.");
     }
     // Check if the vendor folder is present. If not, this is most likely because
     // the user checked out the repo from Git, without running composer.
     if (!file_exists(BOLT_PROJECT_ROOT_DIR . '/vendor/autoload.php')) {
         $this->lowlevelError("The file <code>vendor/autoload.php</code> doesn't exist. Make sure " . "you've installed the Silex/Bolt components with Composer.");
     }
     // Check if the app/cache file is present and writable
     if (!file_exists(dirname(__FILE__) . '/../cache')) {
         $this->lowlevelError("The folder <code>app/cache/</code> doesn't exist. Make sure it's " . "present and writable to the user that the webserver is using.");
     }
     if (!is_writable(dirname(__FILE__) . '/../cache')) {
         $this->lowlevelError("The folder <code>app/cache/</code> isn't writable. Make sure it's " . "present and writable to the user that the webserver is using.");
     }
     // Check if .htaccess is present and readable
     // tdammers@gmail.com: This is actually a bad thing to check: it means
     // that if we're running on nginx, or rewrites have been set up in the
     // main apache config (which is more efficient than doing it in
     // .htaccess), we still need a dummy .htaccess just for the sake of
     // this check. Plus we can't really tell whether what's *inside*
     // htaccess is doing the right thing or not.
     if (!is_readable(BOLT_WEB_DIR . '/.htaccess')) {
         $this->lowlevelError("The file <code>" . htmlspecialchars(BOLT_WEB_DIR, ENT_QUOTES) . "/.htaccess</code> doesn't exist. Make sure it's " . "present and readable to the user that the webserver is using.");
     }
     // If the config folder is OK, but the config files are missing, attempt to fix it.
     $this->lowlevelConfigFix('config');
     $this->lowlevelConfigFix('menu');
     $this->lowlevelConfigFix('contenttypes');
     $this->lowlevelConfigFix('taxonomy');
     $this->lowlevelConfigFix('routing');
     $this->lowlevelConfigFix('permissions');
     // $this->lowlevelError("Done");
 }
Пример #3
0
function wrsqz_testPlugin(){
//tests the existence of WIRIS Plugin
	global $CFG;
	if (is_dir('../pluginwiris')){
		include('../pluginwiris/wrs_config.php');
		if(checkVersion($CFG->wirisversion, '2.1.25')){
			$ok = true;
			$message='A compatible version of Plugin WIRIS is properly installed in this system. ';
		}else{
			$ok=false;
			$message='WIRIS quizzes requires Plugin WIRIS 2.1.25 or greater. Your version is '. $CFG->wirisversion;
		}
		$message.='Check Plugin WIRIS at <a href="../pluginwiris/test.php">Plugin WIRIS test</a>.';
	}else{
		$ok = false;
		$message='Plugin WIRIS is not installed.';
	}
	printRow('Plugin WIRIS',$ok,$message);
}
Пример #4
0
        $conffile = $old_conffile;
        echo '<font color="#f00"><b>WARNING:</b> Depreciated position of config file!</font><hr/>';
    } else {
        echo "File <b>{$conffile}</b> (nor the depreciated <b>{$old_conffile}</b>) does not exist!";
        echo '</body></html>';
        exit;
    }
}
$lines = file($conffile);
$dom->load($conffile);
if ($dom->schemaValidate('visu_config.xsd')) {
    print "config <b>" . $conffile . " is valid </b> XML<br/>";
    checkVersion($dom);
} else {
    print "config <b>" . $conffile . " is NOT </b> valid XML";
    checkVersion($dom);
    echo '<hr />';
    $errors = libxml_get_errors();
    foreach ($errors as $error) {
        echo libxml_display_error($error);
    }
    libxml_clear_errors();
}
echo '<hr />';
echo '<pre>';
foreach ($lines as $line_num => $line) {
    $error_in_line = in_array($line_num + 1, $error_array);
    if ($error_in_line) {
        echo '<b>';
    }
    printf('<a name="%s">%4d</a>: ', $line_num, $line_num + 1);
Пример #5
0
 /**
  * Check for common misconfigurations, filerights, and whatnot.
  *
  */
 function checkWarnings()
 {
     global $minrequiredphp, $dbversion, $PIVOTX;
     $this->filelist = array();
     // Check if there are any hooks to execute..
     $PIVOTX['extensions']->executeHook('before_checkwarnings', $dummy);
     // We should only check these warnings when logged in.. Whilst displaying
     // them isn't a direct security problem, we should be careful about
     // giving Teh scr1ptk1ddi3zz any pointers.
     if (!$PIVOTX['session']->isLoggedIn()) {
         return;
     }
     if ($PIVOTX['config']->get('dont_check_filerights') != 1) {
         // Check files in pivotx/db/
         $this->_checkFilerights($PIVOTX['paths']['db_path'], "db/", false);
         if (!empty($this->filelist)) {
             $this->_makeFileWarning("db/");
         }
         // Check files in pivotx/templates/
         $this->_checkFilerights($PIVOTX['paths']['templates_path'], "templates/", true);
         if (!empty($this->filelist)) {
             $this->_makeFileWarning("templates/");
         }
         // Check files in pivotx/images/
         $this->_checkFilerights($PIVOTX['paths']['upload_base_path'], basename($PIVOTX['paths']['upload_base_path']) . "/", true);
         if (!empty($this->filelist)) {
             $this->_makeFileWarning(basename($PIVOTX['paths']['upload_base_path']) . "/");
         }
     }
     // Check minimum PHP version.
     if (!checkVersion(phpversion(), $minrequiredphp)) {
         $thiswarning = sprintf(__("The current version of PHP on the server is %s, which is an older version than PivotX requires (%s). PivotX will most likely not work correctly, until the server is updated to a newer version."), phpversion(), $minrequiredphp);
         $this->warnings[] = "<p>" . $thiswarning . "</p>";
     }
     // Check Safe Mode
     if (ini_get('safe_mode') && !$PIVOTX['config']->get('ignore_safe_mode')) {
         $thiswarning = __("This webserver has safe_mode enabled. This doesn't actually make things any 'safer', just more annoying. Please ask your hosting provider to turn it off. See the documentation for more info: <a href='http://docs.pivotx.net/doku.php?id=dealing_with_safe_mode'>Dealing with safe_mode</a>.");
         $this->warnings[] = "<p>" . $thiswarning . "</p>";
     }
     // Check PivotX Setup
     if ((file_exists($PIVOTX['paths']['pivotx_path'] . '../pivotx-setup-safemode.php') || file_exists($PIVOTX['paths']['pivotx_path'] . '../pivotx-setup.php')) && !$PIVOTX['config']->get('ignore_setupscript')) {
         $thiswarning = __('The PivotX installer script "pivotx-setup.php" is still present in the parent folder. You should be aware that this is a potential security risk. We advise you to remove it, or to set an empty password inside it, so that it can\'t be executed by people with bad intentions.');
         $this->warnings[] = "<p>" . $thiswarning . "</p>";
     }
     // Check (old) Pivot Setup - message can't be ignored
     if (file_exists($PIVOTX['paths']['pivotx_path'] . '../pivot-setup-safemode.php') || file_exists($PIVOTX['paths']['pivotx_path'] . '../pivot-setup.php')) {
         $thiswarning = __('The old Pivot installer script "pivot-setup.php" is still present in the parent folder. Please remove it immediately since it\'s not used for PivotX and it is a potential security risk.');
         $this->warnings[] = "<p>" . $thiswarning . "</p>";
     }
     // Check for erroneous 'canonical_host', but only if we actually use it.
     // The check can definitely be improved ...
     if ($PIVOTX['config']->get('dont_add_canonical') == 0) {
         $canonical_host = $PIVOTX['config']->get('canonical_host');
         if ($canonical_host != $PIVOTX['paths']['host']) {
             $thiswarning = __("You are currently logged in at a different host than your canonical host. " . "If <strong>%s</strong> isn't the canonical host you want, change it on the %s screen.");
             $link = '<a href="' . makeAdminPageLink('advconfiguration') . '">' . __('Advanced Configuration') . '</a>';
             $thiswarning = sprintf($thiswarning, $canonical_host, $link);
             $this->warnings[] = "<p>" . $thiswarning . "</p>";
         }
     }
     // Check for 'preferred_admin_location'.
     if ($PIVOTX['config']->get('preferred_admin_location')) {
         $request_url = (empty($_SERVER['HTTPS']) ? "http://" : "https://") . $_SERVER['HTTP_HOST'] . str_replace("/index.php", "/", $_SERVER['REQUEST_URI']);
         $request = parse_url(stripTrailingSlash($request_url));
         $preferred_url = str_replace("/index.php", "/", $PIVOTX['config']->get('preferred_admin_location'));
         $preferred = parse_url(stripTrailingSlash($preferred_url));
         if (empty($preferred['scheme'])) {
             $preferred['scheme'] = "http";
         }
         if ($request['scheme'] != $preferred['scheme'] || $request['host'] != $preferred['host'] || $request['path'] != $preferred['path']) {
             $thiswarning = __("You are currently logged in at a different location than the preferred one. This might cause problems with wrongly calculated links. Please click here to go to the correct location:");
             $thiswarning .= sprintf(" <a href='%s://%s%s/'>%s%s/</a>", $preferred['scheme'], $preferred['host'], $preferred['path'], $preferred['host'], $preferred['path']);
             $this->warnings[] = "<p>" . $thiswarning . "</p>";
         }
     }
     /* -- Commented this out for now. Takes up to two seconds for some servers,
           -- Which is very bad, considering it's called every time on the dashboard page.
           -- Perhaps move this check to scheduler.php?
               
        // Check if we have 'mod rewrite' enabled, but no .htaccess 
        if( ($PIVOTX['config']->get('mod_rewrite')>0) && (!$PIVOTX['config']->get('ignore_modrewrite_check')) && function_exists('get_headers') ) {
                    
            // Get the headers for a web page that we know always exists
            $url = $PIVOTX['paths']['host'].$PIVOTX['paths']['site_url']."search/modrewritecheck";
            
            $headers = get_headers($url);
            
            // $headers[0] should look like 'HTTP/1.1 200 OK', else give warning
            if (strpos($headers[0], "200 OK")===false) {
                $thiswarning = __('\'Mod rewrite\' is enabled, but it seems like the webserver is not set up correctly to serve pages with non-crufty URLs. You should copy the <tt>example.htaccess</tt> from the PivotX distribution to <tt>.htaccess</tt>. Until you\'ve done this, most pages on your site will give a 404-not-found error.');
                $this->warnings[] = "<p>". $thiswarning ."</p>";
            }
            
            
        }  */
     // Check if magic_quotes_runtime is enabled - Warning is commented out for now
     // because we _should_ be able to handle both cases transparently for the user.
     //if( get_magic_quotes_runtime() && (!$PIVOTX['config']->get('ignore_magic_quotes')) {
     //    $thiswarning = __('Your server has a PHP option set that\'s called "Magic quotes" enabled. This might cause PivotX to run sub-optimally.  Look on <a href="http://docs.pivotx.net/doku.php?id=servers_with_magic_quotes">this page</a> to remedy the situation.');
     //    $this->warnings[] = "<p>". $thiswarning ."</p>";
     //}
     /**
      * Commented this out. since PivotX doesn't need to write files in a higher
      * dir than pivotx/, there is no problem with open_basedir..
      */
     // Check Open Basedir
     //        if( ini_get('open_basedir') ) {
     //            $thiswarning = __("This webserver has open_basedir enabled. You'll have a hard time running PivotX in the current configuration. Please ask your hosting provider to turn it off. See the documentation for more info: <a href='http://docs.pivotx.net/doku.php?id=dealing_with_safe_mode'>Dealing with safe_mode</a>.");
     //            $this->warnings[] = "<p>". $thiswarning ."</p>";
     //        }
     // Check Register Globals
     if (ini_get('register_globals') && !$PIVOTX['config']->get('ignore_register_globals')) {
         $thiswarning = __("This webserver has register_globals enabled. This is a serious potential security issue. Please ask your hosting provider to turn it off. See the PHP documentation for more info: <a href='http://php.net/register_globals'>Register Globals</a>.");
         $this->warnings[] = "<p>" . $thiswarning . "</p>";
     }
     $user = $PIVOTX['users']->getUser($PIVOTX['session']->currentUsername());
     // Check if the password is properly salted.
     if ($user['salt'] == "") {
         $thiswarning = __("Your password is not fully encrypted yet. Please go to %myinfo%, and set your password again.");
         $link = sprintf("<a href=\"index.php?page=myinfo\">%s</a>", __("My Info"));
         $thiswarning = str_replace('%myinfo%', $link, $thiswarning);
         $this->warnings[] = "<p>" . $thiswarning . "</p>";
     }
     // Check if there are any hooks to execute..
     $PIVOTX['extensions']->executeHook('after_checkwarnings', $dummy);
 }
Пример #6
0
$files = checkFile();
foreach ($files as $file) {
    $messages[] = $file;
}
/*** check directory existing ***/
$directories = checkDirectory();
foreach ($directories as $dir) {
    $messages[] = $dir;
}
/*** check directory permission to write ***/
$permissions = checkPermission();
foreach ($permissions as $perm) {
    $messages[] = $perm;
}
/*** check module version, if updated by module admin ***/
$modules = checkVersion();
foreach ($modules as $mod) {
    $messages[] = 'You must upgrade module "' . $mod . '" in module administration page.';
}
if (count($messages) === 0) {
    $messages[] = 'Congraturation! You are ready for upgrade XCL2.2.<br />Remove ' . XOOPS_ROOT_PATH . '/legacy22_check.php file.';
    if (!checkPreload()) {
        $messages[] = 'You should remove upgrade22.class.php from ' . XOOPS_ROOT_PATH . '/preload';
    }
}
echo '<html><body><ul><p>See also upgrade manual :<ul><li><a href="http://sourceforge.net/apps/mediawiki/xoopscube/index.php?title=Upgrade22#Upgrade_from_XCL2.1..2A_to_XCL2.2">English</a></li><li><a href="http://sourceforge.net/apps/mediawiki/xoopscube/index.php?title=Upgrade22;ja">Japanese</a></li></ul></p>';
foreach ($messages as $message) {
    echo '<li>' . $message . '</li>';
}
echo '</ul></body></html>';
function checkTable()
Пример #7
0
        echo "<option value=\"{$KVIrcVersion}\">{$KVIrcVersion}</option>";
    }
}
echo "</select>";
echo "<input type=\"submit\" value=\"OK\" />";
echo "</p>";
echo "</form>";
echo "<p>" . $template['addons']['text2'] . ":</p>";
echo "<ul class=\"list\">";
echo "<li>" . $template['addons']['tree1'] . "</li>";
echo "<li>" . $template['addons']['tree2'] . "</li>";
echo "<li>" . $template['addons']['tree3'] . "</li>";
echo "<li>" . $template['addons']['tree4'] . "</li>";
echo "</ul>";
foreach ($addons as $key => $value) {
    if (!checkVersion($version, $value['min'], $value['max'])) {
        continue;
    }
    if (fmod($key, 2) == 0) {
        echo "<table class=\"pair\">";
    } else {
        echo "<table class=\"despair\">";
    }
    echo "<tr class=\"head\"><td colspan=\"2\"><b>" . $value['name'] . "</b> " . $value['ver'] . "</td></tr>";
    echo "<tr>";
    echo "<td class=\"data\">" . $template['custom']['author'] . ":</td>";
    echo "<td>";
    if (is_array($value['author'])) {
        $count = count($value['author']);
        for ($i = 0; $i < $count; $i++) {
            if ($value['mail'][$i] != "") {
Пример #8
0
 /**
  * Get information about the current extension, as an array. Some of these are
  * set by the author of the extension, others are set here.
  *
  * @return array
  */
 public function getInfo()
 {
     if (file_exists($this->basepath . "/readme.md")) {
         $this->info['readme'] = $this->basepath . "/readme.md";
     } else {
         $this->info['readme'] = false;
     }
     if (file_exists($this->basepath . "/config.yml")) {
         $this->info['config'] = $this->namespace . "/config.yml";
         if (is_writable($this->basepath . "/config.yml")) {
             $this->info['config_writable'] = true;
         } else {
             $this->info['config_writable'] = false;
         }
     }
     $this->info['version_ok'] = checkVersion($this->app['bolt_version'], $this->info['required_bolt_version']);
     $this->info['namespace'] = $this->namespace;
     $this->info['basepath'] = $this->basepath;
     return $this->info;
 }
Пример #9
0
usort($aFilteredItems, "compare_" . $g_szRequestedSortOrder . "_" . $g_szRequestedSortDirection);
$g_iMaximumPage = (int) ($iCount / $iMaxItemsPerPage);
if ($g_iCurrentPage < 0) {
    $g_iCurrentPage = 0;
} else {
    if ($g_iCurrentPage > $g_iMaximumPage) {
        $g_iCurrentPage = $g_iMaximumPage;
    }
}
$aItemsToList = array_slice($aFilteredItems, $g_iCurrentPage * $iMaxItemsPerPage, $iMaxItemsPerPage, false);
echo "\t<div class=\"header\">\n";
print_header_or_footer();
echo "\t</div>\n";
$idx = 0;
foreach ($aItemsToList as $aItem) {
    if (!checkVersion($g_szRequestedVersion, $aItem["min_kvirc_version"])) {
        continue;
    }
    // invalid version
    if ($idx > 0) {
        echo "\t<div class=\"item_separator\"></div>\n";
    }
    echo "\t<div class=\"item_entry\">\n";
    echo "\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n";
    echo "\t\t\t<tr>\n";
    echo "\t\t\t\t<td valign=\"top\" width=\"80\" rowspan=\"2\">\n";
    echo "\t\t\t\t\t<div class=\"item_thumb\">\n";
    echo "\t\t\t\t\t\t<a href=\"" . $szScreenshotPath . "/" . $aItem["screen"] . "\"><img src=\"" . $szThumbPath . "/thumb_" . $aItem["screen"] . "\" border=\"0\"></a>\n";
    echo "\t\t\t\t\t</div>\n";
    echo "\t\t\t\t</td>\n";
    echo "\t\t\t\t<td valign=\"top\">\n";
Пример #10
0
foreach ($prerequisites_config["php_extensions"] as $ext) {
    if (!extension_loaded($ext)) {
        $prerequisites .= "Missing {$ext} PHP extension" . PHP_EOL;
    }
}
// check mysql
if (!extension_loaded('mysqli')) {
    $prerequisites .= "Cannot check MySQL connection, version and settings because PHP mysqli extension is not loaded" . PHP_EOL;
} else {
    if (!DatabaseUtils::connect($link, $db_params, null)) {
        $prerequisites .= "Failed to connect to database " . $db_params['db_host'] . ":" . $db_params['db_port'] . " user:"******". Please check the database settings you provided and verify that MySQL is up and running." . PHP_EOL;
    } else {
        // check mysql version and settings
        $mysql_version = getMysqlSetting($link, 'version');
        // will always return the value
        if (!checkVersion($mysql_version, $prerequisites_config["mysql_min_version"])) {
            $prerequisites .= "MySQL version should be >= " . $prerequisites_config["mysql_min_version"] . " (current version is {$mysql_version})" . PHP_EOL;
        }
        $lower_case_table_names = getMysqlSetting($link, 'lower_case_table_names');
        if (!isset($lower_case_table_names)) {
            $prerequisites .= "Please set 'lower_case_table_names = " . $prerequisites_config["lower_case_table_names"] . "' in my.cnf and restart MySQL" . PHP_EOL;
        } else {
            if (intval($lower_case_table_names) != intval($prerequisites_config["lower_case_table_names"])) {
                $prerequisites .= "Please set 'lower_case_table_names = " . $prerequisites_config["lower_case_table_names"] . "' in my.cnf and restart MySQL (current value is {$lower_case_table_names})" . PHP_EOL;
            }
        }
        $thread_stack = getMysqlSetting($link, 'thread_stack');
        if (!isset($thread_stack)) {
            $prerequisites .= "Please set 'thread_stack >= " . $prerequisites_config["thread_stack"] . "' in my.cnf and restart MySQL" . PHP_EOL;
        } else {
            if (intval($thread_stack) < intval($prerequisites_config["thread_stack"])) {
Пример #11
0
 private function infoHelper($path)
 {
     $filename = $path . "/extension.php";
     $namespace = basename($path);
     if (is_readable($filename)) {
         include_once $filename;
         if (function_exists($namespace . '\\info')) {
             $info = call_user_func($namespace . '\\info');
             $info['enabled'] = $this->isEnabled($namespace);
             if (file_exists($path . "/readme.md")) {
                 $info['readme'] = $namespace . "/readme.md";
             }
             if (file_exists($path . "/config.yml")) {
                 $info['config'] = $namespace . "/config.yml";
                 if (is_writable($path . "/config.yml")) {
                     $info['config_writable'] = true;
                 } else {
                     $info['config_writable'] = false;
                 }
             }
             $info['version_ok'] = checkVersion($GLOBALS['bolt_version'], $info['required_bolt_version']);
             $info['namespace'] = $namespace;
             if (!isset($info['dependencies'])) {
                 $info['dependencies'] = array();
             }
             if (!isset($info['tags'])) {
                 $info['tags'] = array();
             }
             if (!isset($info['priority'])) {
                 $info['priority'] = 10;
             }
             return $info;
         } else {
             $this->app['log']->add("Couldn't initialize {$namespace}: function 'init()' doesn't exist", 3);
             return false;
         }
     }
 }
Пример #12
0
/**
 * Check version of installer and go to first install.json step
 */
function step3()
{
    $branch = $_GET['branch'];
    $dirName = 'QuantumCMS-' . $branch . '/';
    $archive = new ZipArchive();
    if ($archive->open($branch . '.zip') === true) {
        $fp = $archive->getStream($dirName . 'install.json');
        if (!$fp) {
            echo '<b>Invalid ZIP File. Please try again later or contact Team-Quantum.</b>';
        } else {
            file_put_contents('install.json', $fp);
            $installDetails = json_decode(file_get_contents('install.json'));
            if (!checkVersion($installDetails->installer)) {
                echo '<b>This installer is too old for installing the selected branch.</b><br /><br />';
                echo '<form method="get">';
                echo '<input class="btn btn-default" type="submit" value="Update install.php" />';
                echo '<input type="hidden" name="step" value="3a" />';
                echo '<input type="hidden" name="branch" value="' . $branch . '" />';
                echo '</form>';
            } else {
                header('Location: install.php?step=4&branch=' . $branch);
            }
        }
    } else {
        echo '<b>Error while downloading repository, please try again later.</b>';
    }
}
Пример #13
0
 /**
  * Get information about the current extension, as an array. Some of these are
  * set by the author of the extension, others are set here.
  *
  * @return array
  */
 public function getInfo()
 {
     if (file_exists($this->basepath . "/readme.md")) {
         $this->info['readme'] = $this->basepath . "/readme.md";
     } else {
         $this->info['readme'] = false;
     }
     $configFile = $this->getConfigFile();
     if (file_exists($configFile)) {
         if (BOLT_COMPOSER_INSTALLED && strpos($configFile, BOLT_CONFIG_DIR) === 0) {
             $this->info['config'] = "app/config/" . $this->namespace . ".yml";
         } else {
             $this->info['config'] = "app/extensions/" . $this->namespace . "/config.yml";
         }
         if (is_writable($configFile)) {
             $this->info['config_writable'] = true;
         } else {
             $this->info['config_writable'] = false;
         }
     }
     $this->info['version_ok'] = checkVersion($this->app['bolt_version'], $this->info['required_bolt_version']);
     $this->info['namespace'] = $this->namespace;
     $this->info['basepath'] = $this->basepath;
     return $this->info;
 }
Пример #14
0
		<div id="center">
		<?php 
if (!defined('SECURITY_CONSTANT')) {
    exit;
}
if (is_dir('../pluginwiris')) {
    include '../pluginwiris/wrs_config.php';
    if (checkVersion($CFG->wirisversion, '2.1.25')) {
        $toInclude = './install/pages/';
        if (isset($_POST['step'])) {
            $toInclude .= basename($_POST['step']) . '.php';
        } else {
            if (isset($_GET['db'])) {
                $toInclude .= 'db.php';
            }
        }
        if (is_file($toInclude)) {
            include $toInclude;
        } else {
            include './install/pages/0.php';
        }
    } else {
        echo utf8_htmlentities(translate('WIRIS Quizzes requires Plugin WIRIS 2.1.25 or greater. Your current Plugin WIRIS version is ') . $CFG->wirisversion . translate('. You can install it from')) . ' <a href="http://www.wiris.com/component/option,com_wrapper/Itemid,92/lang,es/">' . utf8_htmlentities(translate('here')) . '</a>.';
    }
} else {
    echo utf8_htmlentities(translate('You must install Plugin WIRIS before install WIRIS Quizzes. You can install it from')) . ' <a href="http://www.wiris.com/component/option,com_wrapper/Itemid,92/lang,es/">' . utf8_htmlentities(translate('here')) . '</a>.';
}
?>
		</div>
Пример #15
0
}
$lang = isset($_GET['lang']) ? $_GET['lang'] : 'de';
initLanguages($lang);
$step = isset($_GET['step']) ? $_GET['step'] : 0;
$lastStep = isset($_GET['laststep']) ? $_GET['laststep'] : 0;
if ($lastStep == 6 && $step == 5 && @$_SESSION['webgui'] == 0) {
    $step = 4;
}
if (isset($_POST['install']) && $lastStep == 4 && $step == 5) {
    if (!in_array('webgui', $_POST['install'])) {
        $step = 6;
    }
}
$nextStep = $step + 1;
$prevStep = $step - 1 < 0 ? 0 : $step - 1;
if ($step == 1 && checkVersion() == 0) {
    printHeader();
    print "<td colspan=\"2\" valign=\"top\" style=\"padding: 15px;\">";
    print "<br><font color=\"red\">" . $text['error'] . ":</font><br><br>" . $text['download'];
    print "</td>";
    printFooter();
    exit;
}
if ($step == 0) {
    //--------------------------- step 0 - begin -------------------------------
    $_SESSION['APIDIR'] = 'txt-db-api';
    $_SESSION['DBDIR'] = 'databases';
    $_SESSION['version'] = '';
    $_SESSION['examples'] = 1;
    $_SESSION['webgui'] = 1;
    $_SESSION['doc'] = 1;
Пример #16
0
    createXmlDocument($domtree, $xmlRoot, $XmlMode);
    libxml_use_internal_errors(true);
    $xml = simplexml_load_string($xmlstr);
    if (!$xml) {
        $ResponseText = "XML Error: " . get_xml_error($xmlstr);
        throw new Exception($ResponseText, XMLRESULT_XML_ERROR);
    }
    $attributes = $xml->attributes();
    $XmlMode = $attributes["XmlMode"];
    $ProtocolVersion = $attributes["ProtocolVersion"];
    $LibraryVersion = $attributes["LibraryVersion"];
    $LibraryName = $attributes["LibraryName"];
    $ClientName = $attributes["ClientName"];
    // Use requested version
    $xmlRoot->setAttribute("ProtocolVersion", $ProtocolVersion);
    checkVersion($ProtocolVersion, LIBDVDETECT_PROTOCOL_VERSION);
    $mysqli = connect_server();
    // Check connection
    if (!$mysqli) {
        $ResponseText = "Cannot connect to database.\nSQL Error: " . mysqli_connect_error();
        throw new Exception($ResponseText, XMLRESULT_SQL_ERROR);
    }
    submit($mysqli, $xml, $ProtocolVersion);
} catch (Exception $e) {
    $Result = $e->getCode();
    $ResponseText = $e->getMessage();
}
disconnect_server($mysqli);
$mysqli = null;
// Create response
$responseTag = $domtree->createElement("response");
Пример #17
0
define("STYLE_DEBUG", false);
define("SCRIPT_DEBUG", false);
require_once "lib/private/locale.php";
require_once "lib/private/tools_site.php";
// PHP version check
if (PHP_VERSION_ID < 50304) {
    echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
    echo L("PHPVersionWarning");
    die;
}
// Old browser check
if (!isset($_GET["nocheck"])) {
    include_once "oldbrowser.php";
}
// Update or setup required check
if (!file_exists("lib/config/config.php") || !checkVersion($gVersion)) {
    include_once "runsetup.php";
    die;
}
// Site framework
loadSiteSettings();
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
    <head>
        <title>Raidplaner</title>
        <meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
        <meta name="keywords" content="raidplaner, ppx"/>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
Пример #18
0
    $update_info = file_get_contents('http://www.admidio.org/update.txt');
    // Admidio Versionen vom Server übergeben
    $stableVersion = getUpdateVersion($update_info, 'Version=');
    $betaVersion = getUpdateVersion($update_info, 'Beta-Version=');
    $betaRelease = getUpdateVersion($update_info, 'Beta-Release=');
    // Keine Stabile Version verfügbar (eigentlich unmöglich)
    if ($stableVersion === '') {
        $stableVersion = 'n/a';
    }
    // Keine Beatversion verfügbar
    if ($betaVersion === '') {
        $betaVersion = 'n/a';
        $betaRelease = '';
    }
    // Auf Update prüfen
    $versionUpdate = checkVersion(ADMIDIO_VERSION, $stableVersion, $betaVersion, $betaRelease, ADMIDIO_VERSION_BETA);
}
// Nur im Anzeigemodus geht es weiter, ansonsten kann der aktuelle Updatestand
// in der Variable $version_update abgefragt werden.
// $version_update (0 = Kein Update, 1 = Neue stabile Version, 2 = Neue Beta-Version, 3 = Neue stabile + Beta Version, 99 = Keine Verbindung)
if ($getMode === 2) {
    /***********************************************************************/
    /* Updateergebnis anzeigen */
    /***********************************************************************/
    if ($versionUpdate === 1) {
        $versionstext = $gL10n->get('UPD_NEW');
    } elseif ($versionUpdate === 2) {
        $versionstext = $gL10n->get('UPD_NEW_BETA');
    } elseif ($versionUpdate === 3) {
        $versionstext = $gL10n->get('UPD_NEW_BOTH');
    } elseif ($versionUpdate === 99) {
/**********************************************
* 	FlippingBook Gallery Component.
*	� Mediaparts Interactive. All rights reserved.
* 	Released under Commercial License.
*	www.page-flip-tools.com
**********************************************/
defined('_JEXEC') or die;
jimport('joomla.application.component.controller');
$lang =& JFactory::getLanguage();
$lang->load('flippingbook', JPATH_COMPONENT);
function checkVersion()
{
    $db =& JFactory::getDBO();
    require_once JPATH_COMPONENT . DS . 'updatescript.php';
}
checkVersion();
class FlippingBookController extends JController
{
    function __construct($default = array())
    {
        parent::__construct($default);
        $this->registerTask('main', 'showMain');
        $this->registerTask('configuration', 'showConfiguration');
        $this->registerTask('save_configuration', 'saveConfiguration');
        $this->registerTask('apply_configuration', 'saveConfiguration');
        $this->registerTask('cancel_configuration', 'cancelConfiguration');
        $this->registerTask('category_manager', 'showCategories');
        $this->registerTask('add_category', 'editCategory');
        $this->registerTask('edit_category', 'editCategory');
        $this->registerTask('save_category', 'saveCategory');
        $this->registerTask('apply_category', 'saveCategory');
Пример #20
0
 function minifyURLS()
 {
     // if the PHP version is too low, we return the HTML, without doing anything.
     if (!checkVersion(phpversion(), '5.1.6')) {
         debug('PHPversion too low to us Minify: ' . phpversion());
         return $this->html;
     }
     $head = $this->_getHead();
     if (empty($this->head)) {
         debug("Couldn't find a <head> section to minify");
     } else {
         $this->_getScripts();
         $this->_minifyScriptURLs();
     }
     $this->_getStylesheets();
     $this->_minifyStylesheetURLs();
     return $this->html;
 }