-- FSN#36859.sql
--
-- Reset alle _FACILITOR OTP-secrets

SET ECHO ON
SET DEFINE ON
COLUMN fcltlogfile new_value fcltlogfile NOPRINT;
SELECT UPPER(USER) || '_FSN#36859' || to_char(sysdate,'YYYYMMDD_HH24MISS') || '.lst' AS fcltlogfile FROM DUAL;
SPOOL &fcltlogfile
SET DEFINE OFF

UPDATE prs_perslid
   SET prs_perslid_otpsecret = '1$30$6$0$' || RAWTOHEX(DBMS_RANDOM.string ('p', 20))
 WHERE prs_perslid_oslogin = '_FACILITOR';

BEGIN
    FOR c1 IN (SELECT prs_perslid_key
                 FROM prs_perslid
                WHERE prs_perslid_oslogin = '_FACILITOR')
    LOOP
        fac.trackaction ('PRSLOG', c1.prs_perslid_key, NULL, NULL, 'New OTP Secret set');
    END LOOP;
END;
/

BEGIN adm.systrackscriptId('$Id$'); END;
/

COMMIT;

SPOOL OFF
