mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 12:07:23 +08:00
fix signup 500 when close register
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.3');
|
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.3');
|
||||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-05-12');
|
defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-05-13');
|
||||||
defined('IN_TRACKER') || define('IN_TRACKER', false);
|
defined('IN_TRACKER') || define('IN_TRACKER', false);
|
||||||
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
||||||
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
||||||
|
|||||||
@@ -1610,7 +1610,7 @@ function failedloginscheck ($type = 'Login') {
|
|||||||
list($total) = mysql_fetch_array($Query);
|
list($total) = mysql_fetch_array($Query);
|
||||||
if ($total >= $maxloginattempts) {
|
if ($total >= $maxloginattempts) {
|
||||||
sql_query("UPDATE loginattempts SET banned = 'yes' WHERE ip=$ip") or sqlerr(__FILE__, __LINE__);
|
sql_query("UPDATE loginattempts SET banned = 'yes' WHERE ip=$ip") or sqlerr(__FILE__, __LINE__);
|
||||||
stderr($type.$lang_functions['std_locked'].$type.$lang_functions['std_attempts_reached'], $lang_functions['std_your_ip_banned']);
|
stderr($type.$lang_functions['std_locked'].$type.$lang_functions['std_attempts_reached'], $lang_functions['std_your_ip_banned'], true, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function failedlogins ($type = 'login', $recover = false, $head = true)
|
function failedlogins ($type = 'login', $recover = false, $head = true)
|
||||||
@@ -1678,13 +1678,13 @@ function registration_check($type = "invitesystem", $maxuserscheck = true, $ipch
|
|||||||
global $invitesystem, $registration, $maxusers, $SITENAME, $maxip;
|
global $invitesystem, $registration, $maxusers, $SITENAME, $maxip;
|
||||||
if ($type == "invitesystem") {
|
if ($type == "invitesystem") {
|
||||||
if ($invitesystem == "no") {
|
if ($invitesystem == "no") {
|
||||||
stderr($lang_functions['std_oops'], $lang_functions['std_invite_system_disabled'], 0, false);
|
stderr($lang_functions['std_oops'], $lang_functions['std_invite_system_disabled'], 0, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($type == "normal") {
|
if ($type == "normal") {
|
||||||
if ($registration == "no") {
|
if ($registration == "no") {
|
||||||
stderr($lang_functions['std_sorry'], $lang_functions['std_open_registration_disabled'], 0, false);
|
stderr($lang_functions['std_sorry'], $lang_functions['std_open_registration_disabled'], 0, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1692,14 +1692,14 @@ function registration_check($type = "invitesystem", $maxuserscheck = true, $ipch
|
|||||||
$res = sql_query("SELECT COUNT(*) FROM users") or sqlerr(__FILE__, __LINE__);
|
$res = sql_query("SELECT COUNT(*) FROM users") or sqlerr(__FILE__, __LINE__);
|
||||||
$arr = mysql_fetch_row($res);
|
$arr = mysql_fetch_row($res);
|
||||||
if ($arr[0] >= $maxusers)
|
if ($arr[0] >= $maxusers)
|
||||||
stderr($lang_functions['std_sorry'], $lang_functions['std_account_limit_reached'], 0, false);
|
stderr($lang_functions['std_sorry'], $lang_functions['std_account_limit_reached'], 0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ipcheck) {
|
if ($ipcheck) {
|
||||||
$ip = getip () ;
|
$ip = getip () ;
|
||||||
$a = (@mysql_fetch_row(@sql_query("select count(*) from users where ip='" . mysql_real_escape_string($ip) . "'"))) or sqlerr(__FILE__, __LINE__);
|
$a = (@mysql_fetch_row(@sql_query("select count(*) from users where ip='" . mysql_real_escape_string($ip) . "'"))) or sqlerr(__FILE__, __LINE__);
|
||||||
if ($a[0] > $maxip)
|
if ($a[0] > $maxip)
|
||||||
stderr($lang_functions['std_sorry'], $lang_functions['std_the_ip']."<b>" . htmlspecialchars($ip) ."</b>". $lang_functions['std_used_many_times'],false, false);
|
stderr($lang_functions['std_sorry'], $lang_functions['std_the_ip']."<b>" . htmlspecialchars($ip) ."</b>". $lang_functions['std_used_many_times'],false, true);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -2912,7 +2912,7 @@ function stdfoot() {
|
|||||||
global $hook;
|
global $hook;
|
||||||
print("</td></tr></table>");
|
print("</td></tr></table>");
|
||||||
print("<div id=\"footer\">");
|
print("<div id=\"footer\">");
|
||||||
if ($Advertisement->enable_ad()){
|
if ($Advertisement && $Advertisement->enable_ad()){
|
||||||
$footerad=$Advertisement->get_ad('footer');
|
$footerad=$Advertisement->get_ad('footer');
|
||||||
if ($footerad)
|
if ($footerad)
|
||||||
echo "<div align=\"center\" style=\"margin-top: 10px\" id=\"\">".$footerad[0]."</div>";
|
echo "<div align=\"center\" style=\"margin-top: 10px\" id=\"\">".$footerad[0]."</div>";
|
||||||
|
|||||||
+4
-1
@@ -23,7 +23,10 @@ if ($type == 'invite')
|
|||||||
{
|
{
|
||||||
registration_check();
|
registration_check();
|
||||||
failedloginscheck ("Invite signup");
|
failedloginscheck ("Invite signup");
|
||||||
$code = $_GET["invitenumber"];
|
$code = $_GET["invitenumber"] ?? '';
|
||||||
|
if (empty($code)) {
|
||||||
|
stderr($lang_signup['std_error'], "Require invitenumber");
|
||||||
|
}
|
||||||
|
|
||||||
$nuIP = getip();
|
$nuIP = getip();
|
||||||
$dom = @gethostbyaddr($nuIP);
|
$dom = @gethostbyaddr($nuIP);
|
||||||
|
|||||||
Reference in New Issue
Block a user