home *** CD-ROM | disk | FTP | other *** search
- <%@ LANGUAGE="VBSCRIPT" %>
- <% Set clsTes = Session("TES")
- If clsTes.LoggedIn = False Then
- Set clsTes = Nothing
- Response.Redirect("../loggedout.htm")
- End If
- If Request.Form("txtEncrypted") = "TRUE" Then
- bEncrypted = True
- Else
- bEncrypted = False
- End If
- tErrorList = "<B>Errors:</B>"
- nErrors = 0
- On Error Resume Next
- bSave = False
- If Request.Form("btnSubmit") = "Change Password" Then
- bSave = clsTes.ChangePassword (CStr(Request.Form("txtCurrent")), CStr(Request.Form("txtNew")), CStr(Request.Form("txtConfirmed")), bEncrypted, CLng(Session.SessionID))
- If clsTes.ErrorNumber <> 0 Then
- nErrors = 1
- tErrorList = tErrorList & "<BR>" & Server.HTMLEncode(clsTes.ErrorText)
- End If
- End If %>
- <!-- #INCLUDE FILE = "settings/colours.txt" -->
- <HTML>
- <HEAD>
- <META NAME="GENERATOR" Content="Microsoft Visual InterDev 1.0">
- <META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
- <TITLE>Change Timesheet Expert Web Password</TITLE>
- <% If Session("JAVASCRIPT") > 1 Then 'Only for FULL Javascript %>
- <SCRIPT LANGUAGE="javascript">
- <!--
-
- function Shuffle(tWord) {
-
- tShuffle = tWord;
- if (tWord.length > 0) {
- for (var nLoop = 1; nLoop <= ((<%= CStr(Session.SessionID) %> % tWord.length)+1) * tWord.length ; nLoop++) {
- nChar1 = Math.floor(<%= CStr(Session.SessionID) %> / nLoop) % tWord.length;
- nChar2 = nLoop % tWord.length;
- if (nChar1 != nChar2) {
- if (Math.min(nChar1,nChar2) > 0) {
- tTemp = tShuffle.substring(0,Math.min(nChar1,nChar2));
- }
- else {
- tTemp = "";
- }
- tTemp = tTemp + tShuffle.charAt(Math.max(nChar1,nChar2));
- if (Math.max(nChar1,nChar2) - Math.min(nChar1,nChar2) > 1) {
- tTemp = tTemp + tShuffle.substring(Math.min(nChar1,nChar2) + 1, Math.max(nChar1,nChar2));
- }
- tTemp = tTemp + tShuffle.charAt(Math.min(nChar1,nChar2));
- if (Math.max(nChar1,nChar2) < tShuffle.length - 1) {
- tTemp = tTemp + tShuffle.substring(Math.max(nChar1,nChar2) + 1, tShuffle.length);
- }
- tShuffle = tTemp;
- }
- }
- }
- return tShuffle;
- }
-
- function Encrypt(tWord) {
-
- tTemp = Shuffle(tWord.toUpperCase());
- tJunk = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!รบ$%^&*()-=_+[]{},./<>?\|;'#:@~`";
-
- tEncrypt = "";
- for (var nCount = 1; nCount <= tWord.length; nCount++) {
- nEndLoop = (Math.floor(<%= CStr(Session.SessionID) %> / (2 * nCount)) % 11) + 3
- for (var nJunk = 1; nJunk <= nEndLoop; nJunk++) {
- tEncrypt = tEncrypt + tJunk.charAt(Math.round(Math.random() * (tJunk.length - 1)));
- }
- tEncrypt = tEncrypt + tTemp.charAt(nCount-1);
- }
- nEndLoop = (Math.floor(<%= CStr(Session.SessionID) %> / (2 * (tWord.length + 1))) % 11) + 3
- for (var nJunk = 1; nJunk <= nEndLoop; nJunk++) {
- tEncrypt = tEncrypt + tJunk.charAt(Math.round(Math.random() * (tJunk.length - 1)));
- }
- return tEncrypt;
- }
-
-
- function Submit() {
-
- document.frmPassword.txtEncrypted.value = "TRUE";
- document.frmPassword.txtCurrent.value = Encrypt(document.frmPassword.txtCurrent.value);
- if (document.frmPassword.txtNew.value.toUpperCase() == document.frmPassword.txtConfirmed.value.toUpperCase()) {
- document.frmPassword.txtNew.value = Encrypt(document.frmPassword.txtNew.value);
- document.frmPassword.txtConfirmed.value = document.frmPassword.txtNew.value;
- }
- else {
- document.frmPassword.txtNew.value = Encrypt(document.frmPassword.txtNew.value);
- document.frmPassword.txtConfirmed.value = Encrypt(document.frmPassword.txtConfirmed.value);
- }
-
- }
-
- // -->
- </SCRIPT>
- <% End If %>
-
- </HEAD>
- <BODY BGCOLOR="<%= BackColor %>" LINK="<%= LinkColor %>" VLINK="<%= VLinkColor %>" ALINK="<%= ALinkColor %>" TEXT="<%= TextColor %>">
- <BASEFONT SIZE=2 COLOR="<%= TextColor %>">
-
- <CENTER>
- <% If bSave Then %>
- <FONT SIZE=+2><B>Password Changed Successfully</B></FONT>
- <% Else %>
-
- <FONT SIZE=+2><B>Change Password</B></FONT>
- <P>
- <% If nErrors Then %>
- <%= tErrorList %>
- <BR><BR>
- <% End If %>
-
- <FORM NAME="frmPassword" ACTION="password.asp" METHOD=POST <% If Session("JAVASCRIPT") > 1 Then %>onSubmit="Submit()"<% End If %>>
- <INPUT TYPE=HIDDEN NAME="txtEncrypted" VALUE="FALSE">
- <TABLE BORDER=0 CELLSPACING=2 CELLPADDING=2>
- <TR>
- <TD>
- <B>Old Password:</B>
- </TD>
- <TD>
- <INPUT TYPE=PASSWORD NAME="txtCurrent" SIZE=20 MAXLENGTH=20>
- </TD>
- </TR>
-
- <TR>
- <TD>
- <B>New Password:</B>
- </TD>
- <TD>
- <INPUT TYPE=PASSWORD NAME="txtNew" SIZE=20 MAXLENGTH=20>
- </TD>
- </TR>
-
- <TR>
- <TD>
- <B>Confirm Password:</B>
- </TD>
- <TD>
- <INPUT TYPE=PASSWORD NAME="txtConfirmed" SIZE=20 MAXLENGTH=20>
- </TD>
- </TR>
-
- </TABLE>
- <P>
- <INPUT TYPE=SUBMIT NAME="btnSubmit" VALUE="Change Password">
-
- <% End If %>
- </CENTER>
- <% Set clsTes = Nothing %>
- </BODY>
- </HTML>
-