Example #1
0
/**
 * A method to create a simple html page that shows a custom text and a navigation button.
 * This should be used to show notices or errors during installation or update.
 * @param string $message    A (html) message that should be displayed.
 * @param string $url        The url to which the user should be navigated if he clicks the button.
 * @param string $buttonText The text of the button.
 * @param string $buttonIcon The icon of the button.
 * @param bool   $update
 */
function showNotice($message, $url, $buttonText, $buttonIcon, $update = false)
{
    global $gL10n;
    $onClickText = '';
    // show dialog with success notification
    $form = new HtmlFormInstallation('installation-form', $url);
    if ($update) {
        $form->setUpdateModus();
    }
    if ($buttonText === $gL10n->get('INS_UPDATE_DATABASE')) {
        $onClickText = $gL10n->get('INS_DATABASE_IS_UPDATED');
    }
    $form->setFormDescription($message);
    $form->addSubmitButton('next_page', $buttonText, array('icon' => $buttonIcon, 'onClickText' => $onClickText));
    $form->show();
    exit;
}
Example #2
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();
}
Example #3
0
    $gCurrentUser->setValue('FIRST_NAME', $_SESSION['user_first_name']);
    $gCurrentUser->setValue('EMAIL', $_SESSION['user_email']);
    $gCurrentUser->save(false);
    // now create a full user object for system user
    $systemUser = new User($db, $gProfileFields, $systemUserId);
    $systemUser->setValue('LAST_NAME', $gL10n->get('SYS_SYSTEM'));
    $systemUser->save(false);
    // no registered user -> UserIdCreate couldn't be filled
    // now set current user to system user
    $gCurrentUser->readDataById($systemUserId);
    // delete session data
    session_unset();
    // text for dialog
    $text = $gL10n->get('INS_INSTALLATION_SUCCESSFUL') . '<br /><br />' . $gL10n->get('INS_SUPPORT_FURTHER_DEVELOPMENT');
    if (!is_writable('../../adm_my_files')) {
        $text = $text . '
            <div class="alert alert-warning alert-small" role="alert">
                <span class="glyphicon glyphicon-warning-sign"></span>
                ' . $gL10n->get('INS_FOLDER_NOT_WRITABLE', 'adm_my_files') . '
            </div>';
    }
    // show dialog with success notification
    $form = new HtmlFormInstallation('installation-form', 'http://www.admidio.org/index.php?page=donate');
    $form->setFormDescription($text, '<div class="alert alert-success form-alert"><span class="glyphicon glyphicon-ok"></span>
                                      <strong>' . $gL10n->get('INS_INSTALLATION_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();
}