Jump to content

Archived

This topic is now archived and is closed to further replies.

atholon

SMF Login?

Recommended Posts

Anyone know of a good mod that allows external logins like integrating the SMF login with a main site? I have one that we made for Invision but I am not sure I want to hunt through all of the SMF code if their's already a script that does what I need.

Share this post


Link to post
Share on other sites

I wrote something myself when writing the login system for the main site here which uses our SMF database.

 

You can do something like this:

SELECT passwd, is_activated FROM smf_members WHERE memberName = *username_here*;

 

Then you can check if the password matches and if the user is activated (after checking that the user exists of course):

if ($user['is_activated'] != 1) {
    // user is not activated
}
else if (sha1(strtolower($username) . $password) != $user['passwd']) {
    // password doesn't match
}
else {
    // everything is fine
}

Share this post


Link to post
Share on other sites

I wrote something myself when writing the login system for the main site here which uses our SMF database.

 

You can do something like this:

SELECT passwd, is_activated FROM smf_members WHERE memberName = *username_here*;

 

Then you can check if the password matches and if the user is activated (after checking that the user exists of course):

if ($user['is_activated'] != 1) {
    // user is not activated
}
else if (sha1(strtolower($username) . $password) != $user['passwd']) {
    // password doesn't match
}
else {
    // everything is fine
}

 

 

 

Hay.... may I know what the purpose for * at your code memberName = *username_here*

Share this post


Link to post
Share on other sites

You need to find the correct user. Seeing as login forms usually use the username as mean of identification you would do WHERE memberName = ?

Share this post


Link to post
Share on other sites

I don't like SMF's SSI.php. I think it's poorly written, it clutters up the global namespace and it messes with the superglobals. In other words, you cannot implement it in your site, your have to implement your site in that. If you decide to move away from SMF at one point and you've based your site around SSI.php then you're screwed.

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.