81 lines
2.4 KiB
HTML
81 lines
2.4 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>Login</TITLE>
|
|
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (WinNT; I) [Netscape]">
|
|
</HEAD>
|
|
</SCRIPT SRC="global.js">
|
|
</SCRIPT>
|
|
<SCRIPT SRC="ctasapagar.js">
|
|
</SCRIPT>
|
|
<BODY>
|
|
|
|
<P><!-- application: -->
|
|
<!-- version: 1.0 -->
|
|
<!-- company name: -->
|
|
<!-- filename: login.html -->
|
|
<!-- description: looks up user name and password from initial.html -->
|
|
<!-- in db. if not found, return to login screen, -->
|
|
<!-- else set cookies and go on to app. -->
|
|
<!-- ==================================================================== -->
|
|
<!-- -->
|
|
<!-- ==================================================================== -->
|
|
<!-- Look up user in the database. If found, set cookies so s/he won't have
|
|
to log in again and redirect to menu. If not found, try logging in
|
|
again. -->
|
|
|
|
<SERVER>
|
|
var baseHtml="";
|
|
if (request.prevPage)
|
|
client.prevPage = request.prevPage;
|
|
checkPrevPage("login.html");
|
|
|
|
//client.ViewFkey=request.ViewFkey;
|
|
//client.FrameType=request.FrameType;
|
|
client.MsgScroll=request.MsgScroll;
|
|
<!-- look up user -->
|
|
login = database.cursor("select id,firstname,lastname,def_category,acl from user where "+
|
|
"active='Y' and login='"+escQuote(request.username)+
|
|
"' and password='"+escQuote(request.password)+"'");
|
|
firstname = null;
|
|
lastname = null;
|
|
user_found = false;
|
|
<!-- assumes login/password pairs are unique -->
|
|
request.uid=0;
|
|
if (login.next()) {
|
|
client.id = login.id;
|
|
request.uid= client.id;
|
|
firstname = login.firstname;
|
|
lastname = login.lastname;
|
|
client.username = login.username;
|
|
client.fullname = login.fullname;
|
|
client.def_category=login.def_category;
|
|
client.acl = login.acl;
|
|
client.def_project = login.def_project;
|
|
client.objeto="";
|
|
client.trans=false;
|
|
setLoggedIn();
|
|
user_found = true;
|
|
}
|
|
login.close();
|
|
|
|
<!-- set cookies -->
|
|
client.username = request.username;
|
|
client.fullname = firstname+" "+lastname;
|
|
LoadParametros();
|
|
|
|
<!-- if user not found, go back to login form, else go to main screen -->
|
|
if (!user_found)
|
|
redirect("initial.html?ipw=1");
|
|
else {
|
|
<!-- load frames: button bar and hours entry screen -->
|
|
baseHtml="FrameType="+request.FrameType+"&ViewFkey="+request.ViewFkey+"&uid="+request.uid
|
|
redirect("ctasapagar.html?"+baseHtml);
|
|
}
|
|
|
|
</SERVER>
|
|
</P>
|
|
|
|
</BODY>
|
|
</HTML>
|