Cleanup Client Login page and correct indentation of code structure

This commit is contained in:
johnnyq 2022-03-28 10:30:48 -04:00
parent dd160f6ae6
commit 42f47e948d
1 changed files with 71 additions and 83 deletions

View File

@ -64,110 +64,98 @@ if($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['login'])){
$_SESSION['login_message'] = 'Incorrect username or password.'; $_SESSION['login_message'] = 'Incorrect username or password.';
} }
} }
} }
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<title><?php echo $config_app_name; ?> | Client Portal Login</title> <title><?php echo $config_app_name; ?> | Client Portal Login</title>
<!-- Tell the browser to be responsive to screen width --> <!-- Tell the browser to be responsive to screen width -->
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Font Awesome --> <!-- Font Awesome -->
<link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css"> <link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css">
<!-- Theme style --> <!-- Theme style -->
<link rel="stylesheet" href="../dist/css/adminlte.min.css"> <link rel="stylesheet" href="../dist/css/adminlte.min.css">
<!-- Google Font: Source Sans Pro --> <!-- Google Font: Source Sans Pro -->
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
</head> </head>
<body class="hold-transition login-page"> <body class="hold-transition login-page">
<div class="login-box"> <div class="login-box">
<div class="login-logo"> <div class="login-logo"><b>IT</b>Flow <br>Client Portal Login</h2></div>
<b>IT</b>Flow <br>Client Portal Login</h2> <div class="card">
</div>
<!-- /.login-logo -->
<div class="card">
<div class="card-body login-card-body"> <div class="card-body login-card-body">
<p class="login-box-msg"><?php if(isset($response)) { echo $response; } ?></p> <p class="login-box-msg">
<form method="post"> <?php
<div class="input-group mb-3"> if(!empty($_SESSION['login_message'])){
<input type="text" class="form-control" placeholder="Agent Email" name="email" value="<?php if(!empty($token_field)){ echo $email; }?>" required <?php if(empty($token_field)){ echo "autofocus"; } ?> > echo $_SESSION['login_message'];
<div class="input-group-append"> unset($_SESSION['login_message']);
<div class="input-group-text"> }
<span class="fas fa-envelope"></span> ?>
</div> </p>
</div> <form method="post">
<div class="input-group mb-3">
<input type="text" class="form-control" placeholder="Email" name="email" required autofocus>
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-envelope"></span>
</div> </div>
<div class="input-group mb-3"> </div>
<input type="password" class="form-control" placeholder="Agent Password" name="password" value="<?php if(!empty($token_field)){ echo $password; } ?>" required> </div>
<div class="input-group-append"> <div class="input-group mb-3">
<div class="input-group-text"> <input type="password" class="form-control" placeholder="Password" name="password" required>
<span class="fas fa-lock"></span> <div class="input-group-append">
</div> <div class="input-group-text">
</div> <span class="fas fa-lock"></span>
</div> </div>
<?php if(!empty($token_field)){ echo $token_field; } ?> </div>
</div>
<?php if(!empty($token_field)){ echo $token_field; } ?>
<button type="submit" class="btn btn-primary btn-block mb-3" name="login">Login</button> <button type="submit" class="btn btn-primary btn-block mb-3" name="login">Login</button>
<?php
if(!empty($_SESSION['login_message'])){
echo $_SESSION['login_message'];
unset($_SESSION['login_message']);
}
?>
<hr><br> <hr><br>
<?php <?php
if(!empty($client_id)){ ?> if(!empty($client_id)){ ?>
<div class="col-4 offset-2"> <div class="col-4 offset-2">
<h4>SSO</h4> <h4>SSO</h4>
<button type="button" class="btn btn-secondary" onclick="location.href = 'login_microsoft.php';">Login with Microsoft Azure AD</button> <button type="button" class="btn btn-secondary" onclick="location.href = 'login_microsoft.php';">Login with Microsoft Azure AD</button>
</div> </div>
</div> </div>
<?php } ?> <?php } ?>
</form> </form>
</div> </div>
<!-- /.login-card-body --> <!-- /.login-card-body -->
</div>
</div> </div>
</div> <!-- /.login-box -->
<!-- /.login-box -->
<!-- jQuery -->
<script src="plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap 4 -->
<script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- AdminLTE App -->
<script src="dist/js/adminlte.min.js"></script>
<script src="plugins/Show-Hide-Passwords-Bootstrap-4/bootstrap-show-password.min.js"></script>
<!-- Prevents resubmit on refresh or back -->
<script>
</div> if(window.history.replaceState){
window.history.replaceState(null,null,window.location.href);
}
<!-- jQuery -->
<script src="plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap 4 -->
<script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- AdminLTE App -->
<script src="dist/js/adminlte.min.js"></script>
<script src="plugins/Show-Hide-Passwords-Bootstrap-4/bootstrap-show-password.min.js"></script>
<!-- Prevents resubmit on refresh or back -->
<script>
if(window.history.replaceState){
window.history.replaceState(null,null,window.location.href);
}
</script>
</script>
</body>
</html>