giftweb-discuss
[Top][All Lists]
Advanced

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

[Giftweb-discuss] Can't login


From: Gregory Gee
Subject: [Giftweb-discuss] Can't login
Date: Sat, 10 Jan 2004 18:29:18 -0500
User-agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624


I updated from CVS and erased the database for a clean install. For some reason I can't get
the login page to appear.  I get the following error.

*Fatal error*: Call to a member function on a non-object in */export/home/www/giftweb/giftweb/util.php* on line *92

* I can't be sure, but I think it is related to the userid sequence. I saw that fix that you did by changing the sequence to start at 102. I tried this yesterday trying to see if I could
figure it out and also got strange errors like that.

I don't know the postgresql very much but I believe it is because the userid field is related to a sequence that starts at 102, but the only user in the database is 101 which is lower
than the specified range.

Is there a different way to add the default group, admin user, etc. during the installation that would actually increment the sequence. I believe the initial problem before was that the sequence started at 101 but a user was added as 101 but did not increment the sequnce. I see that you are using the COPY command. This doesn't seem to trigger
the sequence.

Actually, if I think about it, you are adding rows into the tables before the sequence is
even defined.  Let me try something.....

.... better. I moved the copy statements to the bottom and change the sequence back
to start at 101.  Something still not right...

... ahhh, now it's working.  So, here seems to be the fix.

1.  You can change the userid sequence to start back at 101.

CREATE SEQUENCE users_uid_seq
   START 101
   INCREMENT 1
   MAXVALUE 9223372036854775807
   MINVALUE 1
   CACHE 1;

2. Change all the COPY commands to actually insert new records the same way that
the giftweb application would do it using the INSERT command.

INSERT INTO users (last_name, "password", login, updated, first_name, email) VALUES ('Administrator', 'password', 'admin', '2001-01-01', 'Site', 'address@hidden');
INSERT INTO groups (description, admin, verify_requests) VALUES
   ('DEFAULT GROUP', '101', 'f');

This allows that database to use the sequence and increment. Actually, we should probably change the groups insert to search for the admin userid instead of assuming 101. My SQL
isn't that good, so I'll need your help with that.

 Wow, learning a bit about postresql today. :-)

Thanks,
Greg







reply via email to

[Prev in Thread] Current Thread [Next in Thread]