Ejemplo n.º 1
0
        include '../includes/config.inc.php';
        include 'sql/dump.inc.php';
        $queries = count($query);
        $db->connect($DbHost, $DbUser, $DbPassword, $DbDatabase, $DBPrefix);
        $from = isset($_GET['from']) ? $_GET['from'] : 0;
        $fourth = floor($queries / 4);
        $to = $queries - $from > 50 ? $from + 50 : $queries;
        // if this is a silent install, run all the queries in one go
        if ($silent) {
            $to = $queries;
        } else {
            echo 'Writing to database: ' . floor($to / $queries * 100) . '% Complete<br>';
            flush();
        }
        for ($i = $from; $i < $to; $i++) {
            $db->direct_query($query[$i]);
        }
        if (!$silent) {
            if ($i < $queries) {
                echo '<script type="text/javascript">window.location = "install.php?step=2&URL=' . urlencode($_GET['URL']) . '&EMail=' . $_GET['EMail'] . '&cats=' . $_GET['cats'] . '&from=' . $i . '";</script>';
            } else {
                echo '<p>Installation complete.</p>
					<p>What do I do now?</p>
					<ul>
						<li>Your WeBid password salt: <span style="color: #FF0000; font-weight:bold;">' . $_SESSION['hash'] . '</span> You should make note of this random code, it is used to secure your users passwords. It is stored in your config file if you accidently delete this file and don\'t have this code all your users will have to reset their passwords</li>
						<li>Remove the install folder from your server. You will not be able to use WeBid until you do this.</li>
						<li>Finally set-up your admin account <a href="' . $_GET['URL'] . 'admin/" style="font-weight:bold;">here</a></li>
						<li>And don\'t forget to check out our <a href="http://www.webidsupport.com/forums/">support forum</a></li>
					</ul>';
            }
        } else {
Ejemplo n.º 2
0
 $installed_version = 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>';
     exit;
 }
 include 'sql/updatedump.inc.php';
 echo '<p>Upgrading to v' . $new_version . ' from ' . $installed_version . '</p>';
 $queries = count($query);
 $from = isset($_GET['from']) ? $_GET['from'] : 0;
 if ($queries > 0 && $from < $queries) {
     $next = $from + 25;
     $to = $next > $queries ? $queries : $next;
     echo 'Writing to database: ' . floor($to / $queries * 100) . '% Complete<br>';
     for ($i = $from; $i < $to; $i++) {
         $db->direct_query($query[$i]);
     }
     if ($next < $queries) {
         echo '<script type="text/javascript">window.location = "update.php?step=1&from=' . $next . '";</script>';
         exit;
     }
 }
 if (file_exists('scripts/' . $new_version . '.php')) {
     echo '<b>Running database update script</b><br>';
     include 'scripts/' . $new_version . '.php';
     echo '<b>Update script complete</b><br>';
 }
 // update database version
 $db->direct_query("UPDATE `" . $DBPrefix . "settings` SET `value` = '" . $new_version . "' WHERE fieldname = 'version';");
 if ($new_version == $package_version) {
     echo '<p>Update almost complete, remove the install folder from your server to complete the upgrade</p>';