MyBB Community Forums

Full Version: League Software
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello,

I am using a league software website. I also am using MyBB as a forums. I want to hook up the users from the league site over to MyBB (so they don't have to keep making new accounts etc etc etc...)

Can any one give me some in-tell on this?
Currently I am working on the league registration page, trying to make it to add the user name, password, and e-mail address to MyBB but I keep getting an error - It makes the account on the League side but not on the MyBB side since the error is with that.

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''username', 'password', 'email', 'regip', ) VALUES ( 'TestMon',' at line 2

Code`
$stored_pass = md5(md5($salt).md5($pass2));
mysql_query("INSERT INTO mybb_users (
'username',
'password',
'email',
'regip', )
VALUES
( '$member[name]',
'$pass2',
'$member[email]',
'$user_ip' )")or die (mysql_error());

$lastbbid=mysql_insert_id();
150 views but no help.
You obviously have an extra comma (,): 'regip',).
(2014-04-15, 07:49 PM)laie_techie Wrote: [ -> ]You obviously have an extra comma (,): 'regip',).

I removed it, still not working.

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''username', 'password', 'email', 'regip' ) VALUES ( 'TestMonkey' at line 2

I fix it....

mysql_query("INSERT INTO mybb_users (username, password, salt, email) VALUES ('$member[name]', '$pass2', '".filter($enurl)."', '$member[email]')")or die (mysql_error());


Now the issue is, can't login with the user information. Some help would be nice. I'm using md5 encoding....
(2014-04-15, 09:50 PM)LaocheXe Wrote: [ -> ]Now the issue is, can't login with the user information. Some help would be nice. I'm using md5 encoding....

(2013-09-16, 12:34 PM)Shade Wrote: [ -> ]Also, MyBB stores password without encryption, passwords are hashed using the md5 digest algorithm. The formula looks like this:

$hashedpsw = md5(md5($salt).md5($plainpassword));
/* $salt = random 8-chars long string
 * $plainpassword = the password in plain text
 * $hashedpsw = the hashed password
 */
(2014-04-16, 04:32 PM)laie_techie Wrote: [ -> ]
(2013-09-16, 12:34 PM)Shade Wrote: [ -> ]Also, MyBB stores password without encryption, passwords are hashed using the md5 digest algorithm. The formula looks like this:

$hashedpsw = md5(md5($salt).md5($plainpassword));
/* $salt = random 8-chars long string
 * $plainpassword = the password in plain text
 * $hashedpsw = the hashed password
 */

So like this -
$hashedpsw = md5(md5($salt).md5($plainpassword));

mysql_query("INSERT INTO mybb_users (username, password, salt, email) VALUES ('$member[name]', '$plainpassword', '$salt', '$member[email]')")



I take it instead of the plainpassword I need to use the hashedpw?

Still doesn't want to work for me.... Any help would be nice, how would you make it?
In your original post, it seems like $pass2 has your non-hashed password. You plug that into the hashing algorithm, then insert the hashed password into the database table. You may also need to supply additional fields (such as user group and display group).
(2014-04-17, 10:45 PM)laie_techie Wrote: [ -> ]In your original post, it seems like $pass2 has your non-hashed password. You plug that into the hashing algorithm, then insert the hashed password into the database table. You may also need to supply additional fields (such as user group and display group).

So

$hashedpsw = md5(md5($salt).md5($pass));

Am I correct on that? (sorry but not so good when it comes to hashing)
I think you've got it.
Pages: 1 2