Skip to content
Browse files

Merge pull request #3 from martinAnsty/master

Added auth check to all pages
  • Loading branch information...
2 parents 8458dc0 + 07f0cb2 commit b7228c4a55867c6c476ffdadec66be14564c6f8f @Plinth committed May 12, 2012
Showing with 18 additions and 10 deletions.
  1. +5 −0 lesson.php
  2. +3 −4 lessons.php
  3. +5 −0 report.php
  4. +4 −4 school.php
  5. +1 −2 videos.php
View
5 lesson.php
@@ -6,6 +6,11 @@
include("app/classes/lesson.php");
+ //Check the user is logged in
+ if (empty($_SESSION['user_id'])) {
+ header("location: index.php");
+ }
+
if(!isset($_GET['id'])){
header("location: lessons.php");
}
View
7 lessons.php
@@ -3,10 +3,9 @@
//list all lessons with brief information and thumbnails. Search and filter tools.
// If the session var is empty, redirect to the log-in
- //UNCOMMENT THIS AFTER TESTING
- //if (empty($_SESSION['user_id'])) {
- // header("location: index.php");
- //}
+ if (empty($_SESSION['user_id'])) {
+ header("location: index.php");
+ }
include("app/classes/site.php");
include("app/classes/lesson.php");
View
5 report.php
@@ -3,6 +3,11 @@
include("app/classes/site.php");
include("app/classes/video.php");
+ //Check the user is logged in
+ if (empty($_SESSION['user_id'])) {
+ header("location: index.php");
+ }
+
if(isset($_GET['id'])){
$pdo = new PDO(DB_DETAILS, DB_USER, DB_PASS);
View
8 school.php
@@ -1,9 +1,9 @@
<?php
session_start();
- //UNCOMMENT THIS AFTER TESTING
- //if (empty($_SESSION['user_id'])) {
- // header("location: index.php");
- //}
+ //Check the user is logged in
+ if (empty($_SESSION['user_id'])) {
+ header("location: index.php");
+ }
include("app/classes/site.php");
include("app/classes/school.php");
View
3 videos.php
@@ -3,8 +3,7 @@
//list all videos with brief information and thumbnails. Search and filter tools.
// If the session var is empty, redirect to the log-in
- UNCOMMENT THIS AFTER TESTING
- if (empty($_SESSION['user_id'])) {
+ if(empty($_SESSION['user_id'])) {
header("location: index.php");
}

0 comments on commit b7228c4

Please sign in to comment.
Something went wrong with that request. Please try again.