Example #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);
 }