-- ------------------------------------------------------------------------------
-- Script d'initialisation du paramétrage.

-- @package openresultat
-- @version SVN : $Id$
-- ------------------------------------------------------------------------------

-- PROFIL
INSERT INTO om_profil (om_profil, libelle, hierarchie) 
SELECT
    nextval('om_profil_seq'),
    'saisie resultat et centaine',
    0
WHERE NOT EXISTS (
    SELECT om_profil
    FROM om_profil
    WHERE libelle = 'saisie resultat et centaine');

-- PERMISSIONS
INSERT INTO "om_droit" ("om_droit", "libelle", "om_profil") VALUES
(nextval('om_droit_seq'), 'password', currval('om_profil_seq')),
(nextval('om_droit_seq'), 'menu_application', currval('om_profil_seq')),
(nextval('om_droit_seq'), 'election_tab', currval('om_profil_seq')),
(nextval('om_droit_seq'), 'election_consulter', currval('om_profil_seq')),
(nextval('om_droit_seq'), 'election_unite_tab', currval('om_profil_seq')),
(nextval('om_droit_seq'), 'election_unite_consulter', currval('om_profil_seq')),
(nextval('om_droit_seq'), 'election_unite_modifier', currval('om_profil_seq')),
(nextval('om_droit_seq'), 'election_unite_overlay', currval('om_profil_seq')),
(nextval('om_droit_seq'), 'election_unite_centaine_tab', currval('om_profil_seq')),
(nextval('om_droit_seq'), 'election_unite_centaine_consulter', currval('om_profil_seq')),
(nextval('om_droit_seq'), 'election_unite_centaine_modifier', currval('om_profil_seq')),
(nextval('om_droit_seq'), 'election_unite_saisir_centaine', currval('om_profil_seq')),
(nextval('om_droit_seq'), 'centaine_tab', currval('om_profil_seq')),
(nextval('om_droit_seq'), 'centaine_ajouter', currval('om_profil_seq')),
(nextval('om_droit_seq'), 'centaine_consulter', currval('om_profil_seq')),
(nextval('om_droit_seq'), 'centaine_modifier', currval('om_profil_seq'));

-- UTILISATEUR
INSERT INTO om_utilisateur (om_utilisateur, nom, email, login, pwd, om_collectivite, om_type, om_profil) VALUES
(nextval('om_utilisateur_seq'), 'saisie', 'saisie@saisie.saisie', 'saisie', md5('saisie'), 1, 'DB', currval('om_profil_seq'));