Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Siamon Hasan
committed
Oct 28, 2015
1 parent
0d1ebd7
commit d47eca7
Showing
5 changed files
with
88 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php include_once('includes/load.php'); ?> | ||
<?php | ||
$req_fields = array('username','password' ); | ||
validate_fields($req_fields); | ||
$username = remove_junk($_POST['username']); | ||
$password = remove_junk($_POST['password']); | ||
|
||
if(empty($errors)){ | ||
|
||
$user = authenticate_v2($username, $password); | ||
|
||
if($user): | ||
//create session with id | ||
$session->login($user['id']); | ||
//Update Sign in time | ||
updateLastLogIn($user['id']); | ||
// redirect user to group home page by user level | ||
if($user['user_level'] === '1'): | ||
$session->msg("s", "Hello ".$user['username'].", Welcome to OSWA-INV."); | ||
redirect('admin.php',false); | ||
elseif ($user['user_level'] === '2'): | ||
$session->msg("s", "Hello ".$user['username'].", Welcome to OSWA-INV."); | ||
redirect('special.php',false); | ||
else: | ||
$session->msg("s", "Hello ".$user['username'].", Welcome to OSWA-INV."); | ||
redirect('home.php',false); | ||
endif; | ||
|
||
else: | ||
$session->msg("d", "Sorry Username/Password incorrect."); | ||
redirect('index.php',false); | ||
endif; | ||
|
||
} else { | ||
|
||
$session->msg("d", $errors); | ||
redirect('login_v2.php',false); | ||
} | ||
|
||
?> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
ob_start(); | ||
require_once('includes/load.php'); | ||
if($session->isUserLoggedIn(true)) { redirect('home.php', false);} | ||
?> | ||
|
||
<div class="login-page"> | ||
<div class="text-center"> | ||
<h1>Welcome</h1> | ||
<p>Sign in to start your session</p> | ||
</div> | ||
<?php echo display_msg($msg); ?> | ||
<form method="post" action="auth_v2.php" class="clearfix"> | ||
<div class="form-group"> | ||
<label for="username" class="control-label">Username</label> | ||
<input type="name" class="form-control" name="username" placeholder="Username"> | ||
</div> | ||
<div class="form-group"> | ||
<label for="Password" class="control-label">Password</label> | ||
<input type="password" name= "password" class="form-control" placeholder="password"> | ||
</div> | ||
<div class="form-group"> | ||
<button type="submit" class="btn btn-info pull-right">Login</button> | ||
</div> | ||
</form> | ||
</div> | ||
<?php include_once('layouts/header.php'); ?> |
This file was deleted.
Oops, something went wrong.