Social.Tune/Generation_01/index.php
2018-11-07 17:29:45 -06:00

150 lines
4.3 KiB
PHP
Executable File

<?php
ini_set('display_errors', '1');
require_once($_SERVER['DOCUMENT_ROOT'] . '/socialtune/includes/session.php');
require_once($_SERVER['DOCUMENT_ROOT'] . '/socialtune/includes/config.php');
if(isset($_SESSION['Authenticated']) && $_SESSION['Authenticated']){
require_once($_SERVER['DOCUMENT_ROOT'] . '/socialtune/includes/user-data.php');
if($_SESSION['Expires'] < time()){
// Log out here.
exit();
header("Location: logout.php");
}
$_SESSION['Expires'] = time() + 86400; // if logged in, set to 24 hours.
//header("Location: Dashboard.php");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>SocialTune | Login</title>
<!--// bootstrap //-->
<link href="css/bootstrap.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<style>
html,
body{
height: 100%;
}
#wrap{
min-height: 100%;
height: auto !important;
height: 100%
margin: 0 auto -60px;
}
#push,
#footer{
height: 60px;
}
@media(max-width: 767px){
#footer{
margin-left: -20px;
margin-right: -20px;
padding-left: 20px;
padding-right: 20px;
}
}
</style>
</head>
<body>
<div id="wrap">
<!--// Navigation //-->
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle Navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Social.Tune</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="index.php">Login</a></li>
<li><a href="signup.php">Signup</a></li>
<li><a href="about.php">About</a></li>
</ul>
</div>
</div>
</nav>
<!--// Content //-->
<div class="container">
<div class="jumbotron">
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-4">
<form method="POST" action="login.php">
<div class="form-group">
<div class="col-xs-12">
<input type="email" class="form-control" name="email" id="email" placeholder="Email">
</div>
<div class="col-xs-6"></div>
</div>
<div class="form-group">
<div class="col-xs-12">
<input type="password" class="form-control" name="password" id="password" placeholder="Password">
</div>
</div>
<div class="col-xs-12">
<center><button type="submit" class="btn btn-primary">Log in</button></center>
</div>
</form>
</div>
<div class="col-md-5"></div>
</div>
<?php
$q = (!empty($_GET['q'])) ? $_GET['q'] : false;
if($q == 1){ echo "Account creation successful. You can now log in."; }
if($q == 2){ echo "Forgot to enter email/password."; }
if($q == 3){ echo "Incorrect email/password."; }
if($q == 4){ echo "Logged out. Please log back in.";}
?>
</div>
<div id="push"></div>
</div>
</div> <!--## ending wrap ##-->
<!--// Footer //-->
<div id="footer">
<div class="container">
<div class="row">
<div class="col-md-4">
<p style="font-size: 12px;">Social.Tune &copy; 2015</p>
</div>
<div class="col-md-8">
<p class="text-right" style="font-size: 12px;">
| <a href="">English</a> | <a href="">汉语</a> | <a href="">日本語</a> |
<a href="">français</a> |<br /> | <a href="">Social-Tune</a> |
<a href="">About Us</a> |<a href="">Contact Us</a> | <a href="">Careers</a> |
<a href="">Privacy</a> | <a href="">License</a> | <a href="">Help</a> |
</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>