Home » Developer & Programmer » Forms » checking for password verification for 3 counts (Forms 10 g)
checking for password verification for 3 counts [message #536712] Thu, 22 December 2011 05:31 Go to next message
poojamunj
Messages: 64
Registered: May 2011
Location: MUMBAI
Member
hello,

I have made a simple form in which user will be entering his username and relevant password to get authorised.
My issue is , if the user is entering wrong password for 3 times then both fields should get disabled.
I did the form until the point where it checks wether the user is authorised or not.
But how to give count on failure of passwords,
Please suggest some way out.
thanks
Re: checking for password verification for 3 counts [message #536754 is a reply to message #536712] Thu, 22 December 2011 08:22 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
Set a counter, add 1 every time an invalid password is entered. When it hits 3, disable the field. QED.
Re: checking for password verification for 3 counts [message #536755 is a reply to message #536712] Thu, 22 December 2011 08:22 Go to previous messageGo to next message
fakhar55
Messages: 99
Registered: September 2005
Location: UAE
Member
In the when-button-pressed trigger you can add one if condition and increment a local variable if user enters wrong usernam/pass. if it(variable) exceeds number 3 you can add disable code for the fields. Just initialize the variable with 0.
Re: checking for password verification for 3 counts [message #536756 is a reply to message #536755] Thu, 22 December 2011 08:24 Go to previous messageGo to next message
fakhar55
Messages: 99
Registered: September 2005
Location: UAE
Member
Sorry if it equals 3 ....
Re: checking for password verification for 3 counts [message #536778 is a reply to message #536756] Thu, 22 December 2011 22:28 Go to previous messageGo to next message
poojamunj
Messages: 64
Registered: May 2011
Location: MUMBAI
Member
I have written the following code on when-buton-pressed trigger:


declare

v_pwd varchar2(20);


begin


select pwd
into v_pwd
from pwd
where user_name = :pwd.user_name;


if v_pwd=:pwd.pwd then
message('You are an authorise user');
message(' ');

else

message('Incorect pasword');
for i in 1..3
loop

message('count'||i);
message(' ');

raise form_trigger_failure;
go_item('pwd.pwd');

end loop;


set_item_property('pwd.user_name',enabled,property_false);
set_item_property('pwd.pwd',enabled,property_false);

message('Password locked');
message(' ');
raise form_trigger_failure;

end if;

end;
----------------------------------------------------------------
Here, the counter is not geting incremented as it hits 1.Can anyone please tell the correction.
Thanks.
Re: checking for password verification for 3 counts [message #536780 is a reply to message #536778] Fri, 23 December 2011 00:09 Go to previous message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
A counter? What counter? Where is it?

I thought of using a parameter (because, you can't use a local variable - it will be overwritten every time you execute this code) (or a global variable, but parameter is a better option). Increment its value ... you know, increment + 1
...
else
   :parameter.wrong_pwd_cnt := :parameter.wrong_pwd_cnt + 1;

   if :parameter.wrong_pwd_cnt = 3 then
      message('Too many failures');
      set_item_property ...
      raise form_trigger_failure;
   end if;
end if;
Previous Topic: Variable can't hold 4000 characters
Next Topic: please help me
Goto Forum:
  


Current Time: Thu Jul 25 22:34:13 CDT 2024