News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Dual Login Cookies

Started by crackatown, May 01, 2011, 04:17:21 AM

Previous topic - Next topic

crackatown

I set it to not use local cookies, but global ones instead.

I still have to login in both forums though. Any ideas?

I still think my original idea of creating two cookies in a separate login file would be best. Does anyone know how to do that? What do I have to generate and in what order, etc.

Thanks.

texasman1979

your essentially wanting to do a bridge of 2 smf forums, similar to a bridge of smf and say wordpress.

if i where you, id look up the bridge mods for different softwares and smf, and that should give you a lot of ideas toward this idea.
SMF 2.0.4
SimplePortal 2.3.5

LOGIC is a FOUR letter word! :)


crackatown

Ok I will do that. What's the difference between a bridge and a portal?

crackatown

What if I used a portal mod that would load the scripts to my separate page and then I would run smf's login scripts to log in my users with set urls (run it twice essentially). That way I wouldn't even have to write my own cookie scripts.

Is there any special trick to make this work?

texasman1979

heres a questions, for what reason do you have to different forums that you wnat linked in such a way?

i dont have any idea how to do it, i was just giving suggestions as far as what i would try to do it, i dont understand why noone else wants to help you. my knowledge is limited on this par of smf.
SMF 2.0.4
SimplePortal 2.3.5

LOGIC is a FOUR letter word! :)


crackatown

I have a "premium" forum and a "normal" forum. The premium forum is just a way to constantly release important information that normal members don't receive. The main forum is for website support, questions, etc.

The mass login is needed so they don't have to login 3 times.

I do appreciate your help though. Thank you.

texasman1979

what you need is a script, ofc.

then you need a loop, form for main login screen you want, then loops for hidden web pages carrying the uname and pass along in hidden forms, and auto redirect twice for each forum, then returning them to the forum that originally logged in at.

your script will call the login page of each of the forums in a hidden redirect loop, while passing the log in credentials along in hidden forms that you invoke.

you will have to only with this method, prevent your individual forums from redirecting to the default logged in page (the forum). you would be basically controlling the form submissions and redirecting that smf would normally do on it own.

it would take a small amount of modifying the code on the forums, but should be that hard to take out the redirects and control the flow.

what would happen is that when they log in with you script, their screen would flicker a couple times in quick succession and then they would be logged in the both of them.

the forums would set up during this time the cookies they needed for future operation and all should be good.

look in loginout.php for login, login2, and all the other functions.

you dont need to mess with the cookies or sessions, just trick it.

remember to document this as well as you can and prepare a mod, this im sure might be needed by someone else at some point in time, and it can also help the folks that are currently building bridges to other softwares. this is a cheat, but it is a reasonable way of doing it with out having one huge whopping script.
SMF 2.0.4
SimplePortal 2.3.5

LOGIC is a FOUR letter word! :)


crackatown

I will start work :) Thank you very much.

One quick question. When sending the info through hidden forms will I have to auto submit them with javascript? Or is there a way to do it with PHP.

Arantor

Why not just have a single forum and have some boards that are VIP only? One forum, one login, managed by member groups. No joining, no bridges, no massives scaffolding across a system not designed to be bridged in that fashion...

crackatown

I would still need a site login for my main site. I would still have to login to both places at the same time.

Arantor

And what's stopping you doing that with SSI's ssi_login() function to put a login form on the front page? One cookie for ALL the systems.

crackatown

How would I do that? And would that only work if I had one forum?

crackatown

I have decided to just use one forum, I spoke with everyone else and we will make that work.

How would I call the SSI_login function in a different login page that isn't the forum?

texasman1979

put the login page inside the forum directory.
SMF 2.0.4
SimplePortal 2.3.5

LOGIC is a FOUR letter word! :)


fwitt

Quote from: crackatown on May 04, 2011, 12:55:46 AM
I have decided to just use one forum, I spoke with everyone else and we will make that work.

How would I call the SSI_login function in a different login page that isn't the forum?

have a look at ssi_examples.php both the one in your own forum http://www.yoursite.com/forum/ssi_examples.php which will give you info specific to your own forum and the one on this site http://www.simplemachines.org/community/ssi_examples.php

crackatown


crackatown

#36
What if I want to change where ssi_login(); takes me after I log in?

Also, will adding another column/table (for access level on my main site) cause a problem with the forum?

texasman1979

If you follow the function login, you will find where the redirect is and you can change it, and to the second question, there should be no issue with adding security to ur main site as long as it is done correctly. Will cause no change in the forum.
SMF 2.0.4
SimplePortal 2.3.5

LOGIC is a FOUR letter word! :)


crackatown

#38
Will the connection to mysql remain open? Along with user data and variables on my page? Or is there some special code needed to make that work?

EDIT: Actually you can just do this, I found it out just now. For the redirect that is.
ssi_login($redirect_to = 'http://www.yoururl.com', $output_method = 'echo');

crackatown

I need a way to call at least the username that they submit or the one stored in smf. I need that to reference my access level that isn't an smf function. Once I have that info I can then store it to a cookie.

I want to use the username to pull the access level from the database. Will I need to have a connection script as well?

Advertisement: