Refactored a div class tag to be more general.

Added site style to the secure pages. Renamed LoginController
to SecureLoginController.
This commit is contained in:
2017-10-30 11:01:59 -04:00
parent 9a073edded
commit 2628cc8b80
10 changed files with 107 additions and 39 deletions

View File

@@ -13,8 +13,7 @@ class AboutView extends View
public function page()
{
$body = <<<HTML
<div class="team">
<h1>Roster:</h1>
<div class="content">
<div class="card">
<h2>James Murray - Project Manager</h2>
<img src="assets/james_murray.jpg" height="1365" width="1372" alt="James Murray">

22
lib/MinutesView.php Normal file
View File

@@ -0,0 +1,22 @@
<?php
require_once "View.php";
/**
* Created by PhpStorm.
* User: sean
* Date: 10/30/17
* Time: 10:37 AM
*/
class MinutesView extends View
{
public function page(){
$body = <<<HTML
HTML;
return $body;
}
}

View File

@@ -6,7 +6,7 @@
* Date: 10/29/17
* Time: 6:59 PM
*/
class LoginController
class SecureLoginController
{
public function __construct($get, $post, $logins)
{

33
lib/SecureLoginView.php Normal file
View File

@@ -0,0 +1,33 @@
<?php
require_once "View.php";
class SecureLoginView extends View
{
public function page()
{
$body = <<<HTML
<div class="content">
<div class="card">
<form action="../post/login.php" method="post">
<fieldset>
<p>
<label for="username">Username:</label>
<input type="text" id="username" name="username" placeholder="Username">
</p>
<p>
<label for="password">Password:</label>
<input type="password" id="password" name="password" placeholder="Password">
</p>
<p><input type="submit" name="Submit" value="Submit"></p>
</fieldset>
</form>
</div>
</div>
HTML;
return $body;
}
}

View File

@@ -1,4 +1,5 @@
<?php
require_once "prelude.inc.php";
/**
* Created by PhpStorm.
@@ -10,19 +11,18 @@ class View
{
public function __construct() {
$this->addNav("Home", "./");
$this->addNav("Progress", "./");
$this->addNav("Meet The Team", "./about.php");
$this->addNav("Home", ROOT);
$this->addNav("Meet The Team", ROOT . "about.php");
$this->addNav("Secure", ROOT ."secure");
$this->addNav("Course Site", "https://cse.msu.edu/~cse435/");
$this->addNav("Secure", "./secure");
}
public function head(){
$root = ROOT;
$html = <<<HTML
<meta charset="utf-8">
<meta charset="UTF-8">
<title>$this->title</title>
<link href="./style/default.css" rel="stylesheet" type="text/css">
<link href="{$root}style/default.css" rel="stylesheet" type="text/css">
HTML;
return $html;
@@ -80,6 +80,6 @@ HTML;
}
private $links = array();
private $title = "Not Set!";
protected $title = "Not Set!";
}

View File

@@ -7,9 +7,10 @@
*/
require_once "prelude.inc.php";
if(!$open){
if(!isset($_SESSION[LOGIN])){
header("Location: ../secure/index.php");
header("Location: " . ROOT . "secure/index.php");
}
}