Question: Switching Accounts

Users should come to the Embassy to make all suggestions, bug reports, complaints, and anything else relating to the forum itself. The Embassy Control staff will take all issues seriously. Or kill you. One of the two. Possibly both.
Post Reply
User avatar
Eliahad
Squire of the Crimson Assfro
Posts: 2545
Joined: Tue Mar 12, 2002 12:03 am

Question: Switching Accounts

Post by Eliahad »

For those of us who have gone to the trouble of making multiple accounts. Is there a way to switch accounts without logging out of one account first? Or should we just suck up and deal with the thirty seconds it would take to change ;)?
Chocolate sauce on a buttery nipple. *Bliss*
Control
Bulldrekker
Posts: 289
Joined: Thu Feb 14, 2002 12:23 am
Contact:

Post by Control »

There is currently no method of logging in that does not require logging out. However, that feature is in development for release soon after the board is launched. Unless everything goes to hell, and then we'll see how long it takes.

This feature is working on v0.2 and on the original phpBB 1.4.4 test board, so it is possible. It has simply not been implemented here.
User avatar
Wildfire
Wuffle Trainer
Posts: 1597
Joined: Mon Mar 18, 2002 10:13 am

I'm working on it...

Post by Wildfire »

That hack's been working on my phpBB 1.44 site for a while, but I haven't quite had the time to port it over to v2 yet. If Control would like the source, I am more than happy to provide it.
User avatar
Wildfire
Wuffle Trainer
Posts: 1597
Joined: Mon Mar 18, 2002 10:13 am

I'm working on it...

Post by Wildfire »

Lesson #1, posts appear <i>above</i> text box but don't refresh the screen...
Control
Bulldrekker
Posts: 289
Joined: Thu Feb 14, 2002 12:23 am
Contact:

I'm working on it...

Post by Control »

Wildfire wrote: That hack's been working on my phpBB 1.44 site for a while, but I haven't quite had the time to port it over to v2 yet. If Control would like the source, I am more than happy to provide it.
Our 1.4.4 test site features this, as well, but it was a much simpler feature then. Simply making the login fields appear whether the user was logged in or not was enough in 1.4.4. In 2.0, the user must be logged out before the user can log back in again. If you discover a way to make it work on 2.0, please, let us know.
User avatar
Wildfire
Wuffle Trainer
Posts: 1597
Joined: Mon Mar 18, 2002 10:13 am

Post by Wildfire »

Totally different approach, but I unfortunatly can't demonstate anymore, as the upgrade to PHP 4 broke the previously working one on my site.

In short, you add a PID field to the user table, and a place in the profile for it, and write three scripts.

one to have a user get a PID (ours were 5 digit self-selectable)
one to link accounts - in the profile, you ask for a username/password/PID set and if it all checks out, you make the PID for the user whose profile you're in the same as the PID entered.
one to do the account switching - edited the header to have a jumpbox opposite the login boxes at the top of the page, whenever you log in, the script reads all the matching username/password pairs out of the database that match the PID and populate the jumpbox with them. Pick one, hit Switch, and the script logs you out, and the account you selected in.

ie

User: Wildfire
Password: stuff
PID: 42

Register Gavin Heartsong, enter above info in the Account Link block. PID for Gavin Heartsong now equals 42. Somewhere on the page is a little jumpbox now, and whenever I log in as Wildfire, I can pick Gavin Heartsong out of the jumpbox, hit switch, and Wildfire is logged out, Gavin logged in, and the index is loaded.
User avatar
Cash
Needs Friends
Posts: 9261
Joined: Wed Mar 13, 2002 6:02 am
Location: San Jose, CA

Post by Cash »

That would be most kick ass.
<font color=#5c7898>A high I.Q. is like a jeep. You'll still get stuck; you'll just be farther from help when you do.
</font>
Control
Bulldrekker
Posts: 289
Joined: Thu Feb 14, 2002 12:23 am
Contact:

Post by Control »

Wildfire wrote: Totally different approach, but I unfortunatly can't demonstate anymore, as the upgrade to PHP 4 broke the previously working one on my site.

In short, you add a PID field to the user table, and a place in the profile for it, and write three scripts.

one to have a user get a PID (ours were 5 digit self-selectable)
one to link accounts - in the profile, you ask for a username/password/PID set and if it all checks out, you make the PID for the user whose profile you're in the same as the PID entered.
one to do the account switching - edited the header to have a jumpbox opposite the login boxes at the top of the page, whenever you log in, the script reads all the matching username/password pairs out of the database that match the PID and populate the jumpbox with them. Pick one, hit Switch, and the script logs you out, and the account you selected in.

ie

User: Wildfire
Password: stuff
PID: 42

Register Gavin Heartsong, enter above info in the Account Link block. PID for Gavin Heartsong now equals 42. Somewhere on the page is a little jumpbox now, and whenever I log in as Wildfire, I can pick Gavin Heartsong out of the jumpbox, hit switch, and Wildfire is logged out, Gavin logged in, and the index is loaded.
That is how account linking currently works on ezboard. This would be a much-desired feature. How likely is it that you could assist in writing such a feature?
User avatar
&#8734;
Tasty Human
Posts: 60
Joined: Mon Mar 18, 2002 1:41 pm

Post by &#8734; »

Depending on your database structure, it shouldn't be too hard. I could help out if that's desirable.
Control
Bulldrekker
Posts: 289
Joined: Thu Feb 14, 2002 12:23 am
Contact:

Post by Control »

&#8734; wrote: Depending on your database structure, it shouldn't be too hard. I could help out if that's desirable.
Certainly. This is a level of coding beyond us, and the assistance of yourself and Wildfire, and any other PHP programmers - will be invaluable.
User avatar
Wildfire
Wuffle Trainer
Posts: 1597
Joined: Mon Mar 18, 2002 10:13 am

Post by Wildfire »

100%. I need to port it as I have 12 characters running around on MG, and refuse to log out and in each time. I need to get home first (Saturday) and then take a crack at seeing what the relavant differences between 1.4 and 2 are to make it function correctly. I will definietly need that extra field in the users table, though. The rest will depend on me mucking around in my test board to make it work right, and then I'll get it up here ASAP. I'll aim for one month as a timeframe.

I'm assuming you have access to the database and/or know SQL, if not I can pass you the neccessary script to run to add a field and the tiny changes you need to make to certain files.
Control
Bulldrekker
Posts: 289
Joined: Thu Feb 14, 2002 12:23 am
Contact:

Post by Control »

Wildfire wrote: I'm assuming you have access to the database and/or know SQL, if not I can pass you the neccessary script to run to add a field and the tiny changes you need to make to certain files.
We have access to the database, and are somewhat familiar at this point with SQL. If you can pass along what fields need to be added and where, and a list of changes to the files - basically, the same information you'll find for any mod - that should be sufficient. If it is not, we can always ask you.

This would be a much-desired mod. A month sounds like an excellent timeframe.
User avatar
&#8734;
Tasty Human
Posts: 60
Joined: Mon Mar 18, 2002 1:41 pm

Post by &#8734; »

Which version of MySql is being utilized?
User avatar
Bethyaga
Knight of the Crimson Assfro
Posts: 2777
Joined: Mon Mar 11, 2002 10:39 pm
Location: Nebraska, USA
Contact:

Post by Bethyaga »

Thank you Wildfire (and Deev and Control). If you guys make this work, I will be a very very happy man.
_Whoever invented that brush that goes next to the toilet is an idiot, cuz that thing hurts.
Control
Bulldrekker
Posts: 289
Joined: Thu Feb 14, 2002 12:23 am
Contact:

Post by Control »

&#8734; wrote: Which version of MySql is being utilized?
3.23.48.
User avatar
Wildfire
Wuffle Trainer
Posts: 1597
Joined: Mon Mar 18, 2002 10:13 am

Post by Wildfire »

Its your decision as to what form the PID will take. Ours became PID, short for Personnel ID, since its a military-ish campaign base and was 5 digits. It can be anything you like, and either set by the user, or incremented by the database like the membership number is.

Either way, within the users table, a field called PID needs to be added of the proper type, short int, varchar, whatever. The only other changes are in the v2 equivalents of bbprofile.php and bbregister.php. In the UPDATE and INSERT commands which execute at the end of the file (when the user hits 'Submit'), the field name needs to be tacked on the the list of things its submitting.

The rest will depend on the specific implimentation. If you want to wait, I can also send you the actual lines of code in context once I get back to my machine.

And I have just now realized that in the space of about 6 hours, I have suddenly become the Bulldrek phpBB code slut...
User avatar
&#8734;
Tasty Human
Posts: 60
Joined: Mon Mar 18, 2002 1:41 pm

Post by &#8734; »

Wildfire :: I'm assuming this PID [personal ID?] is an auto incremental field, why do you need to tag it on your insert and update statements? How is the statement set up?
User avatar
Wildfire
Wuffle Trainer
Posts: 1597
Joined: Mon Mar 18, 2002 10:13 am

Post by Wildfire »

It can be an auto-incremental I suppose. In which case, it would work slightly differently, but since it was setup to be self-selectable (we're a picky bunch of people who have poor memories, assigned numbers didn't go over too well), it has to be included in the phpBB code that stores user details into the database.

If its auto incremental, then you don't need to change the lines, but make sure the script that creates PID throws the value back to you so you know what it is, and then make sure you have a way much like password retrival to get it back. In a self-select system, you just change the PID in an account, and then go muck with all the other profiles to relink everything.
Post Reply