예제 #1
0
        // reread component because in version 3.0 the component will be created within the update
        $componentUpdateHandle = new ComponentUpdate($gDb);
        $componentUpdateHandle->readDataByColumns(array('com_type' => 'SYSTEM', 'com_name_intern' => 'CORE'));
        $componentUpdateHandle->setTargetVersion(ADMIDIO_VERSION);
        $componentUpdateHandle->update();
    }
    if ($gDbType === 'mysql') {
        // activate foreign key checks, so database is consistent
        $sql = 'SET foreign_key_checks = 1 ';
        $gDb->query($sql);
    }
    // nach dem Update erst einmal bei Sessions das neue Einlesen des Organisations- und Userobjekts erzwingen
    $sql = 'UPDATE ' . TBL_SESSIONS . ' SET ses_renew = 1 ';
    $gDb->query($sql);
    // create an installation unique cookie prefix and remove special characters
    $gCookiePraefix = 'ADMIDIO_' . $g_organization . '_' . $g_adm_db . '_' . $g_tbl_praefix;
    $gCookiePraefix = strtr($gCookiePraefix, ' .,;:[]', '_______');
    // start php session and remove session object with all data, so that
    // all data will be read after the update
    session_name($gCookiePraefix . '_PHP_ID');
    session_start();
    unset($_SESSION['gCurrentSession']);
    // show notice that update was successful
    $form = new HtmlFormInstallation('installation-form', 'http://www.admidio.org/index.php?page=donate');
    $form->setFormDescription($gL10n->get('INS_UPDATE_TO_VERSION_SUCCESSFUL', ADMIDIO_VERSION_TEXT) . '<br /><br />' . $gL10n->get('INS_SUPPORT_FURTHER_DEVELOPMENT'), '<div class="alert alert-success form-alert"><span class="glyphicon glyphicon-ok"></span><strong>' . $gL10n->get('INS_UPDATING_WAS_SUCCESSFUL') . '</strong></div>');
    $form->openButtonGroup();
    $form->addSubmitButton('next_page', $gL10n->get('SYS_DONATE'), array('icon' => 'layout/money.png'));
    $form->addButton('main_page', $gL10n->get('SYS_LATER'), array('icon' => 'layout/application_view_list.png', 'link' => '../index.php'));
    $form->closeButtonGroup();
    $form->show();
}