/
var
/
www
/
barefootlaw.org
/
bios2
/
manager
/
Upload File
HOME
<?php require_once('../Connections/fleetMan.php'); ?> <?php require_once("functions.php"); $api = new fleet(); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } ?> <?php // *** Validate request to login to this site. if (!isset($_SESSION)) { session_start(); } $loginFormAction = $_SERVER['PHP_SELF']; if (isset($_GET['accesscheck'])) { $_SESSION['PrevUrl'] = $_GET['accesscheck']; } if (isset($_POST['username'])) { $loginUsername=$_POST['username']; $password=$_POST['password']; $MM_fldUserAuthorization = "type"; $MM_redirectLoginSuccess = "index.php"; $MM_redirectLoginFailed = "signin.php?e=1"; $MM_redirecttoReferrer = false; mysql_select_db($database_fleetMan, $fleetMan); $LoginRS__query=sprintf("SELECT * FROM bios_sys_user WHERE email=%s AND `_password`=%s AND _status = '1'", GetSQLValueString($loginUsername, "text"), GetSQLValueString(sha1(md5(sha1($password))), "text")); $LoginRS = mysql_query($LoginRS__query, $fleetMan) /*or die(mysql_error())*/; if(!$LoginRS) { echo mysql_error(); exit; } $loginFoundUser = mysql_num_rows($LoginRS); if ($loginFoundUser) { //$loginStrGroup = mysql_result($LoginRS,0,'type'); if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();} //declare two session variables and assign them $_SESSION['MM_Username'] = $loginUsername; $_SESSION['MM_UserGroup'] = $api->get_records("bios_user_permission",array("permission"),"where `user` = '".(mysql_result($LoginRS,0,'id'))."' and _status = '1'"); if (isset($_SESSION['PrevUrl']) && false) { $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; } header("Location: " . $MM_redirectLoginSuccess ); exit; } else { header("Location: ". $MM_redirectLoginFailed ); exit; } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> <meta name="description" content=""> <meta name="author" content=""> <!--<link rel="shortcut icon" href="../images/favicon.png" type="image/png">--> <title><?php echo $api->site_name; ?></title> <link rel="stylesheet" href="../lib/fontawesome/css/font-awesome.css"> <link rel="stylesheet" href="../css/quirk.css"> <script src="../lib/modernizr/modernizr.js"></script> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="../lib/html5shiv/html5shiv.js"></script> <script src="../lib/respond/respond.src.js"></script> <![endif]--> </head> <body class="signwrapper"> <div class="sign-overlay"></div> <div class="signpanel"></div> <div class="panel signin"> <div class="panel-heading"> <h1><?php echo $api->site_name ?></h1> <h4 class="panel-title"><?php echo isset($_GET['e']) ? 'Error: Invalid Username / Password' : 'Welcome! Please signin.' ?></h4> </div> <div class="panel-body"> <form name="login_user" method="POST" action="<?php echo $loginFormAction; ?>"> <div class="form-group mb10"> <div class="input-group"> <span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span> <input type="text" class="form-control" placeholder="Enter Username" name="username" id="username"> </div> </div> <div class="form-group nomargin"> <div class="input-group"> <span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span> <input type="password" class="form-control" placeholder="Enter Password" name="password" id="password"> </div> </div> <div><a href="" class="forgot">Forgot password?</a></div> <div class="form-group"> <button class="btn btn-success btn-quirk btn-block">Sign In</button> </div> </form> </div> </div><!-- panel --> </body> </html>