| 37 | | if (isset($_POST["name"])) { |
|---|
| 38 | | $result = mysql_query("SELECT id,firstname,lastname,accesslevel,email,phone,department,employeenumber from users where login=\"".$_POST["name"]."\" and password=ENCODE(\"".$_POST["password"]."\",\"".$_SESSION["encryption_seed"]."\") and revoked=0 and accesslevel>=10;",$dblink); |
|---|
| 39 | | if (mysql_num_rows($result)){ |
|---|
| 40 | | |
|---|
| 41 | | // login passed... set session parameters |
|---|
| 42 | | $_SESSION["userinfo"]= mysql_fetch_array($result); |
|---|
| 43 | | |
|---|
| 44 | | // set application location (web, not physical) |
|---|
| 45 | | $pathrev=strrev($_SERVER["PHP_SELF"]); |
|---|
| 46 | | $_SESSION["app_path"]=strrev(substr($pathrev,(strpos($pathrev,"/")))); |
|---|
| 47 | | |
|---|
| 48 | | //next update record's lastlogin time |
|---|
| 49 | | $result = mysql_query("UPDATE users set modifieddate=modifieddate, lastlogin=Now() where id = ".$_SESSION["userinfo"]["id"],$dblink); |
|---|
| 50 | | if (!$result)die ("update users query failed:".mysql_error($dblink)); |
|---|
| 51 | | |
|---|
| 52 | | header("Location: ".$_SESSION["default_load_page"]); |
|---|
| 53 | | |
|---|
| 54 | | //register table settings |
|---|
| 55 | | session_register("tableparams"); |
|---|
| 56 | | } |
|---|
| 57 | | else |
|---|
| 58 | | { |
|---|
| 59 | | // Login failed... send to index.php with parameter of no we should already be on the index page... so just set |
|---|
| 60 | | // the failed parameter |
|---|
| 61 | | $failed="Login Failed"; |
|---|
| 62 | | } |
|---|
| 63 | | } |
|---|
| 64 | | |
|---|
| 65 | | |
|---|
| 66 | | ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
|---|
| 67 | | <html> |
|---|
| | 37 | require_once("include/session.php"); |
|---|
| | 38 | require_once("include/common_functions.php"); |
|---|
| | 39 | require_once("include/login_include.php"); |
|---|
| | 40 | ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|---|
| | 41 | <html xmlns="http://www.w3.org/1999/xhtml"> |
|---|
| 82 | | <body> |
|---|
| 83 | | <form name="form1" method="post" action="<?php echo $_SERVER["PHP_SELF"]?>"> |
|---|
| 84 | | <div align="center"> |
|---|
| 85 | | <div style="width:250px;"> |
|---|
| 86 | | <div class="bodyline" style="margin-top:100px;padding:0px;" align="left"> |
|---|
| 87 | | <div align="right" class="box" style="margin:1px;border-style:none; background-color:white;"><a href="http://kreotek.com/products/phpbms"><img src="common/image/logo.png" width="85" height="22" border="0"></a></div> |
|---|
| 88 | | <h2 style="text-transform:none;margin:4px;"> |
|---|
| 89 | | <?PHP echo $_SESSION["application_name"];?> |
|---|
| 90 | | <div class=tiny style="padding:0px;">Business Management Web Application</div> |
|---|
| 91 | | </h2> |
|---|
| 92 | | |
|---|
| 93 | | <label for="username">name<br /> |
|---|
| 94 | | <input name="name" type="text" id="username" size="25" maxlength="64" style="width:97%" /> |
|---|
| 95 | | <script>setMainFocus();</script></label> |
|---|
| 96 | | <label for="password">password<br /> |
|---|
| 97 | | <input name="password" type="password" id="password" size="25" maxlength="24" style="width:97%" /></label> |
|---|
| 98 | | <div align=right style="padding-bottom:15px;"><input name="command" type="submit" class="Buttons" value="Log On" style="width:75px;" /></div> |
|---|
| 99 | | |
|---|
| 100 | | <?php if (isset($failed)) {?> |
|---|
| 101 | | <div class="standout" align="center"><?php echo $failed?></div> |
|---|
| 102 | | <?php } ?> |
|---|
| | 51 | <body onload="setMainFocus()"> |
|---|
| 104 | | <div class="tiny" align="center">· <a href="requirements.php">browser requirements</a> · <a href="info.php">program info</a> ·</div> |
|---|
| | 53 | <div class="bodyline" id="loginbox"> |
|---|
| | 54 | <h1 class="box"> |
|---|
| | 55 | <a href="http://www.phpbms.org" title="phpBMS"><span class="alt">phpBMS</span></a> |
|---|
| | 56 | </h1> |
|---|
| | 57 | <h2><?PHP echo $_SESSION["application_name"];?></h2> |
|---|
| | 58 | <h3>Business Management Web Application</h3> |
|---|
| | 59 | <?php if ($failed) {?><div class="standout" id="failed"><?php echo $failed?></div><?php } ?> |
|---|
| | 60 | |
|---|
| | 61 | <form name="form1" method="post" action="<?php echo $_SERVER["PHP_SELF"]?>"> |
|---|
| | 62 | <p> |
|---|
| | 63 | <label for="username">name</label><br /> |
|---|
| | 64 | <input name="name" type="text" id="username" size="25" maxlength="64" value="<?php echo $_POST["name"]?>"/> |
|---|
| | 65 | </p> |
|---|
| | 66 | |
|---|
| | 67 | <p> |
|---|
| | 68 | <label for="password">password</label><br /> |
|---|
| | 69 | <input name="password" type="password" id="password" size="25" maxlength="24"/> |
|---|
| | 70 | </p> |
|---|
| | 71 | |
|---|
| | 72 | <p><input id="command" name="command" type="submit" class="Buttons" value="Log On"/></p> |
|---|
| | 73 | </form> |
|---|
| | 74 | |
|---|
| | 75 | <p class="tiny" id="moreinfo"> |
|---|
| | 76 | <a href="requirements.php">browser requirements</a> | |
|---|
| | 77 | <a href="info.php">program info</a> |
|---|
| | 78 | </p> |
|---|