home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1998 February
/
CHIP_2_98.iso
/
software
/
pelne
/
optionp
/
iis4_07.cab
/
Password.asp
< prev
next >
Wrap
Text File
|
1997-11-01
|
7KB
|
258 lines
<%@ LANGUAGE="VBSCRIPT" TRANSACTION=REQUIRED %>
<% Option Explicit %>
<!--#include file=libAuthenticate.asp-->
<%
' Dim page-level variables
Dim m_UpdateMessage, m_Password1
m_UpdateMessage = ""
' If user entered new password, update database
If Request("SavePassword") = "Save" Then
GetValuesFromForm
ChangePassword
m_UpdateMessage = " Language=JavaScript " & _
"onLoad=" & Chr(34) & "{ alert ('Your Password was updated.');" & _
"location.href='default.asp';}" & Chr(34)
End If
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<!--META TAGS ARE RECOMMENDED FOR THE SEARCH ENGINE-->
<META NAME="DESCRIPTION" CONTENT="Exploration Air's Change Password Page for Members">
<META NAME="KEYWORDS" CONTENT="Password, security, membership">
<META NAME="GENERATOR" CONTENT="Microsoft Visual InterDev 1.0">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso8859-1">
<!--END META TAGS-->
<TITLE>Change Your Password</TITLE>
</HEAD>
<BODY BGCOLOR=#FFFFFF TOPMARGIN=0 LEFTMARGIN=0 ALINK=#23238E VLINK=#228B22 LINK=#23238E
<%= m_UpdateMessage%> >
<BASEFONT FACE="VERDANA, ARIAL, HELVETICA" SIZE=2>
<!--Change link color on mouseover
Only if running Internet Explorer 4.0 or later -->
<!--#include file=../libHighlight.inc-->
<!--#include file=../libGlobalFuncs.inc-->
<!--COLOR BANNER_START-->
<CENTER>
<TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0 BORDER=0>
<TR>
<TD BGCOLOR="#C71585" WIDTH=100% HEIGHT=20>
</TD>
</TR>
</TABLE>
<!--COLOR BANNER_END-->
<!--BEGIN MAIN TABLE and SUB-TABLES WHICH CONTAIN NAVIGATIONAL SIDEBAR AND MAIN CONTENT-->
<!--BEGIN NAVIGATIONAL SIDEBAR-->
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100% HEIGHT=100%>
<TR>
<TD WIDTH=100% COLSPAN=4 VALIGN=TOP HEIGHT=74>
<TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0 BORDER=0>
<TR>
<TD WIDTH=415 HEIGHT=76>
<TABLE WIDTH=415 HEIGHT=76 CELLSPACING=0 CELLPADDING=0 BORDER=0>
<TR>
<TD HEIGHT=179 COLSPAN=5>
<A HREF="<%=HomePage("..")%>">
<IMG SRC="../images/logo_sm.gif" WIDTH=200 HEIGHT=100
ALT="Return to Exploration Air Home Page" BORDER=0>
</A>
</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=TOP BGCOLOR="#FFFFFF" WIDTH=20 HEIGHT=31>
<A HREF="default.asp">
<IMG SRC="../images/barrowy.gif" HEIGHT=8 WIDTH=8
ALT="Return to Frequent Flyer Home Page" VSPACE=6 BORDER=0>
</A>
</TD>
<TD VALIGN="TOP" BGCOLOR="#FFFFFF" WIDTH=300 HEIGHT=31>
<FONT FACE="VERDANA, ARIAL, HELVETICA" SIZE="2"><STRONG>
<A HREF="default.asp">
FREQUENT FLYER HOME PAGE
</A>
</STRONG></FONT>
</TD>
<TD WIDTH=2 BGCOLOR="#FFFFFF">
</TD>
<TD VALIGN=TOP BGCOLOR="#FFFFFF" WIDTH=200 HEIGHT=31>
</TD>
</TR>
</TABLE>
</TD>
<TD WIDTH=195 ALIGN="CENTER">
<FONT FACE="VERDANA, ARIAL, HELVETICA" COLOR="#0000FF" SIZE=5>
Change Your Password
</FONT>
</TD>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TD ALIGN=CENTER BGCOLOR="#FFFFFF" WIDTH=185>
</TD>
<TD>
<CENTER>
Enter your new password in both fields and then click <STRONG>Save</STRONG>
<!--BEGIN FORM-->
<FORM NAME="PasswordForm" METHOD=POST
ACTION="Password.asp?AccountID=<%= Session("AccountID") %>"
LANGUAGE="JavaScript"
onSubmit="if (!validateForm(document.PasswordForm))
{
alert ('Enter your new password in both fields, then click Save.');
return false;
}">
<TABLE>
<TR>
<TH>
New Password:
</TH>
<TD>
<INPUT TYPE=PASSWORD SIZE=20 MAXLENGTH=20 NAME="Password1">
</TD>
</TR>
<TR>
<TH>
New Password:
</TH>
<TD>
<INPUT TYPE=PASSWORD SIZE=20 MAXLENGTH=20 NAME="Password2">
</TD>
</TR>
</TABLE>
<INPUT TYPE="Submit" NAME="SavePassword" VALUE="Save">
</FORM>
<!--END FORM-->
</CENTER>
</TD>
</TR>
</TABLE>
<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=0 BORDER=0>
<TR>
<TD>
<!--BEGIN NESTED TABLE WHICH HOLDS RIGHT-ALIGNED HORIZONTAL RULE DIVIDER-->
<CENTER>
<TABLE WIDTH=90% CELLSPACING=0 CELLPADDING=0 BORDER=0>
<TR>
<TD HEIGHT=1 BGCOLOR="#808080">
</TD>
</TR>
</TABLE>
</CENTER>
<!--END NESTED TABLE WHICH HOLDS RIGHT-ALIGNED HORIZONTAL RULE DIVIDER-->
</TD>
</TR>
<TR>
<TD>
<BR>
<!--BEGIN LEGAL INFORMATION-->
<CENTER>
<P>
<FONT FACE="VERDANA, ARIAL, HELVETICA" SIZE="1">
<A HREF="../legal.htm">
©1997 Microsoft Corporation. All rights reserved. Terms of Use.
</A>
</FONT>
</CENTER>
<!--END LEGAL INFORMATION-->
</TD>
</TR>
<TR>
<TD HEIGHT=30>
</TD>
</TR>
</TABLE>
<!--COLOR BANNER_START-->
<TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0 BORDER=0>
<TR>
<TD BGCOLOR="#C71585" WIDTH=100% HEIGHT=20>
</TD>
</TR>
</TABLE>
<!--COLOR BANNER_END-->
</BODY>
</HTML>
<SCRIPT LANGUAGE="JavaScript">
// Begin client side helper functions
function validateForm(form)
{
if (isEmpty(form.Password1)) return false;
if (form.Password1.value != form.Password2.value) return false;
return true;
}
function isEmpty(textcontrol)
{
str = textcontrol.value
for (i = 0; i < str.length; i++)
{
chr = str.substring(i, i + 1);
if (chr != ' ')
{
return false;
}
}
return true;
}
</SCRIPT>
<%
'Get values from Form
Sub GetValuesFromForm
m_Password1 = Trim(Request.Form("Password1"))
End Sub
'
' Update the database. Return 0 if successful or 1 if an error is encountered.
'
Function ChangePassword
' On Error Resume Next
Dim Member
Set Member = Server.CreateObject("ExAir.Member")
Member.ChangePassword Application("DSN"), Session("AccountID"), m_Password1
If Err.Number = 0 Then
Else
ContextObject.SetAbort
UpdateDatabase = 1
End If
End Function
Sub OnTransactionCommit
End Sub
Sub OnTransactionAbort
m_strMainPrompt = "We're sorry, a problem occurred while trying to update the database. Please try again later. "
End Sub
%>