Ejemplo n.º 1
0
if (isset($_SESSION['installation_info']['currency_symbol'])) {
    $currency_symbol = $_SESSION['installation_info']['currency_symbol'];
}
if (isset($_SESSION['installation_info']['selected_optional_modules'])) {
    $selected_optional_modules = $_SESSION['installation_info']['selected_optional_modules'];
}
if (isset($_SESSION['installation_info']['db_populate'])) {
    $db_populate = $_SESSION['installation_info']['db_populate'];
}
//require_once('install/CreateTables.inc.php');
include 'install/InitSchema.php';
global $adb;
$adb = PearDatabase::getInstance();
$initSchema = new Install_InitSchema($adb);
$initSchema->initialize();
installAddons();
// Install Vtlib Compliant Modules
Common_Install_Wizard_Utils::installMandatoryModules();
Installation_Utils::installOptionalModules($selected_optional_modules);
// Unset all of the session variables.
$_SESSION = array();
// If it's desired to kill the session, also delete the session cookie.
// Note: This will destroy the session, and not just the session data!
if (isset($_COOKIE[session_name()])) {
    setcookie(session_name(), '', time() - 42000, '/');
}
// Finally, destroy the session.
session_destroy();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
Ejemplo n.º 2
0
function downloadAndInstallAddons($addons)
{
    $installedHash = getInstalledHash();
    $currentGeneralSettings = Reg::get('settings');
    foreach ($addons as $key => $addon) {
        appUpdateMsg('Checking download for ' . $addon['slug'] . '...');
        $downloadCheckLink = getOption('serviceURL') . 'download.php?appInstallHash=' . APP_INSTALL_HASH . '&installedHash=' . $installedHash . '&appVersion=' . APP_VERSION . '&type=addon&downloadType=install&download=' . $addon['slug'] . '&downloadVersion=' . $addon['version'] . '&downloadToken=' . $GLOBALS['downloadToken'];
        if ($currentGeneralSettings['participateBeta'] == 1) {
            $downloadCheckLink .= '&participateBeta=1';
        }
        $temp = doCall($downloadCheckLink, '', $timeout = 30);
        list($result, , , $curlInfo) = $temp;
        //$result = base64_decode($result);
        //$result = @unserialize($result);
        $result = getServiceResponseToArray($result);
        $cURLErrors = new cURLErrors($curlInfo);
        if ($cURLErrors->isOk()) {
            if ($result['status'] == 'success') {
                $addons[$key]['downloadLink'] = $result['downloadLink'];
                //$downloadCheckLink.'&checked=true';
            } elseif ($result['status'] == 'error') {
                unset($addons[$key]);
                appUpdateMsg('Error while downloading addon ' . $addon['slug'] . ': ' . $result['errorMsg']);
            }
        } else {
            unset($addons[$key]);
            appUpdateMsg('Error while downloading addon ' . $addon['slug'] . ': Unable to communicate with server(' . $cURLErrors->getErrorMsg() . ').');
        }
    }
    downloadAndUnzipAddons($addons);
    installAddons($addons);
    appUpdateMsg('<br>Please <a href="' . APP_URL . '" target="_top">click here</a> to reload the app.');
    updateOption('updateLastCheck', 0);
    //to trigger checkUpdate in next page load
    //$_SESSION['addonAlertCount'] = 0;
    //manageCookies::cookieSet('addonAlertCount',0,array('expire'=>0));
    updateOption('addonAlertCount', '0');
}