News:

Wondering if this will always be free?  See why free is better.

Main Menu

How do I log into SMF from my application?

Started by CoderLanie, April 08, 2021, 08:32:32 PM

Previous topic - Next topic

CoderLanie

If someone asks, "Is 1111 Ave Street where the library is?" would you answer, "No" or would you answer, "No, it's at 2123 Boulevard"?

Saying "no" is technically helpful, but how does that help the person searching for the library? All it does it makes them have to search for a new address instead of heading towards the direction. Even a "No, but it's on that boulevard somewhere" would have been more helpful than just simply telling me a file is outdated.

I did not ask "why doesn't this work?" I already know. It's deprecated functions. I asked if I could still use the file without it and update it as necessary.
Simply telling me it's outdated and simply telling me there are no updates doesn't help me solve any problems.

The answers are vague in a way that they don't tell me which direction to go.

My apologies if "vague" is used incorrectly but it took way too much effort to be pointed in a reliable direction.

Kindred

Except, if we follow your analogy in this case, the answer was "no. The library closed and they did not open another one"
(Which was the full and complete answer)

Just because you did not like that answer, does not change anything.
you kept asking the same question in the hopes of getting a different answer, but kept getting the same answer - because the answer was full and accurate,  as much as could be, given the facts.


Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

CoderLanie

Fair enough, but I would also answer as "No, the library closed.. but there's a book store at.." Maybe I just answer things different.. I dunno, but I'll consider this experience a lesson learned.

m4z

The replies weren't vague, but missing context that somebody new to SMF wouldn't know: The API was a contribution by somebody outside of the SMF team, so "the API wasn't updated" means "this is the most recent version there is; nothing more recent exists, and if that person (or another volunteer) doesn't update it, you're out of luck". Also, since it is not part of the software and so outdated, probably nobody knows the code.

You said from the start you had problems with it, but didn't explain specifics, so probably nobody here was motivated enough to try it out for themselves. (If you don't invest the effort to even explain, in detail, where or what your problems are, why would I read that other thread, build a test forum and try to get the API to work myself? If I ran into problems, I wouldn't even know if those are the same problems that you're having.)
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

CoderLanie

Alright. Let me reask the question with a more open mind and a little bit more experience.

How do I set the credentials for the forum using my own custom website login?

I looked at the ssi_login() feature. That allows the forums login into be on my website but not what I'm looking for. I want to submit my information (userid/email, password) and then pass it through SMF's login stuff and get them logged in.

I am okay setting the credentials (which from my naive understanding: that means setting the cookies for the forum) from my login, but not sure exactly what they are.

I was considering having my login form -> on submit, would go to form page -> the ssi_login() would be altered so it's auto filled out by the information submitted -> javascript to submit it automatically. As someone who is new (and struggles with javascript), do you think this is reasonable?

I am not looking for someone to make the code, I just need the logic behind it.

Kindred

cache:

if you want to use SMF's permissions system and login, you can use ssi_login with a target page on completion, instead of the default of the boardindex

function ssi_login($redirect_to = '', $output_method = 'echo')

CoderLanie:
As noted, there is no currently functional API between external pages to pass the login info through to SMF.   The API and bridges previously designed will not work on current php versions.
That being said, I *THINK* someone made a WordPress bridge with SMF which *MIGHT* be a place to start looking...    but IIRC, that bridge goes the other way (using SMF's login in WordPress, not the WordPress login passed to SMF)



And no. You do NOT want a javascript like that...   that's a potentially HUGE security hole.
You would want to pass through the login info directly in database/php -- probably using the Hooks system, since, IIRC, there IS a pass-through hook somewhere in the login process... I just don't remember where it is or what parameters it takes.

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Ninja ZX-10RR

There's both bridges in fact, but that's a good idea, so I'll expand upon that and link you to the "reversed" bridge: https://github.com/xchwarze/WP2SMFBridge
And yes it should work with current versions.
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.

♥ Jess ♥

STOP EDITING MY PROFILE

CoderLanie

Unfortunately, I coded my website from scratch and didn't use any Word Press or anything like that so the github link won't help me out.


Alright, I really don't want to code my entire forum so I will have to use the SMF login. I am okay with this; but where in the file do I set the credentials? I don't want to set my cookies all willy nilly anywhere.


Wait.. this also means I have to adjust the registration and everything.. ugh..

Kindred

coderlanie...


no, you missed my point.    LOOK at how it was done in the WP bridge, then use THAT as a baseline for how it COULD BE done for your site with some tweaks.

However... as I also said... there are HOOKS for registration and login which allow the hook of additional functions (to run additional actions IN the SMF functions...like cookie setting...    or possibly to accept a un/pw combination...)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."


Advertisement: