summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlinuxpoet <linuxpoet@4979c152-3d1c-0410-bac9-87ea11338e46>2006-10-24 00:55:44 +0000
committerlinuxpoet <linuxpoet@4979c152-3d1c-0410-bac9-87ea11338e46>2006-10-24 00:55:44 +0000
commit944f6ac23540eab0535fa3769442f3318dd4eb79 (patch)
tree974a8c63cfcd555fea7cc0bb40a118dc2dde14ca
parent78091904fc3f2a131e709f804ed4b3a0d5994d06 (diff)
added admin user defaults for postgresql
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@273 4979c152-3d1c-0410-bac9-87ea11338e46
-rwxr-xr-xsql/Pg-tables.sql7
-rw-r--r--sql/Pg-upgrade-2.6.18-2.6.19.sql8
2 files changed, 12 insertions, 3 deletions
diff --git a/sql/Pg-tables.sql b/sql/Pg-tables.sql
index b56a4d5c..d512ccbb 100755
--- a/sql/Pg-tables.sql
+++ b/sql/Pg-tables.sql
@@ -750,3 +750,10 @@ CREATE TABLE users_conf(id integer primary key references users(id) deferrable i
COMMENT ON TABLE users_conf IS 'This is a completely dumb table that is a place holder to get usersconf into the database. Next major release will have a much more sane implementation';
COMMENT ON COLUMN users_conf.id IS 'Yes primary key with a FOREIGN KEY to users(id) is correct';
COMMENT ON COLUMN users_conf.password IS 'This means we have to get rid of the current password stuff and move to presumably md5()';
+
+-- Per conversation with ChriseH, if the admin user has a null password a couple of things happen.
+-- 1. It is implicit that this is an initial install
+-- 2. If the admin password does not match the ledger-smb.conf admin password, we throw a hijack alert
+-- The two below statements must be run from a single session
+INSERT INTO users(username) VALUES ('admin');
+INSERT INTO users_conf(id,password) VALUES (currval('users_id_seq'),NULL);
diff --git a/sql/Pg-upgrade-2.6.18-2.6.19.sql b/sql/Pg-upgrade-2.6.18-2.6.19.sql
index 6613976a..f06f661e 100644
--- a/sql/Pg-upgrade-2.6.18-2.6.19.sql
+++ b/sql/Pg-upgrade-2.6.18-2.6.19.sql
@@ -185,6 +185,8 @@ COMMENT ON COLUMN users_conf.id IS 'Yes primary key with a FOREIGN KEY to users(
COMMENT ON COLUMN users_conf.password IS 'This means we have to get rid of the current password stuff and move to presumably md5()';
COMMIT;
-
-
-
+-- Admin user --
+BEGIN;
+INSERT INTO users(username) VALUES ('admin');
+INSERT INTO users_conf(id,password) VALUES (currval('users_id_seq'),NULL);
+COMMIT; \ No newline at end of file