Ejemplo n.º 1
0
Archivo: boot.php Proyecto: eaCe/redaxo
 * Version.
 *
 * @author jan@kristinus.de
 *
 * @package redaxo5
 */
$mypage = 'version';
rex_perm::register('version[live_version]', null, rex_perm::OPTIONS);
// ***** an EPs andocken
rex_extension::register('ART_INIT', function (rex_extension_point $ep) {
    $version = rex_request('rex_version', 'int');
    if ($version != 1) {
        return;
    }
    rex_login::startSession();
    if (!rex_backend_login::hasSession()) {
        throw new rex_exception('no permission for the working version');
    }
    $article = $ep->getParam('article');
    $article->setSliceRevision($version);
    if ($article instanceof rex_article_content) {
        $article->getContentAsQuery();
    }
    $article->setEval(true);
});
rex_extension::register('PAGE_CONTENT_HEADER', function (rex_extension_point $ep) {
    $params = $ep->getParams();
    $return = '';
    $rex_version_article = rex::getProperty('login')->getSessionVar('rex_version_article');
    if (!is_array($rex_version_article)) {
        $rex_version_article = [];
Ejemplo n.º 2
0
<?php

if (!rex::isBackend()) {
    if ($this->getConfig('status') != 'deaktiviert') {
        $session = rex_backend_login::hasSession();
        if (!$session) {
            header('Location: ' . $this->getConfig('url'));
            exit;
        }
    }
}