From 1abe47788c906bf43f1cead0a7e9493abbd41f1a Mon Sep 17 00:00:00 2001 From: Hui Lan Date: Tue, 29 Sep 2020 17:38:14 +0800 Subject: [PATCH] Bug fixes for bug reports from 2020-09-24 to 2020-09-29. --- Course.php | 10 +++++--- Courses.php | 73 ++++++++++++++++++++++++++++------------------------- Script.php | 15 +++++++---- index.php | 4 +-- logout.php | 4 +-- signup.php | 24 ++++++++++-------- 6 files changed, 73 insertions(+), 57 deletions(-) diff --git a/Course.php b/Course.php index 4964d1a..5485be5 100644 --- a/Course.php +++ b/Course.php @@ -1,4 +1,3 @@ -
"; @@ -108,7 +105,7 @@ New Date/Time
"; } -// ------------------------------Editing Lab Assignment by Lecture------------------------------------ +// ------------------------------Editing Lab Assignment by Lecturer ------------------------------------ if($_GET['act']=="edit"){ @@ -117,41 +114,42 @@ New Date/Time
query($sql) === TRUE) { - $_SESSION["info_Updated"]="Information Updated Successfull"; + $_SESSION["info_Updated"]="Assignment information updated successfully."; } else { - echo "Error: " . $sql . "
" . $con->error; + // echo "Error: " . $sql . "
" . $con->error; + echo "Serious error happened whiling updating assignment information."; } } + if( $_SESSION['user_type']=="Lecturer"){ - $Date=$_SESSION['Date']; - $Time=$_SESSION['Time']; - $Instructions=$_SESSION['Instructions']; - $Title=$_SESSION['Title']; - $Marks=$_SESSION['Marks']; - + $Date = $_SESSION['Date']; + $Time = $_SESSION['Time']; + $Instructions = $_SESSION['Instructions']; + $Title = $_SESSION['Title']; + $Marks = $_SESSION['Marks']; + $Type = $_SESSION['Type']; + echo "

Editing Lab Assignment

"; ?>
@@ -184,9 +182,16 @@ Attachment 3 Attachment 4
-Submission Type Invidual - Group + Invidual Group"; +} else { + echo "Submission Type Invidual Group"; +} +?> + +





diff --git a/Script.php b/Script.php index 144729a..84b568c 100644 --- a/Script.php +++ b/Script.php @@ -105,9 +105,12 @@ if (!empty($_POST["frm_signup_1"])) { $_SESSION['user_fullname'] = $fullname; $_SESSION['user_type'] = "Student"; $_SESSION['user_email'] = $email; + // check confirmed password if ( strcasecmp( $password, $confirmpassword ) != 0 ){ $_SESSION['info_signup2']="Password confirmation failed."; + $_SESSION['user_fullname'] = null; + $_SESSION['user_type'] = null; header("Location: signup.php"); return; } @@ -119,15 +122,15 @@ if (!empty($_POST["frm_signup_1"])) { return; } - $upperLetter = preg_match('@[A-Z]@', $password); - $smallLetter = preg_match('@[a-z]@', $password); + $upperLetter = preg_match('@[A-Z]@', $password); + $smallLetter = preg_match('@[a-z]@', $password); $containsDigit = preg_match('@[0-9]@', $password); $containsSpecial = preg_match('@[^\w]@', $password); $containsAll = $upperLetter && $smallLetter && $containsDigit && $containsSpecial; // check for strong password - if($containsAll < 8) { - $_SESSION['info_signup2']="Password must have at least characters that include letters, numbers and sepcial characters."; + if(! $containsAll) { + $_SESSION['info_signup2'] = "Password must have at least characters that include lowercase letters, uppercase letters, numbers and sepcial characters (e.g., !?.,*^)."; header("Location: signup.php"); return; } @@ -136,7 +139,9 @@ if (!empty($_POST["frm_signup_1"])) { "SELECT * FROM Users_Table WHERE email='$email'"); if(mysqli_num_rows($result)!=0) { - $_SESSION["info_signup2"]="Email adress : ".$email." already in use."; + $_SESSION["info_signup2"]="Email adress ".$email." already in use."; + $_SESSION['user_fullname'] = null; + $_SESSION['user_type'] = null; header("Location: signup.php"); return; } diff --git a/index.php b/index.php index bc59142..72594c3 100644 --- a/index.php +++ b/index.php @@ -35,10 +35,10 @@ session_start();
Student ID / Email - + Password - +

Reset my password diff --git a/logout.php b/logout.php index 7818fe0..d09c644 100644 --- a/logout.php +++ b/logout.php @@ -1,8 +1,8 @@ @@ -21,27 +20,30 @@ include 'Header.php';
+ + Full Name - + - Email - + Email + - Password - - Confirm Password - -
- + Password + + Confirm Password + +
+ '; - $_SESSION['info_signup2']=null; + $_SESSION['info_signup2'] = null; } ?>