73 lines
2.0 KiB
SQL
73 lines
2.0 KiB
SQL
--
|
|
-- $Id$
|
|
--
|
|
-- Customer specific once-script MNNL#76394-Wachtwoorden.sql.
|
|
DEFINE thisfile = 'MNNL#76394-Wachtwoorden.sql'
|
|
DEFINE dbuser = '^MNNL'
|
|
|
|
SET ECHO ON
|
|
SET DEFINE ON
|
|
COLUMN fcltlogfile NEW_VALUE fcltlogfile NOPRINT;
|
|
COLUMN fcltcusterr NEW_VALUE fcltcusterr NOPRINT;
|
|
WHENEVER SQLERROR CONTINUE;
|
|
SELECT adm.getscriptspoolfile('&thisfile') AS fcltlogfile FROM DUAL;
|
|
SPOOL &fcltlogfile
|
|
WHENEVER SQLERROR EXIT;
|
|
SELECT adm.checkscriptcust('&dbuser') AS fcltcusterr FROM DUAL;
|
|
WHENEVER SQLERROR CONTINUE;
|
|
PROMPT &fcltcusterr
|
|
SET DEFINE OFF
|
|
|
|
------ payload begin ------
|
|
|
|
-- MNNL#76394: Wissen wachtwoorden van alle MN medewerkers met een wachtwoord
|
|
-- (en @mn.nl in e-mail adres).
|
|
/*
|
|
SELECT p.*
|
|
FROM prs_perslid p
|
|
WHERE p.prs_perslid_verwijder IS NULL
|
|
AND p.prs_perslid_key > 10
|
|
AND p.prs_perslid_apikey IS NULL
|
|
AND INSTR (UPPER (p.prs_perslid_email), '@MN.NL') > 0
|
|
AND p.prs_perslid_wachtwoord_hash IS NOT NULL;
|
|
|
|
UPDATE prs_perslid p
|
|
SET p.prs_perslid_salt = NULL,
|
|
p.prs_perslid_wachtwoord_hash = NULL,
|
|
p.prs_perslid_wachtwoord_exp = NULL,
|
|
p.prs_perslid_otpsecret = NULL
|
|
WHERE p.prs_perslid_key > 10
|
|
AND p.prs_perslid_apikey IS NULL
|
|
AND INSTR (UPPER (p.prs_perslid_email), '@MN.NL') > 0
|
|
AND p.prs_perslid_wachtwoord_hash IS NOT NULL;
|
|
*/
|
|
DECLARE
|
|
CURSOR c
|
|
IS
|
|
SELECT p.prs_perslid_key
|
|
FROM prs_perslid p
|
|
WHERE p.prs_perslid_verwijder IS NULL
|
|
AND p.prs_perslid_key > 10
|
|
AND p.prs_perslid_apikey IS NULL
|
|
AND INSTR (UPPER (p.prs_perslid_email), '@MN.NL') > 0
|
|
AND p.prs_perslid_wachtwoord_hash IS NOT NULL;
|
|
BEGIN
|
|
FOR rec IN c
|
|
LOOP
|
|
prs.setpassword (rec.prs_perslid_key, NULL);
|
|
END LOOP;
|
|
END;
|
|
/
|
|
|
|
------ payload end ------
|
|
|
|
SET DEFINE OFF
|
|
BEGIN adm.systrackscriptId ('$Id$', 1); END;
|
|
/
|
|
|
|
COMMIT;
|
|
SET ECHO OFF
|
|
SPOOL OFF
|
|
SET DEFINE ON
|
|
PROMPT Logfile of this upgrade is: &fcltlogfile
|