SHARE
TWEET

Untitled

a guest Jul 18th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.      n integer;
  2.      m char(1);
  3.      begin
  4.        if old_password <> NULL then
  5.        if new_password = old_password
  6.               then raise_application_error(-20004, 'New password cannot be equal to the last one');
  7.        end if;
  8.        end if;
  9.  
  10.        if new_password = username then
  11.        raise_application_error(-20001, 'Username not found');
  12.        end if;
  13.        if length(new_password) < 8
  14.                then raise_application_error(-20002, 'New password should have at least 8 character');
  15.        end if;
  16.        n:=length(new_password);
  17.        for i in 1..n  loop
  18.                m:=SUBSTR(new_password,i,1);
  19.                if m = '\ù' then raise_application_error(-20003,'New password shouldn'' t contain special character'); end if;
  20.                if m = '!' then raise_application_error(-20003, 'New password shouldn t contain special character'); end if;
  21.                if m = '"' then raise_application_error(-20003, 'New password shouldn t contain special character'); end if;
  22.                if m = '$' then raise_application_error(-20003, 'New password shouldn t contain special character'); end if;
  23.                if m = '%' then raise_application_error(-20003, 'New password shouldn t contain special character'); end if;
  24.                if m = '&' then raise_application_error(-20003, 'New password shouldn t contain special character'); end if;
  25.                if m = '(' then raise_application_error(-20003, 'New password shouldn t contain special character'); end if;
  26.                if m = ')' then raise_application_error(-20003, 'New password shouldn t contain special character'); end if;
  27.                if m = '=' then raise_application_error(-20003, 'New password shouldn t contain special character'); end if;
  28.                if m = '?' then raise_application_error(-20003, 'New password shouldn t contain special character'); end if;
  29.                if m = '^' then raise_application_error(-20003, 'New password shouldn t contain special character'); end if;
  30.                if m = '''' then raise_application_error(-20003, 'New password shouldn t contain special character'); end if;
  31.                if m = '|' then raise_application_error(-20003, 'New password shouldn t contain special character'); end if;
  32.                if m = '.' then raise_application_error(-20003, 'New password shouldn t contain special character'); end if;
  33.                if m = ',' then raise_application_error(-20003, 'New password shouldn t contain special character'); end if;
  34.                if m = ';' then raise_application_error(-20003, 'New password shouldn t contain special character'); end if;
  35.                if m = ':' then raise_application_error(-20003, 'New password shouldn t contain special character'); end if;
  36.                if m = 'º' then raise_application_error(-20003, 'New password shouldn t contain special character'); end if;
  37.                if m = '*' then raise_application_error(-20003, 'New password shouldn t contain special character'); end if;
  38.                if m = '+' then raise_application_error(-20003, 'New password shouldn t contain special character'); end if;
  39.                if m = '#' then raise_application_error(-20003, 'New password shouldn t contain special character'); end if;
  40.                if m = '@' then raise_application_error(-20003, 'New password shouldn t contain special character'); end if;
  41.                if m = ' ' then raise_application_error(-20003, 'New password shouldn t contain special character'); end if;
  42.       end loop;
  43.        valid:=TRUE;
  44.        RETURN valid;
  45.  end;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top