mhorst wrote:- At first I could not link accounts, receiving a database error when I tried to. The reason for this is that my forum runs on a Postgres database system, which does not support limits on update queries.
My solution: In functions_linked_acct.php, in the function link_accounts, I replaced "sql_query_limit($sql, 1)" by "sql_query($sql)"
Hmm... If that's a limit to pgSQL, I'd have thought the DBAL would have taken care it... that's the point of DBAL, isn't it? That will work... since we're looking up by user_id, there can only be one return anyway
Yeah, I guess the DBAL should be extended so that the sql_query_limit function for pgSQL differentiates between update queries and other queries.
Maybe we should submit it as a bug?
mhorst wrote:- After that I had a problem switching between accounts. I think this might be because I linked the admin account as a master account to an ordinary account. When logged in as admin I cannot switch to the ordinary account, but when I first log in as an ordinary user I can switch to the admin account and back again without problems. I'll see if I can figure out where the problem is.
That one is strange... I actually have my admin account as 'Master' and two normal users as 'Linked' I have no problems switching among any of accounts.
I'll make the sql_query changes in the code for the next revision... in the mean time... let me know if you find anything on the last one... Even if it's just something that I can use to duplicate or debug.
It seems some of my users also have problems with it, so its not the admin account. I think it might matter what account you log into. If you originally login on a linked account everything works fine, but when your original login is on the master account things go awry. I think
I'll have more time to do more testing and figure this one out during the weekend.
Oh, and I forgot one in my previous post:
I replaced "MEDIUMINT ( 8 ) UNSIGNED" in the ALTER TABLE query by "integer", since that is the type of the user_id field in my pgSQL database.
I did some more testing: apparently it has nothing to do with the master or linked account.
When I log into my forum with the option "Log me on automatically each visit" enabled I cannot switch between accounts. If I log out and log in again without that option enabled it works fine.
I added the line "$user->cookie_data['k'] = false;"
before "$result = $user->session_create($forumid, $admin, $autologin, $viewonline);"
in the function startsession_byID in the file functions_linked_acct.php
This effectively erases the autologin key, which the session_create function searches for and causes it to automatically login as the user for which the autologin option was enabled.
This seems to solve the problem, but I don't know what kind of repercussions it might have.
As I could have expected my modification disables the auto login feature.
I think I solved this by adding another line containing "$autologin = $user->data['session_autologin']" before the "$result = $user->session_create($forumid, $admin, $autologin, $viewonline);".
This should copy the autologin settings from the previous session to the new session.