LRR/index.php

80 lines
2.5 KiB
PHP
Raw Permalink Normal View History

<?php
2023-07-31 16:55:47 +08:00
$page='Home';
require 'Header.php';
session_start();
?>
<?php
2023-07-31 16:55:47 +08:00
// if the user has already logged in, then clicking the LRRS icon should not display the login page (i.e., index.php).
if (isset($_SESSION["user_fullname"])) {
echo '<div class="container alert alert-info"> You\'ve already logged in.</div>';
exit();
}
?>
2021-01-29 17:25:59 +08:00
<br><br><br>
<div class="container">
<div class="row">
<div class="col-md-5">
<img src="logo.png" style="width:32%; position:relative; right:-95px; top:1px;" alt="LRR Logo">
<br><br>
2023-09-03 20:21:15 +08:00
<div style="width:32%; position:relative; right:-90px; font-family:Poppins-Regular;">
<h1>Lab Report Repository</h1>
</div>
2023-07-31 16:55:47 +08:00
</div>
2023-07-31 17:09:21 +08:00
<div class="col-md-5">
2023-09-03 20:42:15 +08:00
<form method="post" action="Script.php" name="form_login">
<legend>Sign in</legend>
2023-09-03 20:42:15 +08:00
<input type="hidden" name="form_login" value="true"/>
<label for="user_name" class="form-label">Account name</label>
<input type="text" name="user" placeholder="Student Number / Email address" class="form-control" required="required" id="user_name" />
<br>
<label for="user_password" class="form-label">Password</label>
<input type="password" class="form-control" name="password" placeholder="password" required="required" id="user_password" />
<br>
<button type="submit" class="btn btn-primary" id="login_btn">Sign in</button>
2023-07-31 16:55:47 +08:00
<br>
<label class="form-text">Don't have an account yet?</label> <a href="signup.php" id="signup_link">Sign up</a>
<br>
<label class="form-text">Forget your password?</label> <a href="recover_password.php">Recover</a>
<?php
error_reporting(E_ALL);
if(isset($_SESSION['info_login'])) {
echo '<hr><div class="alert alert-danger" role="alert">'.$_SESSION['info_login'].'</div>';
$_SESSION['info_login'] = null;
}
2023-09-03 20:22:18 +08:00
// wrong password
if(isset($_SESSION['wrong_pass'])) {
echo '<hr><div class="alert alert-danger" role="alert">'.$_SESSION['wrong_pass'].'</div>';
$_SESSION['wrong_pass'] = null;
}
if(isset($_SESSION['infoChangePassword'])) {
echo '<hr><div class="alert alert-danger" role="alert">'.$_SESSION['infoChangePassword'].'</div>';
$_SESSION['infoChangePassword'] = null;
}
?>
</form>
2023-07-31 16:55:47 +08:00
</div>
</div>
</div>
<div id="footer">
LRR was originally developed in 2018 as a <a href="http://lanlab.org/course/2018f/se/homepage.html">software engineering course project</a> by Mohamed Nor and Elmahdi Houzi. Please submit your bug reports to Mr Lan. <a href="./homepage">More information ...</a>
2023-07-31 16:46:25 +08:00
</div>
2021-01-29 17:25:59 +08:00
</body>
</html>