Customizing SMF > Bridges and Integrations

Re: How do I log into SMF from my application?

(1/2) > >>

cache:
So glad you started this thread, OP. I've been hunting high and low for what I thought would be easy, discovering semi-helpful snippets along the way, but no definitive answer. It may be there somewhere, but it's the old classic "if you don't know how to specify exactly what you're searching for, it's easy to miss it".

BTW I hope I haven't offended anyone by that opening para. I'm not blaming anyone for the data being hard to find.

My hope is to be able to keep the login and logout within my own pages, so a user can login - to both my SMF forum and my non-SMF pages - but without being confronted by the SMF boards page, which is normally what a successful login redirects to if I use ssi_login().

I haven't got very far, but so far my thoughts are:
it should be possible to script a form to collect and POST the username/pwd credentials, but not sure how to deal with the hidden field;
I'll need my script to eat the entire HTML returned after a successful login, and replace it with my own.

It would be nice to think that this could be done nice and transparently with a bit of Ajax.

Do I seem to be on the right lines? Is there something I've missed which does this already?

cache:

--- Quote from: Kindred on April 12, 2021, 08:41:24 AM ---function ssi_login($redirect_to = '', $output_method = 'echo')

--- End quote ---

Ah yes, that's a major step forward (which I should have spotted), so thank you for pointing me to it.

Not a complete solution. I really want to redirect members back to the page they were on when they discovered a need to log in, not a separate standard page from which they'll have to renavigate their own way back. Which is why the ajax idea is so appealing.

Kindred:
you can redirect back to the previous page.

In the code, record the page that they are on into a variable
then call ssi_login using the recorded variable as the argument.

cache:

--- Quote from: Kindred on April 12, 2021, 10:24:11 AM ---you can redirect back to the previous page.

--- End quote ---
Er, yes, that would work. Thanks again.

At the risk of sounding churlish my real problem is having to use the table layout provided with ssi_login(), when I want a nice inline username/password form like the SMF site has at the top. If CSS can force table rows into a single line I'm not aware of it.

CoderLanie, didn't really understand your last post. Are you needing to double authenticate (with SMF and your own website)?

Aleksi "Lex" Kilpinen:

--- Quote from: cache on April 12, 2021, 02:16:03 PM ---
--- Quote from: Kindred on April 12, 2021, 10:24:11 AM ---you can redirect back to the previous page.

--- End quote ---
Er, yes, that would work. Thanks again.

At the risk of sounding churlish my real problem is having to use the table layout provided with ssi_login(), when I want a nice inline username/password form like the SMF site has at the top. If CSS can force table rows into a single line I'm not aware of it.

--- End quote ---
It would be better if you opened your own topic if you wish to continue. We try to keep separate issues separate, makes topics easier to follow for everyone.

Navigation

[0] Message Index

[#] Next page

Go to full version