Ejemplo n.º 1
0
 function show()
 {
     if ($this->seite != 'index') {
         $return = '';
         $class = $this->seite;
         if (!class_exists($class)) {
             $footer = new Seite($this->path_information);
             die('Modul nicht installiert' . $footer->footer());
         } else {
             $instance = new $class($this->connection, $this->path_information);
             if (!$instance->noframe) {
                 $return .= $this->admin_menu();
             } else {
                 parent::noframe();
             }
             $return .= $instance->show();
         }
         $this->scripts = isset($instance->scripts) ? $instance->scripts : '';
         return $return;
     } else {
         return $this->admin_menu();
     }
 }
 function login($meldung = '', $template = '')
 {
     die('DEPRECATED LOGIN METHOD: ' . __FILE__ . ' ' . __LINE__);
     if (!isset($_SESSION)) {
         session_start();
     }
     if (isset($_POST['user']) && isset($_POST['pass']) && $this->check_login()) {
         return true;
     }
     $vars['uuid'] = $_SESSION['uuid'] = General::uuid();
     if (defined('HTTPS') && HTTPS && !isset($_SERVER['HTTPS'])) {
         header("Location: " . 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']);
     }
     $page = new Seite($this, $template);
     $login_form = new Template(INSTALL_PATH . '/Templates/Login.template.html');
     $meldungen = Template::get_all_parts($login_form->template);
     $vars['meldung'] = $meldungen[$meldung] ? $meldungen[$meldung] : $meldung;
     $vars['action'] = SELF_URL;
     $vars['title'] = $this->seite != 'index' ? $this->rubrik . ' | ' . $this->seite : $this->rubrik;
     if ($navi) {
         $navi = new Navi($this);
         $vars['navi'] = $navi->rubriken();
     }
     if (!isset($_POST['user']) || !isset($_POST['pass'])) {
         $vars['meldung'] .= Html::br() . $meldungen['KENNWORT_EINGEBEN'];
         die($page->header($vars) . Html::div($login_form->parse_template('FORM', $vars)) . $page->footer($vars));
     } else {
         if ($this->check_login()) {
             //if (HTTPS) header("Location: ".'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']);
             header("Location: " . 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']);
         } else {
             die($page->header($vars) . Html::div($login_form->parse_template('FORM', $vars)) . $page->footer($vars));
         }
     }
 }
Ejemplo n.º 3
0
    function show()
    {
        if (!Login::check_login($this->system)) {
            $page = new Seite($this->system, $this->login_tpl);
            $login = new Login($this->system);
            return $page->header() . $login->show() . $page->footer();
        }
        preg_match("/Admin\\/([^\\/|?|#]*)/", $_SERVER['REQUEST_URI'], $m);
        $this->modul = $m[1];
        $installed_modules = $this->connection->db_assoc("SELECT * FROM `RheinaufCMS>Module` WHERE `Backend` != '' ORDER BY `id` ASC");
        for ($i = 0; $i < count($installed_modules); $i++) {
            $this->installed_modules[$installed_modules[$i]['sysID']] = $installed_modules[$i];
        }
        if (!$_SESSION['RheinaufCMS_User']['allowed_actions']) {
            unset($_SESSION['RheinaufCMS_User']);
            $page = new Seite($this->system, $this->login_tpl);
            $login = new Login($this->system);
            return $page->header() . $login->show('Entschuldigung, Sie haben nicht die Erforderlichen Rechte.') . $page->footer();
        }
        if ($_SESSION['RheinaufCMS_User']['Group'] == 'dev') {
            for ($i = 0; $i < count($installed_modules); $i++) {
                $allowed_modules[] = $installed_modules[$i]['sysID'];
            }
            $_SESSION['RheinaufCMS_User']['allowed_modules'] = $this->allowed_modules = $allowed_modules;
        } else {
            $allowed_modules_sql = "SELECT  * FROM `RheinaufCMS>Rechte` WHERE `id` = '" . implode("' OR `id` ='", $_SESSION['RheinaufCMS_User']['allowed_actions']) . "' ";
            $allowed_modules = $this->connection->db_assoc($allowed_modules_sql);
            $this->allowed_modules = array();
            for ($i = 0; $i < count($allowed_modules); $i++) {
                $this->allowed_modules[] = $allowed_modules[$i]['ModulName'];
            }
            $this->allowed_modules = array_unique($this->allowed_modules);
            if (count($this->allowed_modules) == 0) {
                $this->login('', $this->login_tpl);
            }
            $_SESSION['RheinaufCMS_User']['allowed_modules'] = $this->allowed_modules;
        }
        if ($this->modul != '') {
            $return = '';
            //print_r($this->installed_modules);
            $class = $this->modul;
            include INSTALL_PATH . '/' . $this->installed_modules[$class]['Backend'];
            if (!class_exists($class)) {
                $return = 'Modul nicht installiert';
            } else {
                $instance = new $class($this->system);
                $return .= $instance->show();
            }
            $this->scripts = isset($instance->scripts) ? $instance->scripts : '';
        }
        if ($this->system->backend->tabs) {
            $return = Html::div(Html::span($this->system->backend->tabs), array('id' => 'admin_tabs')) . $return;
        }
        if ($this->system->noframe || isset($_GET['noframe'])) {
            return $return;
        }
        $this->system->noframe = true;
        $page = new Html(PROJECT_NAME . ' - Verwaltungsbereich');
        $page->stylesheet('/CSS/Admin.css');
        $page->custom('
		<!-- compliance patch for microsoft browsers -->
<!--[if lt IE 7]>
<script src="/Libraries/IE7/ie7-standard-p.js" type="text/javascript">
</script>
<![endif]-->
		');
        if ($GLOBALS['other_css']) {
            $page->header_string .= $GLOBALS['other_css'];
        }
        if ($GLOBALS['scripts']) {
            $page->header_string .= $GLOBALS['scripts'];
        }
        if (!$GLOBALS['http_request_scripts']) {
            $page->header_string .= Html::script('', array('src' => '/Scripts/XMLHttpRequest.js'));
            $GLOBALS['http_request_scripts'] = true;
        }
        $page->header_string .= Html::script('     	function pinghome ()
	     	{
	     		var url = location.protocol + "/"+"/"+ location.host +"/Admin?ping";
	     		httpRequestGET (url,function(){
	     		setTimeout(pinghome,120000);
	     		}, false)
	     	}
	     	setTimeout(pinghome,120000);');
        if (isset($_GET['nomenu'])) {
            $page->div($return, array('id' => 'content'));
            return $page->flush_page();
        } else {
            $user = $this->system->user['Name'];
            $logout = Html::span("Guten Tag, " . $user . ' ' . Html::a('?logout=' . rawurlencode($user), ' logout'), array('id' => 'logout'));
            $page->div(Html::span($this->system->backend->top) . $logout, array('id' => 'admin_top'));
            $page->div('', array('id' => 'lo_logo'));
            $page->div('', array('id' => 'menu_appendix'));
            $page->custom($this->admin_menu());
            $page->div(Html::div($this->installed_modules[$class]['Name'], array('id' => 'module_name')) . $return . '<br style="clear:both />', array('id' => 'content', 'class' => 'admin content'));
            return $page->flush_page();
        }
    }
Ejemplo n.º 4
0
 public static function SeiteParser($w, $l, $p)
 {
     $Seite = new Seite($w);
     $Seite->loadMe();
     $aC = new anyC();
     $aC->setCollectionOf("Seite");
     $aC->setFieldsV3(array("IF(name = '', header, name) AS name"));
     $aC->addAssocV3("DomainID", "=", $p);
     $select = "\n\t\t<ul style=\"list-style-image:none;list-style-type:none;\">";
     #$select .= NavigationGUI::getOption(-1, "Neue Seite erstellen", $w, "./images/i2/new.gif");
     $select .= NavigationGUI::getOption(0, "Keine Seite", $w, "./images/i2/stop.png", "margin-bottom:5px;");
     while ($s = $aC->getNextEntry()) {
         $select .= NavigationGUI::getOption($s->getID(), $s->A("name"), $w);
     }
     $label = $Seite->A("name") == "" ? $Seite->A("header") : $Seite->A("name");
     if ($Seite->getA() == null) {
         $label = "Seite unbekannt";
     }
     #if($w == -1) $label = "Neue Seite erstellen";
     if ($w == 0) {
         $label = "Keine Seite";
     }
     $select .= "\n\t\t</ul>";
     $html = "\n\t\t<input type=\"hidden\" value=\"{$w}\" name=\"SeiteID\" />\n\t\t\n\t\t<div onclick=\"if(\$('pageSelection').style.display == 'none') new Effect.BlindDown('pageSelection', { duration: 0.3 }); else new Effect.BlindUp('pageSelection', { duration: 0.3 });\"\n\t\t\tstyle=\"background-image:url(./images/i2/go-down.png);background-repeat:no-repeat;background-position:99% 2px;width:246px;padding:3px;border-bottom-style:dotted;border-bottom-width:1px;\" class=\"borderColor1 backgroundColor0\">\n\t\t\t<span id=\"selectedPage\">{$label}</span>\n\t\t</div>\n\t\t<div id=\"pageSelection\" class=\"backgroundColor0 borderColor1\" style=\"border-width:1px;border-style:solid;border-top-width:0px;position:absolute;display:none;width:250px;\">\n\t\t\t<div style=\"overflow:auto;height:150px;\">\n\t\t\t{$select}\n\t\t\t</div>\n\t\t</div>";
     return $html;
 }
Ejemplo n.º 5
0
 public function getCMSHTML()
 {
     $Template = new Template($this->A->TemplateID);
     if ($Template->getA() == null) {
         emoFatalError("multiCMS kann die Seite leider nicht erzeugen", "Das ausgew&auml;hlte Domain-Template wurde nicht gefunden.<br />Bitte w&auml;hlen Sie ein neues Template bei der Domain " . $this->A("url") . " (" . $this->A("title") . ") aus", "multiCMS", "./multiCMS");
     }
     #die("The selected domain-template does not exist.");
     $html = $Template->getA()->html;
     $navi = new mNavigationGUI();
     $Seite = new SeiteGUI($this->seite != 0 ? $this->seite : $this->A->startseite);
     #$Scripts = new ScriptsGUI();
     $Seite->loadMe();
     if ($Seite->A("permalink") != "" and !isset($_GET["permalink"]) and $this->A->startseite != $Seite->getID()) {
         $ex = explode("\n", $this->A("url"));
         header("HTTP/1.1 301 Moved Permanently");
         header("Location: http" . ((isset($_SERVER["HTTPS"]) and $_SERVER["HTTPS"] == "on") ? "s" : "") . "://{$ex['0']}/" . $this->A("permalinkPrefix") . $Seite->A("permalink"));
         header("Connection: close");
         exit;
     }
     if ($Seite->getA() == null) {
         header("HTTP/1.0 404 Not Found");
         emoFatalError("Die gesuchte Seite kann leider nicht gefunden werden", "Die Seite, die Sie suchen, existiert nicht (mehr).<br />Vielleicht m&ouml;chten Sie die Suche auf der <a href=\"/\">Startseite</a> fortsetzen.", "multiCMS", "./multiCMS");
     }
     if (strpos($html, "%%%SEITE%%%") === false) {
         $html = str_replace("%%%PAGE%%%", $Seite->getCMSHTML($this->A->startseite, $this->ID), $html);
     } else {
         $html = str_replace("%%%SEITE%%%", $Seite->getCMSHTML($this->A->startseite, $this->ID), $html);
     }
     $metaTagDesc = $Seite->A("metaTagDescription");
     if ($metaTagDesc == "") {
         $StartSeite = new Seite($this->A->startseite);
         $StartSeite->loadMe();
         $metaTagDesc = $StartSeite->A("metaTagDescription");
     }
     $html = str_replace("%%%NAVIGATION%%%", $navi->getCMSHTML(0, $this->seite != 0 ? $this->seite : $this->A->startseite, $this->ID), $html);
     $html = str_replace("%%%HEADER%%%", $this->A->header, $html);
     $html = str_replace("%%%TITLE%%%", ($this->A->title != "" ? $this->A->title . " - " : "") . $Seite->A("header"), $html);
     #$html = str_replace("%%%SCRIPTS%%%",$Scripts->getCMSHTML($this->ID), $html);
     $html = str_replace("%%%DESCRIPTION%%%", $metaTagDesc, $html);
     $html = SeiteGUI::replaceFunctionCalls($html, $this);
     if (isset($_GET["contentOnly"])) {
         echo $Seite->getCMSHTML($this->A->startseite, $this->ID);
     } else {
         echo $html;
     }
 }
 function login($meldung = '', $navi = true)
 {
     $page = new Seite($this->path_information);
     $login_form = new Template(INSTALL_PATH . '/Templates/Login.template.html');
     $meldungen = Template::get_all_parts($login_form->template);
     $vars['meldung'] = $meldungen[$meldung] ? $meldungen[$meldung] : $meldung;
     $vars['action'] = SELF;
     if (isset($_GET['logout'])) {
         $vars['user'] = $_GET['logout'];
         $vars['meldung'] = $login_form->parse_template('LOGOUT-MELDUNG', $vars);
     }
     $vars['title'] = $this->seite != 'index' ? $this->rubrik . ' | ' . $this->seite : $this->rubrik;
     if ($navi) {
         $navi = new Navi($this->path_information, $this->navi);
         $vars['navi'] = $navi->rubriken();
     }
     if (!isset($_POST['user']) || !isset($_POST['pass'])) {
         $vars['meldung'] .= Html::br() . $meldungen['KENNWORT_EINGEBEN'];
         die($page->header($vars) . Html::div($login_form->parse_template('FORM', $vars)) . $page->footer($vars));
     } else {
         if ($this->check_login()) {
             header("Location: " . 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']);
         } else {
             die($page->header($vars) . Html::div($login_form->parse_template('FORM', $vars)) . $page->footer($vars));
         }
     }
 }