Forums

HDU- A Service Desk User Community :: Forums :: Service Desk r11.X Support :: Customizing r11.x
 
<< Previous thread | Next thread >>
Reset Password with cheking old password.
Moderators: Admin, 4uTech CEO
Author Post
The BOSS
Sat Feb 27 2010, 01:29AM
Registered Member #3918
Joined: Thu Jul 17 2008, 12:36AM
Posts: 177
Dear all,

Goal: Reset the password (contact_num) after checking old password.

Note:
1. PIN authentication (contact_num) type is using .
2. Password update is working fine without checking old pasword.

What i have done is:
Created one link in home.htmpl of emp page as

<PDM_LINK class=analyst ID="btn001" font-size:0.7em NAME="My Profile" OP=UPDATE PERSID=cnt:$cst.id HTMPL=detail_cnt_edit.htmpl>Change Password</PDM_LINK>

My detail_cnt_edit.htmpl is:

<PDM_IF 0>
detail_cnt_edit.htmpl
WHEN PRESENTED:
When the app needs input to create a new Contact or update an
existing one.
INTENT:
Capture user input for a new Contact, create/update a Contact
when submitted.
VARIABLES:
string image The location of the image directory as
specified in the config file.
object cnt args The arguments from the 'last' form
See $NX_ROOT/bopcfg/majic/base.maj for the
definition of attributes for 'OBJECT cnt'
int logged_in A flag to say we have a user login object.
object cst cst A cst object (customer) that is the logged in user.
</PDM_IF>
<HTML>
<HEAD>
<PDM_INCLUDE FILE=styles.htmpl>
<SCRIPT LANGUAGE="JavaScript">
var propKey = "$args.last_name";
if ( "$args.first_name" != "" )
propKey += ", $args.first_name $args.middle_name";
else if ( "$args.middle_name" != "" )
propKey += ", $args.middle_name";
</SCRIPT>
<PDM_INCLUDE FILE=std_head.htmpl filename="Contact">
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/arrow_button.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/check_submit.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/fid_gen.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/check_submit.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/popup.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/val_type.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/sitemods.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/detail_form.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/role.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/update_lrel.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript">

<!-- Entered By Saran start -->
var z_old_pwd;
z_old_pwd = document.frm001.z_old_pwd.value;
var z_old_pwd1 = '$args.contact_num';

function zflag_count()
{
var z_flag
z_flag = document.frm001.z_flag.value = 0;
return true
}
function zchk_oldpsw()
{
var z_old_pwd;
z_old_pwd = document.frm001.z_old_pwd.value;
var z_old_pwd1 = '$args.contact_num';
if(z_old_pwd != z_old_pwd1)
{
alert("Wrong Old Password")
document.frm001.z_old_pwd.focus()
window.location.reload();
return false;
}
else
{
return true;
}
}

function zchk_pwd()
{
var z_pwd
z_pwd = document.frm001.z_pwd.value
z_pwd1 = document.frm001.z_pwd1.value
if(z_pwd == "")
{
alert("Password cannot be blank.")
document.frm001.z_pwd.focus()
window.location.reload();
return false;
}
if(z_pwd != z_pwd1)
{
alert("Password and ReType Password do not match. Please check.")
document.frm001.z_pwd.focus()
window.location.reload();
return false;
}
if(z_pwd.toLowerCase() == "servicedesk")
{
alert("Password can not be \"servicedesk\".")
document.frm001.z_pwd.focus()
window.location.reload();
return false;
}


return true
}
</SCRIPT>
</HEAD>
<BODY class=editform>
<PDM_INCLUDE FILE=std_header.htmpl>
<CENTER>
<IMG SRC=$CAisd/img/bar.gif WIDTH=90% HEIGHT=4 ALT=Bar>
<PDM_FORM NAME="frm001" ONSUBMIT="return check_submit() && zchk_oldpsw() &&zchk_pwd()">
<INPUT TYPE=hidden NAME=FACTORY VALUE=cnt>
<PDM_IF $args.id>
<INPUT TYPE=hidden NAME=SET.id VALUE="$args.id">
</PDM_IF>
<INPUT TYPE=hidden NAME=OP VALUE="UPDATE">
<SCRIPT LANGUAGE="JavaScript">
ImgBtnCreate("btnSave", "Update", "pdm_submit('frm001','UPDATE')","defer", 120);
</SCRIPT>
 
<!-- EDIT TAGS -->
<table>
<tr>
<td>
$args.contact.num
</td>
</tr>
</table>
<TABLE ID="tbl001">
<TH ALIGN=LEFT>
<TABLE ID="tbl002">
<TH ALIGN=LEFT>
<PDM_IF 0 != $args.REQUIRED_last_name>
<SPAN class=requiredlabeltext>Last Name</SPAN>
<PDM_ELSE>
<SPAN class=labeltext>Last Name</SPAN>
</PDM_IF>
</TH>
<TR>
<TD VALIGN=TOP class=detailro>$args.last_name</TD><TDVALIGN=TOP class=detailro>$args.contact_num</TD>
</TR>
</TABLE>
<TABLE ID="tbl003">
<TH ALIGN=LEFT>
<PDM_IF 0 != $args.REQUIRED_contact_num>
<SPAN class=requiredlabeltext>Old Password</SPAN>
<PDM_ELSE>
<SPAN class=labeltext>Old Password</SPAN>
</PDM_IF>
</TH>
<TH ALIGN=LEFT>
<PDM_IF 0 != $args.REQUIRED_contact_num>
<SPAN class=requiredlabeltext>Password</SPAN>
<PDM_ELSE>
<SPAN class=labeltext>Password</SPAN>
</PDM_IF>
</TH>
<TH ALIGN=LEFT>
<PDM_IF 0 != $args.REQUIRED_contact_num>
<SPAN class=requiredlabeltext>ReType Password</SPAN>
<PDM_ELSE>
<SPAN class=labeltext>ReType Password</SPAN>
</PDM_IF>
</TH>
<TH ALIGN=LEFT>
<PDM_IF 0 != $args.REQUIRED_zflag>
<SPAN class=requiredlabeltext>Zflag</SPAN>
</PDM_IF>
</TH>
<TR>
<TD VALIGN=TOP>
<INPUT TYPE=PASSWORD NAME=oldpsw SIZE=15 id="z_old_pwd">
</TD>
<TD VALIGN=TOP>
<INPUT TYPE=PASSWORD NAME=SET.contact_num SIZE=15 id="z_pwd">
</TD>
<TD VALIGN=TOP>
<INPUT TYPE=PASSWORD NAME=RESET.contact_num SIZE=15 id="z_pwd1">
</TD>
<TD VALIGN=TOP>
<INPUT TYPE=HIDDEN NAME=SET.zflag SIZE=15 id="z_flag">
</TD>
</TR>
</TABLE>
<IMG SRC=$CAisd/img/bar.gif WIDTH=100% HEIGHT=4 ALT=Bar>
</PDM_FORM>
<!-- If Cancel Link brings up the form other than main menu, we do not want to
set the TARGET to _top because it will cause the next form to show without
main menu on the side.
-->
<PDM_IF 0 == $args.id>
<PDM_IF "" == "$args.NEXT_PERSID">
<BASE TARGET="_top">
</PDM_IF>
</PDM_IF>
<BASE TARGET="_top">
<PDM_INCLUDE FILE=std_footer.htmpl>
</CENTER>
</BODY>
</HTML>
<PDM_IF 0>
@(#)$Id: detail_cnt_edit.htmpl,v 1.43.1.2 2001/08/09 22:09:05 lauke01 Exp $
</PDM_IF>
<!-- END -->


Problem Faced:

Now checking the old password is fine. Like when i enter wrong old password and click update button, it popup "Wrong old password". fine.

Freshly. if i login and giving correct password and new password, it updates fine. But when i give wrong password, the page is reloaded because of window.location.reload(); given. then if i give correct old password and new password means, it is not updated, showing "Save in progress.." popup. and old password remains.

Pls give solution.

Hope anybody can help me.

Thanks in advance.

Regards,
Saran

Time once lost is lost forever........
Back to top
 

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

This site is not affiliated with CA. All trademarks are © their respective owners. All other content is © HelpDeskUsers.com and 4uTechnologies, Inc.
4uTechnologies, Inc. reserves the right to content contained within this site.
{THEMEDISCLAIMER}