From 996300f719c4a30a98c63ae43a0294dfde1a1ef5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Barrois?= Date: Tue, 5 Oct 2010 20:01:02 +0200 Subject: [PATCH] Add code for creating a dummy admin account in the upgrade/setup folder. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaël Barrois --- upgrade/setup/001_admin_account.sql | 20 ++++++++++++++++++++ upgrade/setup/README | 5 +++++ 2 files changed, 25 insertions(+) create mode 100644 upgrade/setup/001_admin_account.sql create mode 100644 upgrade/setup/README diff --git a/upgrade/setup/001_admin_account.sql b/upgrade/setup/001_admin_account.sql new file mode 100644 index 0000000..ed5b3bb --- /dev/null +++ b/upgrade/setup/001_admin_account.sql @@ -0,0 +1,20 @@ +INSERT INTO accounts SET hruid = "blah.admin.42", type = "x", is_admin = 1, password = SHA1("Dummy4dminPassw0rd"), state = "active"; +SET @UID = LAST_INSERT_ID(); + +INSERT INTO profiles SET hrpid = "blah.admin.42", birthdate_ref = "1942-12-25"; +SET @PID = LAST_INSERT_PID(); + +INSERT INTO account_profiles SET uid = @UID, pid = @PID, perms = "owner"; + +INSERT INTO profile_display SET pid = @PID, yourself = "admin", public_name = "Blah Admin", promo = "X1942", sort_name = "ADMIN Blah", directory_name = "ADMIN Blah", short_name = "Admin", private_name = "Blah Admin"; + +SET @x_eduid = (SELECT id FROM profile_education_enum WHERE abbreviation = 'X'); +SET @ing_degreeid = (SELECT id FROM profile_education_degree_enum WHERE abbreviation = 'Ing.'); +INSERT INTO profile_education SET pid = @PID, eduid = @x_eduid, degreeid = @ing_degreeid, entry_year = 1942, grad_year = 1945, flags = 'primary'; + +SET @name_ini_id = (SELECT id FROM profile_name_enum WHERE type = 'name_ini'); +SET @firstname_ini_id = (SELECT id FROM profile_name_enum WHERE type = 'name_ini'); + +INSERT INTO profile_name SET pid = @PID, name = 'Admin', typeid = @name_ini_id; +INSERT INTO profile_name SET pid = @PID, name = 'Blah', typeid = @firstname_ini_id; + diff --git a/upgrade/setup/README b/upgrade/setup/README new file mode 100644 index 0000000..3bd1951 --- /dev/null +++ b/upgrade/setup/README @@ -0,0 +1,5 @@ +This folder includes basic instructions for getting a working version of plat/al. + +Once the code has been installed, "make" run and a database export gathered, run the .sql files in this folder. + +The scripts in this folder are meant to be used with the latest version of plat/al (the same than the one you got an export of) -- 2.1.4