|
hi Erman,
we are trying to restrict all database users with standart oracle function verify_function_11g . we already wrote the code but code work for also SYS and other admin,dba users.We want an exception code block for admin users .Could you help ?
This is our code and as I say its also working for SYS too but we want an exception :)
CREATE OR REPLACE FUNCTION SYS.verify_function_ORACLE
(username varchar2,
password varchar2,
old_password varchar2)
RETURN boolean IS
n boolean;
m integer;
db_name varchar2(30);
i_char varchar2(10);
BEGIN
-- Check for the minimum length of the password
IF length(password) < 8 THEN
raise_application_error(-20001, 'Password length less than 8');
END IF;
-- Check if the password is same as the username or username(1-100)
IF NLS_LOWER(password) = NLS_LOWER(username) THEN
raise_application_error(-20002, 'Password same as or similar to user');
END IF;
FOR i IN 1..100 LOOP
i_char := to_char(i);
if NLS_LOWER(username)|| i_char = NLS_LOWER(password) THEN
raise_application_error(-20005, 'Password same as or similar to user name ');
END IF;
END LOOP;
-- Everything is fine; return TRUE ;
RETURN(TRUE);
END;
|