-- Customer specific once-script related to logcenter call: AAIT#34129
--
-- (c) 2012 SG|facilitor bv
-- $Revision$
-- $Id$
--
-- Support: +31 53 4800700


SET ECHO ON
SET DEFINE ON
column fcltlogfile new_value fcltlogfile NOPRINT;
select UPPER(USER) || '_AAIT#34129.lst' as fcltlogfile from dual;
spool &fcltlogfile
SET DEFINE OFF

alter session set nls_territory = 'America';

INSERT INTO prs_perslid (prs_perslid_key,
                         prs_perslid_module,
                         prs_srtperslid_key,
                         prs_afdeling_key,
                         prs_perslid_naam,
                         prs_perslid_flags)
   SELECT 11,
          p.prs_perslid_module,
          p.prs_srtperslid_key,
          p.prs_afdeling_key,
          'Onbekende mail afzender',
          4
     FROM prs_perslid p
    WHERE p.prs_perslid_oslogin = '_FACILITOR';



INSERT INTO fac_email_setting (fac_email_setting_user,
                               fac_email_setting_action,
                               fac_email_setting_attachpath)
    VALUES ('servicedesk',
            'aaxx_processemail',
            'D:\Apps\Facilitor\AAFM_A\CUST\' || UPPER (USER) || '\flexfiles\');


UPDATE fac_setting
   SET fac_setting_pvalue = 3, fac_setting_datum = SYSDATE
 WHERE fac_setting_name = 'mld_melding_flags';

UPDATE fac_setting
   SET fac_setting_pvalue = 2, fac_setting_datum = SYSDATE
 WHERE fac_setting_name = 'mld_flag_on_bonote';

UPDATE fac_setting
   SET fac_setting_pvalue = 1, fac_setting_datum = SYSDATE
 WHERE fac_setting_name = 'mld_flag_on_fenote';

INSERT INTO fac_api
   (fac_api_name,
    fac_api_filepath)
 VALUES
   ('HMAIL',
    'appl/api/api_hmail.asp');

-- Voeg een gebruiker toe om de api uit te voeren
INSERT INTO prs_perslid (prs_perslid_module,
                         prs_srtperslid_key,
                         prs_afdeling_key,
                         prs_perslid_naam,
                         prs_perslid_oslogin,
                         prs_perslid_apikey,
                         prs_perslid_flags,
                         prs_perslid_systeemadres)
   SELECT 'PRS',
          p.prs_srtperslid_key,
          p.prs_afdeling_key,
          'hMail API user',
          '_HMAIL',
          DBMS_RANDOM.string ('a', 32),
          4,
          NULL
     FROM prs_perslid p
    WHERE p.prs_perslid_oslogin = '_FACILITOR';

COMMIT;

SPOOL OFF

