Your IP : 216.73.216.40


Current Path : /var/www/html/rkala/data/
Upload File :
Current File : /var/www/html/rkala/data/logon.php

<?php
// initialize session
session_start();
include 'ldap.php';

// check to see if user is logging out
if(isset($_GET['out'])) {
	// destroy session
	session_unset();
	$_SESSION = array();
	unset($_SESSION['user'],$_SESSION['access'],$_SESSION['encrpy']);
	session_destroy();
}

// check to see if login form has been submitted
if(isset($_POST['userLogin'])){
	// run information through authenticator
	if(authenticate($_POST['userLogin'],$_POST['userPassword']))
	{
		// echo "<script> alert('Server is Offline. ". $_POST['userLogin'] ." Please try again later.'); window.location.href = 'logon.php';</script>";
		// die();
		// authentication passed
		if($_SESSION['access'] == 1){
			header("Location: ta.php");
		}else if($_SESSION['access'] == 2){
			//header("Location: login.php?roll=".$_POST['userLogin']);
			header("Location: student.php?roll=".$_POST['userLogin']);
		}
		die();
	} else {
		// authentication failed
		$error = 1;
	}
}

// output error to user
if(isset($error)) {
	?>
	  <div class="w3-panel w3-red w3-display-container">
	  <span onclick="this.parentElement.style.display='none'"
		class="w3-button w3-red w3-large w3-display-topright">&times;</span>
		<h3>Login Failed</h3>
		<p>Incorrect user name, password, or rights</p>
	  </div>
	<?php
}

// output logout success
if(isset($_GET['out'])) {
	?>
	  <div class="w3-panel w3-green w3-display-container">
	  <span onclick="this.parentElement.style.display='none'"
		class="w3-button w3-green w3-large w3-display-topright">&times;</span>
		<h3>Success!</h3>
		<p>Logout successful</p>
	  </div>
	<?php
}
?>
<title>OOM Peer Evaluation</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<body class = "w3-light-gray">

		<div class="w3-container w3-teal">
			<h1 align="center" >
				Peer Review Portal
			</h1>
		</div>
		
		<script src="js/jquery-2.1.3.js"></script>
		<script src="js/bootstrap.min.js"></script>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link rel="stylesheet" href="css/bootstrap.min.css">
	
	<div align = "center">
		<form action="logon.php" method="post" style="width:50%" class="w3-container w3-card-4 w3-light-grey w3-text-teal w3-margin">
				
				<h2 align = "center"> Login Form </h2>
				<div class="w3-row w3-section">
				  <div class="w3-col" style="width:50px"><i class="w3-xxlarge fa fa-user"></i></div>
					<div class="w3-rest">
					  <input class="w3-input w3-border" name="userLogin" type="text" placeholder="User ID" required>
					</div>
				</div>
				<div class="w3-row w3-section">
				  <div class="w3-col" style="width:50px"><i class="w3-xxlarge fa fa-circle"></i></div>
					<div class="w3-rest">
					  <input class="w3-input w3-border" name="userPassword" type="password" placeholder="Password" required>
					</div>
				</div>
				<button class="w3-button w3-block w3-section w3-teal w3-ripple w3-padding" type="submit" name="submit" value="Submit">Send</button>

		</form>
	</div>
</body>
			<!-- User: <input type="text" name="userLogin" required/>
			Password: <input type="password" name="userPassword" required/><br><br>
			<input type="submit" name="submit" value="Submit" /> -->