The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
need some help. Register.php
Currently i am trying to connect my registration for my Maplestory Server, to my forums.
I've successfully connected the database for the server and the forums together (to allow you to register on the forums and make it your game id as well) however when they register , the password is sent as an empty string , so when i try to login there is technically no 'password' to login with which is why i cannot login. i've noticed that Code:
$vbulletin->GPC['passwordconfirm'] OR (strlen($vbulletin->GPC['password_md5']) Does anyone have a solution as to why it's ending up as a empty string? Better yet does anyone have a solution for me to fix it Here is my register.php |
#2
|
|||
|
|||
I'm not sure I follow everything you're saying. But my understanding of the code you posted above is that it allows the password to be sent from the browser to the server either as plain text or encrypted with md5 in case the browser doesn't have javascript enabled. So I think the raw password is blank because it isn't sent if the browser has js enabled and is able to encrypt it (because obviously that would defeat the entire purpose of encrypting it).
|
#3
|
|||
|
|||
What the script is ,is basically you registering for both the GameServer, and the Forums at the same time (thus both being linked together) .
and do you think you could explain this whole javascript thing to me? |
#4
|
||||
|
||||
I had to remove the file from your first post. You may not repost a vbulletin file. You may only post the changes you made to the file.
|
#5
|
|||
|
|||
My apologies.
Under Code:
$userdata->set('ipaddress', IPADDRESS); Code:
/* MapleStory Registration Start */ $conn = mysql_connect('localhost', 'root', 'passwordhere') or die("An Error Has Occured - Please Contact An Administrator (REF#MC-)"); mysql_select_db('dbnamehere', $conn) or die("An Error Has Occured - Please Contact An Administrator (REF#MCDB)"); ## Variabless (not really needed :P) $IANname = $vbulletin->GPC['username']; $IANpassword = sha1($vbulletin->GPC['password']); $IANdob = $vbulletin->GPC['year'].'-'.$vbulletin->GPC['year'].'-'.$vbulletin->GPC['year']; $IANemail = $vbulletin->GPC['email']; ## Username Check. function checkUsername($++++++ry, $obj) { $query = sprintf(" SELECT COUNT('id') FROM accounts WHERE name = '%s'", $++++++ry); $result = mysql_query($query, $obj); $total = mysql_result($result, 0); return $total; } if (checkUsername($IANname, $conn) > 0) { $userdata->error('usernametaken', $vbulletin->GPC['username']); // Reusing vBulletin's Error :P ? } /* MapleStory Reg End */ Code:
$show['errors'] = false; Code:
/* Save MapleStory Data */ $query = sprintf(" INSERT INTO accounts (name, password, birthday, email, lastknownip) VALUES ('%s', '%s', '%s', '%s', '%s')", $IANname, $IANpassword, $IANdob, $IANemail, IPADDRESS); if (!mysql_query($query, $conn)) { die ('Stuff Hpapens: '.mysql_error()); } mysql_close($conn); /* End Data Here */ In Ajax.php under Code:
$userdata->set('username', $vbulletin->GPC['username']); Code:
/* MapleStory #2 */ $conn = mysql_connect('localhost', 'root', 'passwordhere') or die("An Error Has Occured - Please Contact An Administrator (REF#MC-)"); mysql_select_db('dbnamehere', $conn) or die("An Error Has Occured - Please Contact An Administrator (REF#MCDB)"); ## username check. function checkUsername($++++++ry, $obj) { $query = sprintf(" SELECT COUNT('id') FROM accounts WHERE name = '%s'", $++++++ry); $result = mysql_query($query, $obj); $total = mysql_result($result, 0); return $total; } if (checkUsername($vbulletin->GPC['username'], $conn) > 0) { $userdata->error('usernametaken', $vbulletin->GPC['username']); // Reusing vBulletin's Error :P ? } mysql_close($conn); /* MapleStory Ends... Again */ Basically, what it is , it registers for both the forums, and my gameserver. In this case i connected the forums with the gameserver and i'm trying to make it so that registering for the forums will also register for the gameserver. However, when i register right now the password is sent as an empty string and is blank thus not allowing me to login to the gameserver. That is what i need help with |
#6
|
|||
|
|||
What I was trying to say is that the password isn't sent as plain text if the browser can encrypt it, that's why the password field is blank. But in any case, it turns out you're not the first one to have this issue - there's a value you can define that should stop the password field from being cleared. Try adding this to the top of your register.php:
Code:
define('DISABLE_PASSWORD_CLEARING', true); |
Благодарность от: | ||
Lynne |
#7
|
|||
|
|||
On top as in under <?php> Correct?
|
#8
|
|||
|
|||
Yes, it probably doesn't matter too much where it is exactly, but I think I'd put it somewhere before any include or require lines.
|
#9
|
|||
|
|||
It worked! THANKS ALOT!
|
#10
|
|||
|
|||
Cool. By the way, someone else was trying to do the same thing and found out that the config.php file is a good place to put the define statement, if you don't want to edit the other vb files.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|