Isn't registered web

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Locked
adeptik
Posts: 52
Joined: Mon Dec 27, 2010 11:16 pm

Isn't registered web

Post by adeptik »

Isn't registered

http://anstar.net/l2dw/index.php?f=register

# ---------------------------------------------------------------------------
# Misc.
# ---------------------------------------------------------------------------
# If False, the license (after the login) will not be shown.
# Default: True
ShowLicence = True

# Default: True
AutoCreateAccounts = False


plz help
User avatar
LasTravel
Posts: 888
Joined: Tue Jan 05, 2010 12:08 am
Location: Spain

Re: Isn't registered web

Post by LasTravel »

:?: :shock:
User avatar
qwerty13
Posts: 640
Joined: Mon Feb 02, 2009 9:57 am
Location: Europe
Contact:

Re: Isn't registered web

Post by qwerty13 »

I guess he cant register an account via website. Check your registration scripts.
adeptik
Posts: 52
Joined: Mon Dec 27, 2010 11:16 pm

Re: Isn't registered web

Post by adeptik »

I press on the button to register the user in the answer an error of databases
User avatar
qwerty13
Posts: 640
Joined: Mon Feb 02, 2009 9:57 am
Location: Europe
Contact:

Re: Isn't registered web

Post by qwerty13 »

Check your registration scripts on website.
User avatar
LasTravel
Posts: 888
Joined: Tue Jan 05, 2010 12:08 am
Location: Spain

Re: Isn't registered web

Post by LasTravel »

adeptik
Posts: 52
Joined: Mon Dec 27, 2010 11:16 pm

Re: Isn't registered web

Post by adeptik »

Erorr MySQL!
========================

MySQL Error:
Unknown column 'l2email' in 'where clause'

Error number:
1054


SELECT * FROM accounts WHERE l2email='[email protected]' LIMIT 1


she is mine register.php
<?php
/**
* STRESS WEB
* @author Alexandr Yuschenko (S.T.R.E.S.S.)
* @copyright 2008 - 2010 STRESS WEB
* @version 10
* @web http://stressweb.ru
*/
if (!defined("STRESSWEB"))
die("Hacking!!!");
if ($l2cfg["reg"]["enable"])
{
$_do = (isset($_REQUEST["do"]) && $_REQUEST["do"] == "activate") ? "activate" : "reg";
require_once (INC_DIR . '/classes/class.phpmailer.php');
/**************************
* Account Activation
**************************/
if ($_do == "activate")
{
$_hash = (isset($_REQUEST["hash"])) ? strtolower($user->SafeData($_REQUEST["hash"], 3)) : "";
if (!empty($_hash) && strlen($_hash) == 25 && ereg("([a-z0-9]{25})", $_hash))
{
$_hash = $db->Safe($_hash);
$sel_hash = $db->Query("SELECT `login`,`password`,`question`,`answer`,`email`,`hash` FROM `stress_users_tmp` WHERE `hash`='{$_hash}'");
if ($db->NumRows($sel_hash) == 1)
{
$sql_data = $db->FetchArray($sel_hash);
$check_accounts = $ldb[$lid]->Query("SELECT * FROM `accounts` WHERE `login`='{$sql_data["login"]}'");
if ($ldb[$lid]->NumRows($check_accounts) == 0)
{
$ldb[$lid]->SuperQuery($qList[$vls]["insAccount"], array("login" => $sql_data["login"], "pass" => $sql_data["password"], "l2question" => $sql_data["question"], "l2answer" => $sql_data["answer"], "l2email" => $sql_data["email"]));
if ($ldb[$lid]->affectedrows() > 0)
{
$db->Query("DELETE FROM `stress_users_tmp` WHERE `hash`='{$_hash}'");
$tpl->result["content"] = "<div class='noerror'>{$lang["validate_err_1"]}</div>";
}
else
{
$tpl->result["content"] = "<div class='error'>{$lang["err_db"]}</div>";
}
}
else
{
$db->Query("DELETE FROM `stress_users_tmp` WHERE `hash`='{$_hash}'");
$tpl->result["content"] = "<div class='error'>{$lang["validate_err_2"]}</div>";
}
}
else
{
$tpl->result["content"] = "<div class='error'>{$lang["validate_err_3"]}</div>";
}
}
else
{
$tpl->result["content"] = "incorrect";
}
}
/**************************
* Account Registration
**************************/
if ($_do == "reg")
{
if (isset($_POST["register"]) && $_POST["register"])
{
if ($l2cfg["captcha"]["reg"])
{
$_l2code_post = strtoupper($_POST["l2sec_code"]);
$_l2code_sess = $_SESSION["seccode"];
}
else
{
$_l2code_post = 1;
$_l2code_sess = 1;
}
$_l2login = $ldb[$lid]->Safe(htmlspecialchars(trim($_POST["l2account"])));
$_l2pass1 = $ldb[$lid]->Safe($_POST["l2password1"]);
$_l2pass2 = $ldb[$lid]->Safe($_POST["l2password2"]);
$_l2question = $ldb[$lid]->Safe($_POST["l2question"]);
$_l2answer = $ldb[$lid]->Safe($_POST["l2answer"]);
$_l2email = $ldb[$lid]->Safe($_POST["l2email"]);
if (empty($_l2login) || empty($_l2pass1) || empty($_l2pass2) || empty($_l2question) || empty($_l2answer) || empty($_l2email))
$user->errorMsg($lang["error"], $lang["reg_err_1"]);
elseif (!$_l2code_sess or $_l2code_post != $_l2code_sess)
$user->errorMsg($lang["error"], $lang["err_code"]);
elseif ($_l2pass1 != $_l2pass2)
$user->errorMsg($lang["error"], $lang["reg_err_2"]);
elseif (strlen($_l2login) < 4 || strlen($_l2login) > 14)
$user->errorMsg($lang["error"], $lang["reg_err_3_1"]);
elseif (strlen($_l2pass1) < 4 || strlen($_l2pass1) > 16)
$user->errorMsg($lang["error"], $lang["reg_err_3_2"]);
elseif (preg_match("/[\||\'|\<|\>|\[|\]|\"|\!|\?|\$|\@|\/|\\\|\&\~\*\{\+]/", $_l2login))
$user->errorMsg($lang["error"], $lang["reg_err_4"]);
elseif (strlen($_l2question) < 4 || strlen($_l2answer) < 4 || strlen($_l2question) > 64 || strlen($_l2answer) > 64)
$user->errorMsg($lang["error"], $lang["reg_err_5"]);
elseif (!$user->CheckEmail($_l2email))
$user->errorMsg($lang["error"], $lang["err_mail"]);
elseif ($ldb[$lid]->NumRows($ldb[$lid]->Query("SELECT * FROM accounts WHERE login='{$_l2login}' LIMIT 1")) || $db->NumRows($db->Query("SELECT * FROM stress_users_tmp WHERE login='{$_l2login}' LIMIT 1")))
$user->errorMsg($lang["error"], $lang["reg_err_6"]);
elseif (!$l2cfg["reg"]["multi"] && ($ldb[$lid]->NumRows($ldb[$lid]->Query("SELECT * FROM accounts WHERE l2email='{$_l2email}' LIMIT 1")) || $db->NumRows($db->Query("SELECT * FROM stress_users_tmp WHERE email='{$_l2email}' LIMIT 1"))))
$user->errorMsg($lang["error"], $lang["reg_err_7"]);
else
{
$_login = strtolower($_l2login);
$_pass = $user->PassEncode($ldb[$lid]->Safe($_l2pass1));
if (!$l2cfg["reg"]["method"])
{
$ldb[$lid]->SuperQuery($qList[$vls]["insAccount"], array("login" => $_login, "pass" => $_pass, "l2question" => $_l2question, "l2answer" => $_l2answer, "l2email" => $_l2email));
if ($ldb[$lid]->AffectedRows() == 1)
$user->errorMsg($lang["message"], $lang["reg_err_8"], "no");
else
$user->errorMsg($lang["error"], $lang["err_db"]);
}
else
{
$hash = $user->GenCode(25);
$db->Query("INSERT INTO `stress_users_tmp` (`login`,`password`,`question`,`answer`,`email`,`hash`) VALUES ('$_login', '$_pass', '$_l2question', '$_l2answer', '$_l2email', '$hash')");
$home_url = explode("index.php", strtolower($_SERVER['PHP_SELF']));
$home_url = reset($home_url);
$_host = $_SERVER['HTTP_HOST'] ? $_SERVER['HTTP_HOST'] : @getenv('HTTP_HOST');
$_host = $_host . $home_url;
$mail_subject = $lang["reg_err_11"];
$tpl->GetTemplate("email_register.tpl");
$tpl->SetVar('{login}', $_login);
$tpl->SetVar('{password}', $_l2pass1);
$tpl->SetVar('{host}', $_host);
$tpl->SetVar('{sid}', $sid);
$tpl->SetVar('{hash}', $hash);
$tpl->SetVar("{THEME}", TPL_DIR);
$tpl->parse("mail_message");
$mail_message = $tpl->result["mail_message"];
$tpl->clear();
if ($db->AffectedRows() == 1)
{
if ($l2cfg["mail"]["method"] == "mail")
{
$mail = $user->SendMail($_l2email, $_login, "{$l2cfg["reg"]["email"]}", $mail_subject, $mail_message);
if ($mail)
$user->errorMsg($lang["message"], $lang["reg_err_9"], "no");
else
$user->errorMsg($lang["error"], $lang["reg_err_10"]);
}
else
{
$mail = new PHPMailer(true);
$mail->IsSMTP();
try
{
$mail->CharSet = "{$l2cfg["mail"]["smtp"]["charset"]}";
$mail->SMTPAuth = $l2cfg["mail"]["smtp"]["auth"];
$mail->SMTPSecure = "{$l2cfg["mail"]["smtp"]["secure"]}";
$mail->Host = "{$l2cfg["mail"]["smtp"]["host"]}";
$mail->Port = $l2cfg["mail"]["smtp"]["port"];
$mail->Username = "{$l2cfg["mail"]["smtp"]["user"]}";
$mail->Password = "{$l2cfg["mail"]["smtp"]["pass"]}";
$mail->AddReplyTo("{$l2cfg["mail"]["smtp"]["mail"]}", "{$l2cfg["mail"]["smtp"]["name"]}");
$mail->AddAddress("{$_l2email}", "{$_login}");
$mail->SetFrom("{$l2cfg["mail"]["smtp"]["mail"]}", "{$l2cfg["mail"]["smtp"]["name"]}");
$mail->Subject = "{$mail_subject}";
$mail->MsgHTML("{$mail_message}");
$mail->Send();
$user->errorMsg($lang["message"], $lang["reg_err_9"], "no");
}
catch (phpmailerException$e)
{
$user->errorMsg($lang["error"], $e->errorMessage());
}
catch (exception $e)
{
$user->errorMsg($lang["error"], $e->getMessage());
}
}
}
else
$user->errorMsg($lang["error"], $lang["err_db"]);
}
}
}
$tpl->GetTemplate("register.tpl");
if ($l2cfg["captcha"]["reg"])
{
$tpl->template = '<script type="text/javascript">//<![CDATA[
function reload () {
var rndval = new Date().getTime();
document.getElementById(\'sw-captcha\').innerHTML = \'<img src="inc/captcha/antibot.php?rndval=\' + rndval + \'" border="0">\';
};
//]]></script>' . $tpl->template;
$tpl->SetBlock("'\\[captcha\\](.*?)\\[/captcha\\]'si", "\\1");
$tpl->SetVar('{l2sec_code}', "<div id=\"sw-captcha\" class='captcha'><img src=\"inc/captcha/antibot.php\" alt=\"Код безопасности\" border=\"0\" /></div><a onclick=\"reload(); return false;\" href=\"#\">{$lang["reload"]}</a>");
}
else
{
$tpl->SetVar('{l2sec_code}', "");
$tpl->SetBlock("'\\[captcha\\](.*?)\\[/captcha\\]'si", "");
}
if ($l2cfg["ls"]["count"] > 1)
{
$l2servers = "";
for ($i = 0; $i < $l2cfg["gs"]["count"]; $i++)
{
if ($l2cfg["gs"][$i]["on"])
{
$l2servers .= "<option value='{$i}'>{$l2cfg["gs"][$i]["title"]}</option>";
}
}
$tpl->SetBlock("'\\[servers\\](.*?)\\[/servers\\]'si", "\\1");
$tpl->SetVar("{servers}", $l2servers);
}
else
$tpl->SetBlock("'\\[servers\\](.*?)\\[/servers\\]'si", "");
$tpl->SetVar("{THEME}", TPL_DIR);
$tpl->parse("content");
$tpl->clear();
}
}
else
$tpl->result["content"] = "<div class='error'>{$lang["reg_err_0"]}</div>";
?>

The script can isn't true? Who can to look at that?
User avatar
MELERIX
L2j Veteran
L2j Veteran
Posts: 6667
Joined: Sat Sep 23, 2006 11:31 pm
Location: Chile
Contact:

Re: Isn't registered web

Post by MELERIX »

better use this: viewtopic.php?f=94&t=10729

and btw I'll close this topic, due this is not related with server.
Locked