Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* COPYRIGHT 2013 WWW.OUB.CA */
- <?php
- session_start();
- require("inc/mysql.php");
- require("inc/Membership.class.php");
- $Member = new Membership($DBH);
- require("inc/membership.php");
- //test user permissions
- if(!$Member->test_perms(0))
- {
- //No perms, echo error or forward or something
- die("You do not have permissions to view this page!");
- }
- if(isset($_POST['submit'])) {
- //User is loggin in
- $data = array_map( 'trim', $_POST ); // assuming you don't have a multidimensional $_POST array, otherwise need recursive function
- list( $data['username'], $data['password'] ) = explode( '-', $_POST['userpass']);
- if($data['username'] == "" || $data['password'] == "") {
- header( 'Location: inc/invalidcredentials.php' ) ;
- }
- if(!$Member->login($data['username'], ($data['password'])))
- {
- header( 'Location: inc/invalidcredentials.php' ) ;
- }else{
- die("<script type='text/javascript'>window.location='inc/login2.php'; </script>");
- }
- }
- header("./index2.htm");
- echo "<br />";
- if(!$_SESSION['user']['loggedIn'])
- {
- }?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Login | OUBs Integrated Services</title>
- <link rel="stylesheet" type="text/css" href="css/default.css" />
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js"></script>
- <script type="text/javascript" src="js/main.js"></script>
- </head>
- <body>
- <div id="login">
- <form method="post" action="">
- <h2>Login <small>enter your credentials</small></h2>
- <p>
- <label for="pwd">Enter your username and password: <br /><br /></label>
- <input type="password" name="userpass" />
- </p>
- <p>
- <input type="submit" id="submit" value="Login" name="submit" />
- </p>
- </form>
- <?php if(isset($response)) echo "<h4 class='alert'>" . $response . "</h4>"; ?>
- </div><!--end login-->
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement