[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [273] trunk/sql



Revision: 273
          http://svn.sourceforge.net/ledger-smb/?rev=273&view=rev
Author:   linuxpoet
Date:     2006-10-23 17:55:44 -0700 (Mon, 23 Oct 2006)

Log Message:
-----------
added admin user defaults for postgresql

Modified Paths:
--------------
    trunk/sql/Pg-tables.sql
    trunk/sql/Pg-upgrade-2.6.18-2.6.19.sql

Modified: trunk/sql/Pg-tables.sql
===================================================================
--- trunk/sql/Pg-tables.sql	2006-10-24 00:47:12 UTC (rev 272)
+++ trunk/sql/Pg-tables.sql	2006-10-24 00:55:44 UTC (rev 273)
@@ -750,3 +750,10 @@
 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);

Modified: trunk/sql/Pg-upgrade-2.6.18-2.6.19.sql
===================================================================
--- trunk/sql/Pg-upgrade-2.6.18-2.6.19.sql	2006-10-24 00:47:12 UTC (rev 272)
+++ trunk/sql/Pg-upgrade-2.6.18-2.6.19.sql	2006-10-24 00:55:44 UTC (rev 273)
@@ -185,6 +185,8 @@
 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


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.