Beispiel #1
1
 function __construct($header)
 {
     //TODO use https when loggin in
     // use ssh for login
     //		$host = "https://" . OLIV_SSH_HOST . "/" . OLIV_BASE . "index.php";
     $host = "http://" . system::OLIV_SSH_HOST() . "/" . system::OLIV_BASE() . "index.php";
     // load login content xml
     $this->content = OLIVModule::load_content($header);
     // select template for logged of not logged
     if (status::OLIV_USER()) {
         $header->param->template = "logged";
         $this->content->username = OLIVUser::getName(status::OLIV_USER());
         if (status::OLIV_SU()) {
             $this->content->su = status::OLIV_SU();
         } else {
             $this->content->user_groups = OLIVUser::getGroupName(status::OLIV_USER());
         }
     } else {
         // check if wrong login
         if (argv::action() == "login") {
             $header->param->template = "incorrect";
         }
     }
     // load correct template
     $this->template = OLIVModule::load_template($header);
 }
Beispiel #2
0
 public function getSearch()
 {
     $content = new simpleXmlElement("<search></search>");
     if (argv::action() == "search") {
         OLIVPlugin::call($content, "search");
         status::set("search_result", $content);
     }
 }
Beispiel #3
0
//------------------------------------------------------------------------------
// display noscript message
?>
<noscript><div id="noscript">Kein Javascript</div></noscript>
<?php 
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// login state
//   define USER for session
if (array_key_exists('user', $_SESSION)) {
    $user = $_SESSION['user'];
} else {
    $user = $_SESSION['user'] = "";
}
// change user login state
switch (argv::action()) {
    case 'login':
        if (OLIVUser::checkPassword(argv::login(), argv::password())) {
            $user = argv::login();
            // remove login parameters
            argv::remove('action');
            argv::remove('login');
            argv::remove('password');
        }
        break;
    case 'logout':
        $user = "";
        break;
    default:
        break;
}
Beispiel #4
0
 private function activities($header, $article)
 {
     // create index file
     switch (argv::action()) {
         case "create_index":
             $articleName = (string) $header->param->content;
             $index = new OLIVIndex();
             $textNodes = $article->XPath("//text");
             foreach ($textNodes as $text) {
                 $index->insertText((string) $text, "article:{$articleName}", (string) $text['lang']);
             }
             break;
         case "delete_index":
             argv::remove("action");
             break;
     }
 }