Creating page for reset password [message #551874] |
Sat, 21 April 2012 12:44 |
|
newprogrammerSQ
Messages: 48 Registered: April 2012
|
Member |
|
|
How do you do the following please
Current password textbox
new password textbox
CHANGE PASSWORD button
I need help making the 'Change password' button do:
1. check 'current password textbox' = user_password from helpdesk_user WHERE (LOGGED IN NAME) = user_login
if password is correct go to step 2 if not error message displays.
2. change user_password from helpdesk_user to 'new password textbox'
[Updated on: Sat, 21 April 2012 17:52] Report message to a moderator
|
|
|
|
|
|
|
Re: Creating page for reset password [message #551926 is a reply to message #551923] |
Sun, 22 April 2012 10:59 |
|
newprogrammerSQ
Messages: 48 Registered: April 2012
|
Member |
|
|
could you help me with this? i'll try on a dynamic action:
Event: change
Select type: Item(s)
Item(s): P21_CURRENTPASS <---thats the current passsword texbox
Condition: Equal to
Value: (select user_password
from helpdesk_user
where user_login = :APP_USER)
is the value supposed to be like that? thanks in advanced
as a test i did if true, message "correct pass"
if false, message "incorrect" however both are showing "incorrect" message.
[Updated on: Sun, 22 April 2012 11:00] Report message to a moderator
|
|
|
|
|
Re: Creating page for reset password [message #551937 is a reply to message #551936] |
Sun, 22 April 2012 13:25 |
|
newprogrammerSQ
Messages: 48 Registered: April 2012
|
Member |
|
|
also as an idea, I can create a hidden textbox which contains the actual password of logged in user... is it possible to do a quicker method of changing password by validating CURRENT PASSWORD with (HIDDEN TEXT BOX REAL PASSWORD)?
so
Current password textbox
New password textbox
(HIDDEN TEXTBOX Containing real password from database)
Change password button
[Updated on: Sun, 22 April 2012 13:26] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Re: Creating page for reset password [message #552099 is a reply to message #552059] |
Mon, 23 April 2012 09:16 |
c_stenersen
Messages: 255 Registered: August 2007
|
Senior Member |
|
|
What I would normally do is add any database actions which process data as processes on the page rather than doing the actual updates in the validations. It makes it more obvious for anyone watching the page development interface later on distinguish between what is actually doing any real update/insert/delete on the tables, and what is just validating that the input is correct. (And give them sensible names, and it should be easy to see what they do.) So then in the validation I would do as Littlefoot does, fetch the current password to see if it matches, and if not then return false. But I'd add an after submit process to do the actual update instead of doing it in the validation. The process then has a field where you can specify the success message to be given.
So in your validation:
declare
l_x varchar2(1);
begin
select 'x'
into l_x
from helpdesk_user
where user_login = :APP_USER
and user_password = :P21_CURRENTPASS;
return (true);
exception
when no_data_found then
return (false);
end;
Then in an after submit process:
begin
update helpdesk_user set
user_password = :P21_NEWPASS
where user_login = :APP_USER;
end;
And for this after submit process you go down to "Messages" and you can give in what the success message should be. In your case: Password successfully changed.
Then you don't need to call g_print_success_message.
|
|
|
|
|
|
|
|
|
|
|
Re: Creating page for reset password [message #552515 is a reply to message #552506] |
Thu, 26 April 2012 06:28 |
|
gurujothi
Messages: 80 Registered: January 2012 Location: Banglore
|
Member |
|
|
Hi Littlefoot,
I changed the code like,
declare
l_x varchar2(30);
begin
select username into l_x
from login_table
where username = :P7_USERNAME
and password = :P7_CURRENT_PASSWORD;
return (true);
exception
when no_data_found then
return (false);
end;
and
begin
update login_table set
password = :P7_NEW_PASSWORD
where upper(username) = :APP_USER;
end;
but still am getting this error,
am using the login_table for the login page, it has the only two fields, username and password.
and in the change password wizard I have four fields,
1.username,
2.Current_password,
3.New_password
4.Retype_password
Now how can I use these codes or what I have to do?
Please solve my issue,
Thank you.
|
|
|
Re: Creating page for reset password [message #552517 is a reply to message #552515] |
Thu, 26 April 2012 06:32 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
On the second look, ORA-00920 means
OracleORA-00920: Invalid relational operator
Cause: A search condition was entered with an invalid or missing relational operator.
Action: Include a valid relational operator such as =, !=, ^=, <>, >, <, >=, <=, ALL, ANY, [NOT] BETWEEN, EXISTS, [NOT] IN, IS [NOT] NULL, or [NOT] LIKE in the condition.
As far as I can see, there's nothing wrong with code you posted. Do you, perhaps, use conditions or some other code that raises that error?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|