Making use of password change function through forms [message #268421] |
Tue, 18 September 2007 09:33  |
aviana
Messages: 106 Registered: July 2007
|
Senior Member |
|
|
Hi,
I have a oracle form(version 6) for changing the user passwords.
It contains user name,old password,new password and confirm password fields and OK and Cancel buttons.
Some users are assigned a newly created profile(backend)
We have managed to create users under that different profile and want to make them change their passwords compulsarily after 3 months(this is also set in database level).
There is a function(we modified a little bit ,the program from oracle for verifying password ) in the database and it is working fine at the database level-means if the password is short, or if it is not having letters and if the password is a common word and so on--there are a number of cases the function checks.
How to implement the same in forms?ie, i want to get the error messages thrown by databse function in the forms level.Presently it is showing oracle error messages which I want to replace.
Please give the reply in a little bit detail - ie, what all to do in forms and where?Any help appreciated
Thanks
[Updated on: Tue, 18 September 2007 09:44] Report message to a moderator
|
|
|
|
|
|
|
|
Re: Making use of password change function through forms [message #269252 is a reply to message #269168] |
Fri, 21 September 2007 06:30   |
aviana
Messages: 106 Registered: July 2007
|
Senior Member |
|
|
This is the existing code which was previously written
But it will change password whatever new password i give- no cheking at all
I want to get the same result in the database level for password checking
begin
declare current_password varchar2(30);
current_user varchar2(30);
x number;
ddl_string varchar2(100);
begin
current_password := upper(get_application_property(password));
current_user := upper(get_application_property(username));
--if (:change_pass.old_password is null or :change_pass.new_password is null
-- or :change_pass.new_password_2 is null)then
-- null;
if length(:change_pass.new_password) < 6 then
x := show_alert('new_pw_too_short');
--don't validate old password if trying to change someone else's password,
elsif
(upper(:change_pass.old_password) != current_password
or upper(:change_pass.old_password)is null) then
x := show_alert('incorrect_old_pw');
elsif (upper(:change_pass.new_password) != upper(:change_pass.new_password_2)
or upper(:change_pass.new_password)is null
or upper(:change_pass.new_password_2)is null) then
x := show_alert('not_verified');
elsif upper(:change_pass.old_password) = upper(:change_pass.new_password) then
x := show_alert('new_pw_same_as_old_pw');
else
ddl_string := 'alter user '|| upper(:change_pass.current_username) ||
' identified by '||'"'|| upper(:change_pass.new_password)||'"';
-- uncomment when Oracle 8 --> dbms_utility.exec_ddl_statement(ddl_string);
forms_ddl(ddl_string);
--
x := show_alert('password_changed');
exit_form;
end if;
exception
when others then
if sqlcode = -01031 then
x := show_alert('no_privilege');
else
x:= show_alert('use_alphanumerics');
end if;
end;
end;
|
|
|
|
Re: Making use of password change function through forms [message #269767 is a reply to message #269641] |
Mon, 24 September 2007 08:08   |
aviana
Messages: 106 Registered: July 2007
|
Senior Member |
|
|
Hi,
There is a function verify_function(sample code supplied by oracle) which do the password checks.This is compiled in the SYS schema.This function is attached to a profile and the profile is attachd to the selected users.
If trying to change the password through sqplus for those users having the above profile, all the messages(password checks) specified in the password change function is coming.
Through the forms, we need to do the checks for all the users regardless of their profile.But for those users with the profile as mentioned above, the same messages in database level should appear.
Is this achievable through what you said?I dont understand fully also.Do you mind giving the code for this, or explain a little bit detail?
|
|
|
|
|
|
|
|
|
Re: Making use of password change function through forms [message #272866 is a reply to message #272510] |
Mon, 08 October 2007 01:36  |
 |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
In you first post you say:Quote: | How to implement the same in forms?ie, i want to get the error messages thrown by databse function in the forms level.Presently it is showing oracle error messages which I want to replace.
|
How about you search this forum for 'logon' and 'login' and look at the code that other people have used.
David
|
|
|