Esempio n. 1
0
 /**
  * Model constructor.
  * @param $title
  */
 public function __construct($title)
 {
     $this->title = $title;
     $this->isAuthenticated = Authentication::isAuthenticated();
     if ($this->isAuthenticated) {
         $this->authenticatedUserEntity = Authentication::getUserEntity();
     }
     $this->pageMenu = PageMenu::getPageMenu();
 }
 private function _authenticated()
 {
     $auth = new Authentication();
     return $auth->isAuthenticated();
 }
Esempio n. 3
0
and open the template in the editor.
-->
<html>
    <head>
        <meta charset="UTF-8">
        <meta name=viewport content='width=600'>
        <title>Smart Home</title>
    </head>
    <body>
        <?php 
include_once "shell.php";
session_start();
//start $_SESSION
Authentication::processLogin();
//process login form if submitted
if (Authentication::isAuthenticated()) {
    $nav = new Navigation_Menu();
    $nav->processControlMenu();
    //process nav if submitted
    /******TEST CODE*******/
    if (!empty($_GET['page'])) {
        echo Lights::getForm();
    }
    if (!empty($_POST['lights'])) {
        echo Lights::processPost();
    }
    /******TEST CODE******/
    /***Add new User temp code***/
    if (isset($_GET['username'])) {
        Authentication::createNewUser();
    }