Welcome, Guest. Please login or register.
Did you miss your activation email?
February 12, 2012, 05:50:01 PM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
149667 Posts in 21100 Topics by 7538 Members
Latest Member: ionline
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: A first approach to having WB and SMF (forum) users integrated.  (Read 1063 times)
ja

Offline Offline

Posts: 24



WWW
« on: March 28, 2008, 10:56:17 AM »

Hi!
I modified the code of one SMF file in order to get the visitors that register in the forum registered in the WB database. Therefore they can login in the WB site and add comments to news or whatever.

I use WB 2.6.7 and SMF 1.1.4 and they are in the same database with different prefix in order to access easily from SMF code to WB tables. I only modified Register.php, in the Source folder of SMF, including this simple code after line 304:

Code:
/*************************************/
// User to WB users database
    $md5_password = md5($regOptions['password']);

    db_query("
        INSERT INTO wb_users (group_id,active,username,password,display_name,email)
        VALUES ('3', '1','".($regOptions['username'])."', '".$md5_password."','".($regOptions['username']).    "','".($regOptions['email'])."')");
/**************************************/

Notice that my WB prefix is "wb_" and group 3 is a group I defined in WB admin interface.

You can test this in my website (it's in Spanish, but it isn't difficult to try).
  • Go to forum and click "regístrate" (rigth top corner)
  • Register, including name, email, password, repeat password, and agree. Now you are registered in both SMF and WB, but only logged in SMF.
  • Go to WB login and insert your name and password. Now you are logged in WB system.
  • Go to my news section and add a comment ("Añadir comentario") in a post (this for example) to see that you are really logged (your name appears in the comment)

There are some drawbacks:
  • Login is independient from WB to SMF, you have to log in both system.
  • In the registering proccess the only validations (user repeated, valid email, password length,...) are these of the SMF, not the WB ones.
  • More?

I don't know have to solve these issues, cause loggin simultaneuosly in both is more difficult than register. undecided

That's all. What do you think? Could it be useful?

« Last Edit: March 28, 2008, 11:01:37 AM by ja » Logged

>> ja's web - Spanish Website Baker site - Sitio en español de Website Baker <<
>> CuatroG.es - Next Gen Mobile Technology Web- Sitio de Cuarta Generación de móviles <<
darko

Offline Offline

Posts: 3


« Reply #1 on: March 29, 2008, 12:33:32 PM »

Yes! It may be quite useful for many people who want to integrate SMF in their web.

Now I encourage you to keep on working and try to solve these problems  wink
Logged
ja

Offline Offline

Posts: 24



WWW
« Reply #2 on: March 31, 2008, 07:22:03 PM »

Thank you for you reply cheesy
 I will keep on working and will show you here when I have something more.
Logged

>> ja's web - Spanish Website Baker site - Sitio en español de Website Baker <<
>> CuatroG.es - Next Gen Mobile Technology Web- Sitio de Cuarta Generación de móviles <<
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!