[BETA] Account Links

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Anti-Spam Guide
saashannon
Registered User
Posts: 4
Joined: Mon Jul 23, 2007 12:11 am

Re: [BETA] Linked Accounts

Post by saashannon »

Yeah, we did. Checked the db and the master_id field is there with the right settings (I think).
Drakkim
Registered User
Posts: 176
Joined: Thu Feb 05, 2004 5:48 am

Re: [BETA] Linked Accounts

Post by Drakkim »

Apearantly some of my (unfinished) development code made it into the 'final' package. Grab the new package from my site and see if that works. This time it's straight off the versions running on my site :-)

-Drakkim
Drakkim
Registered User
Posts: 176
Joined: Thu Feb 05, 2004 5:48 am

Re: [BETA] Linked Accounts

Post by Drakkim »

I just fixed the account_switch_form function to use the language system... (functions_linked_acct.php) If you already updated, make sure you use 0.5.2

-Drakkim
mhorst
Registered User
Posts: 4
Joined: Sun Aug 26, 2007 11:07 am

Re: [BETA] Linked Accounts

Post by mhorst »

Hi,

I installed your mod and tested it for a bit. So far it seems to work great.

I did run into a few problems at first though:
- I couldn't view the Linked_Accounts.xml file in Firefox under Debian etch. As I understand it this is probably a problem with my system, rather than with the mod. But it was simple enough to open the xml file in another viewer and install the mod.
- 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)"
- The second problem was that after linking the mod told me that there were no linked accounts.
My solution: In functions_linked_acct.php, in the function get_linked_accounts, I replaced "sql_query_limit($sql, $count)" by "sql_query($sql)".
Again the limit query was the problem, but now for a different reason: the $count variable is never initialized (and therefore gets the value 0, I assume).
BTW if nobody else has this problem I guess the count variable is given a random value on their system, or their database system silently ignores limit queries.
- 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.

Anyways, thanks for the mod I think it will be very useful on my forum.
Drakkim
Registered User
Posts: 176
Joined: Thu Feb 05, 2004 5:48 am

Re: [BETA] Linked Accounts

Post by Drakkim »

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 :-)
mhorst wrote:- The second problem was that after linking the mod told me that there were no linked accounts.
My solution: In functions_linked_acct.php, in the function get_linked_accounts, I replaced "sql_query_limit($sql, $count)" by "sql_query($sql)".
This one was actually bad code :oops: your change is correct.
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.

-Drakkim
User avatar
Frug
Registered User
Posts: 144
Joined: Sun Jun 05, 2005 3:48 am

Re: [BETA] Linked Accounts

Post by Frug »

Holy crap dude!

I spent days looking for this mod for phpbb2 and nobody had it, nobody thought it was worth making. You rule! Thank you!
- - - - - - - - - - - Do not use dotted lines - - - - - - - - - -
- - - - - - - - - - - or automatic signatures - - - - - - - - - -
Thar Shaddin - online freeform roleplaying for writers
mhorst
Registered User
Posts: 4
Joined: Sun Aug 26, 2007 11:07 am

Re: [BETA] Linked Accounts

Post by mhorst »

Drakkim wrote:
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?
Drakkim wrote:
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.

EDIT:
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.

EDIT2:
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.

EDIT3:
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.
TheMiNd
Registered User
Posts: 19
Joined: Fri Apr 14, 2006 1:47 am
Location: Beyond the Vortex

Re: [BETA] Linked Accounts

Post by TheMiNd »

Been a while since Drakkim's posted. Lets hope you're reading.

*I'm not finding any edits that actually add the ability to link accounts. Is that a mistake? I don't see any fields that will let me link the accounts.
*I'd like some suggestions on making the account selection form's size match my theme.
Drakkim
Registered User
Posts: 176
Joined: Thu Feb 05, 2004 5:48 am

Re: [BETA] Linked Accounts

Post by Drakkim »

phpBB.com tells me when to read :-)

All of the 'brains' are in the module and should match whatever theme you use. The only exception is the actual Account Switch box which silly me coded into the main functions. I probably need to make that a template as well and just include that when the function gets called. If that's more or less what you're looking for, let me know and I'll see if I can't work that into a new version (along with some of mhorst's changes).

-Drakkim
TheMiNd
Registered User
Posts: 19
Joined: Fri Apr 14, 2006 1:47 am
Location: Beyond the Vortex

Re: [BETA] Linked Accounts

Post by TheMiNd »

Yeah the Account Switch box is what I need to match the theme. Right now the box is bigger than it should be given the rest of the skin.

What about actually Linking the accounts? Where do I do that?
Drakkim
Registered User
Posts: 176
Joined: Thu Feb 05, 2004 5:48 am

Re: [BETA] Linked Accounts

Post by Drakkim »

After you install the modules (via ACP), the options are in the User Control Panel under Profile.

-Drakkim
User avatar
Frug
Registered User
Posts: 144
Joined: Sun Jun 05, 2005 3:48 am

Re: [BETA] Linked Accounts

Post by Frug »

Have i mentioned that you're my hero drakkim?
- - - - - - - - - - - Do not use dotted lines - - - - - - - - - -
- - - - - - - - - - - or automatic signatures - - - - - - - - - -
Thar Shaddin - online freeform roleplaying for writers
naushadhassam
Registered User
Posts: 506
Joined: Wed Aug 15, 2007 9:57 pm

Re: [BETA] Linked Accounts

Post by naushadhassam »

great mod dude. it will def come in handy :D
Free Hosting - Here
Sports Entertainment Online ( A PS3 Online Gaming Community ) - Here
FREE UNLIMITED HOSTING FOR PHPBB MOD MAKERS - PM ME FOR MORE INFO ( MY WAY ON DONATING TO PHPBB )
User avatar
Rotsblok
Registered User
Posts: 648
Joined: Fri Nov 11, 2005 12:47 pm
Location: Upper north of Holland
Name: Rikkert Westa

Re: [BETA] Linked Accounts

Post by Rotsblok »

Can it also be made so that only admins and or mods can link accounts???? would come in handy on lots of boards
Nederlandse Support site
Several dutch translations for 3.1 extensions if you need one or there is an update of an extension feel free to notify me.
Drakkim
Registered User
Posts: 176
Joined: Thu Feb 05, 2004 5:48 am

Re: [BETA] Linked Accounts

Post by Drakkim »

I don't see why not... I'll have to look into the permission level stuff... not sure how that works... But first I have to look into the RC7 changes... An account that was linked before still works after the upgrade... but because of the password changes, you can't link new accounts.

I'll be getting that fixed hopefully in the next few days...

-Drakkim

Return to “[3.0.x] MODs in Development”