Example #1
0
/*
how new updater will work
in package config.inc.php will be named config.inc.php.new so it cannot be overwritten
1. check for config.inc.php
2. if config file missing ask for details
3. with database details check theres actually an installation of webid if not show link to make fresh install
	- if there is but no config write config file
4. collect query needed to run for version in use
5. update language files
*/
if ($step == 0) {
    if (!file_exists($main_path . 'includes/config.inc.php')) {
        $thisversion = this_version();
        $myversion = check_version();
        echo print_header(true);
        echo show_config_table(false);
    } else {
        $check = check_installation();
        $thisversion = this_version();
        $myversion = check_version();
        echo print_header(true);
        if (!$check) {
            echo '<p>It seems you don\'t currently have a version of WeBid installed we recommend you do a <b><a href="install.php">fresh install</a></b></p>';
        } else {
            echo '<p>Now to <b><a href="?step=2">step 1</a></b></p>';
        }
    }
}
if ($step == 1) {
    $db->connect($_POST['DBHost'], $_POST['DBUser'], $_POST['DBPass'], $_POST['DBName'], $_POST['DBPrefix']);
    $toecho = '<p><b>Step 1:</b> Writing the config file...</p>';
Example #2
0
        $content .= '$DbUser	 = "******";' . "\n";
        $content .= '$DbPassword = "******";' . "\n";
        $content .= '$DBPrefix	= "' . $_POST['DBPrefix'] . '";' . "\n";
        $content .= '$main_path = "' . $path . '";' . "\n";
        $content .= '$MD5_PREFIX = "' . $hash . '";' . "\n";
        $content .= '?>';
        $output = makeconfigfile($content, $path);
        if (!$silent) {
            if ($output) {
                $check = check_installation();
                if ($check) {
                    echo '<p>You appear to already have an installation on WeBid running would you like to do a <a href="update.php">upgrade instead?</a></p>';
                }
                echo '<p>Complete, now to <b><a href="?step=2&URL=' . urlencode($_POST['URL']) . '&EMail=' . $_POST['EMail'] . '&cats=' . $cats . '">step 2</a></b></p>';
            } else {
                echo '<p>WeBid could not automatically create the config file, please could you enter the following into config.inc.php (this file is located in the includes directory)</p>';
                echo '<p><textarea style="width:500px; height:500px;">' . $content . '</textarea></p>';
                echo '<p>Once you\'ve done this, you can continue to <b><a href="?step=2&URL=' . urlencode($_POST['URL']) . '&EMail=' . $_POST['EMail'] . '&cats=' . $cats . '">step 2</a></b></p>';
            }
        } else {
            echo 'OK';
        }
        break;
    default:
        $check = check_installation();
        if ($check) {
            echo '<p>You appear to already have an installation on WeBid running would you like to do a <a href="update.php">upgrade instead?</a></p>';
        }
        echo show_config_table(true);
        break;
}