From 23145d356c9461d83545f76207afce42d391a20d Mon Sep 17 00:00:00 2001 From: einhverfr Date: Fri, 14 Sep 2007 18:36:53 +0000 Subject: Removing obsolete user creation stored procs and inserts git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1600 4979c152-3d1c-0410-bac9-87ea11338e46 --- sql/Pg-database.sql | 16 +--------------- sql/modules/admin.sql | 4 +++- 2 files changed, 4 insertions(+), 16 deletions(-) (limited to 'sql') diff --git a/sql/Pg-database.sql b/sql/Pg-database.sql index e57d0b1c..76b22079 100644 --- a/sql/Pg-database.sql +++ b/sql/Pg-database.sql @@ -131,27 +131,13 @@ COMMENT ON COLUMN users_conf.password IS 'This means we have to get rid of the c --INSERT INTO users(username) VALUES ('admin'); -- entity_id is declared NOT NULL !! - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ - - - INSERT INTO users_conf(id,password) VALUES (currval('users_id_seq'),NULL); +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -CREATE OR REPLACE FUNCTION create_user(text) RETURNS bigint AS $$ - INSERT INTO users(username) VALUES ($1); - SELECT currval('users_id_seq'); - $$ LANGUAGE 'SQL'; -COMMENT ON FUNCTION create_user(text) IS $$ Function to create user. Returns users.id if successful, else it is an error. $$; -CREATE OR REPLACE FUNCTION update_user(int4,text) RETURNS int4 AS $$ - UPDATE users SET username = $2 WHERE id = $1; - SELECT 1; - $$ LANGUAGE 'SQL'; -COMMENT ON FUNCTION update_user(int4,text) IS $$ Takes int4 which is users.id and text which is username. Will update username based on id. Username is unique $$; -- Session tracking table diff --git a/sql/modules/admin.sql b/sql/modules/admin.sql index 103c10c1..6b6aecfb 100644 --- a/sql/modules/admin.sql +++ b/sql/modules/admin.sql @@ -400,4 +400,6 @@ $$ language 'plpgsql'; comment on function admin_delete_group(text) IS $$ Deletes the input group from the database. Not designed to be used to remove a login-capable user. -$$; \ No newline at end of file +$$; + +-- TODO: Add admin user -- cgit v1.2.3