phpScheduleIt
May 24, 2013, 12:31:10 PM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: phpScheduleIt 2.4.2 has been released!
Home
Help
Login
Register
phpScheduleIt
>
Help and Support
>
phpScheduleIt 1.2.x
>
db error on first login
Pages: [
1
]
« previous
next »
Print
Author
Topic: db error on first login (Read 2218 times)
colmconn
Newbie
Karma: 0
Posts: 27
db error on first login
«
on:
July 06, 2007, 12:24:34 PM »
Greetings,
I've finally managed to get phpscheduleit 1.2.7 to authenticate aginst my OpenLDAP server, however when I login for the first time using a user id in the LDAP server I get this error message:
There was an error executing your query:
DB Error: no such field INSERT INTO permission (memberid, machid) SELECT "sc1468e696f49362", machid FROM resources WHERE autoassign=1 [nativecode=ERROR: column "sc1468e696f49362" does not exist]
The data base in this case was newly created and is running on postgresql 7.4. I'm using PHP 4.3.9 and apache 2.0
When I login using the same user id and password as before this error does not occur. Any idea what's causing it?
Also this user id treated as an ordinary user and not admin even though it is the first login to the system (with a freshly created DB). I set the adminEmail to be the userid (not email) of the first person who would login. I figured it would be the same as if phpscheduleit was managing the user db itself. Is this not the case when authenticating against LDAP? How does on set up the admin a/c when authenticating against LDAP.
Also would it be much trouble to retrieve group associations from LDAP instead of in the sql database?
Thanks,
Colm.
Logged
Nick
Administrator
Hero Member
Karma: 15
Posts: 5419
db error on first login
«
Reply #1 on:
July 06, 2007, 01:34:34 PM »
Probably a compatibility issue with Postgres. Try changing line 186 of lib/db/AuthDB.class.php to:
$sql = 'INSERT INTO ' . $this->get_table('permission') . ' (memberid, machid) SELECT "' . $id . '" as memberid, machid FROM ' . $this->get_table('resources') . ' WHERE autoassign=1';
Logged
colmconn
Newbie
Karma: 0
Posts: 27
db error on first login
«
Reply #2 on:
July 08, 2007, 10:09:36 AM »
unfortunately this made no difference. i still get the error message when i login for the first time (on a newly created db).
one thing to note though is that the error makes sense as the resource table is empty. when I run selet * from resources; i get this:
phpscheduleit=> select * from resources;
machid | scheduleid | name | location | rphone | notes | status | minres | maxres | autoassign | approval | allow_multi | max_participants | min_notice_time | max_notice_time
--------+------------+------+----------+--------+-------+--------+--------+--------+------------+----------+-------------+------------------+-----------------+-----------------
(0 rows)
Any ideas?
Logged
Nick
Administrator
Hero Member
Karma: 15
Posts: 5419
db error on first login
«
Reply #3 on:
July 09, 2007, 10:02:59 AM »
One other quick thing to try is changing that same line to this:
Code:
$sql = 'INSERT INTO ' . $this->get_table('permission') . " (memberid, machid) SELECT '" . $id . "' as memberid, machid FROM " . $this->get_table('resources') . ' WHERE autoassign=1';
Which just changes the quotes to be single instead of double.
Logged
colmconn
Newbie
Karma: 0
Posts: 27
db error on first login
«
Reply #4 on:
July 09, 2007, 01:08:43 PM »
cool, that seems to have done the trick. the only thing is that the first user logging in is not automatically made the admin. the only way to do this seems to be to manually update the sql db.
thanks for your help.
Logged
colmconn
Newbie
Karma: 0
Posts: 27
db error on first login
«
Reply #5 on:
July 09, 2007, 01:17:26 PM »
now when I add a resource i get this error message
There was an error executing your query:
DB Error: no such field INSERT INTO permission (memberid, machid) SELECT memberid, "sc146926d626ebf3" FROM login [nativecode=ERROR: column "sc146926d626ebf3" does not exist]
Logged
colmconn
Newbie
Karma: 0
Posts: 27
db error on first login
«
Reply #6 on:
July 09, 2007, 01:39:22 PM »
i fixed the last error by changing line 791 in AdminDB.class.php to
$sql = 'INSERT INTO ' . $this->get_table(TBL_PERMISSION) . " (memberid, machid) SELECT memberid, '" . $machid . "' FROM " . $this->get_table('login');
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> Announcements
=> Open Discussion
=> Donations
-----------------------------
Help and Support
-----------------------------
=> phpScheduleIt 2.x
=> EspaƱol
=> phpScheduleIt 1.2.x
=> phpScheduleIt 1.1.x
=> New Features and Suggestions
=> Developers
-----------------------------
Bugs
-----------------------------
=> phpScheduleIt 1.2.x
=> phpScheduleIt 1.1.x
-----------------------------
Modifications
-----------------------------
=> Post Modifications
=> Request Modification
-----------------------------
Development
-----------------------------
=> phpScheduleIt 2.0
-----------------------------
Off-Topic
-----------------------------
=> Non-phpScheduleIt Discussion
Loading...