mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 20:17:24 +08:00
shoutbox cancel writeLog
This commit is contained in:
+9
-7
@@ -70,7 +70,7 @@ else
|
|||||||
if($_GET["type"]=="helpbox")
|
if($_GET["type"]=="helpbox")
|
||||||
{
|
{
|
||||||
if ($showhelpbox_main != 'yes'){
|
if ($showhelpbox_main != 'yes'){
|
||||||
write_log("Someone is hacking shoutbox. - IP : ".getip(),'mod');
|
do_log("Someone is hacking shoutbox. helpbox_disabled - IP : ".getip());
|
||||||
die($lang_shoutbox['text_helpbox_disabled']);
|
die($lang_shoutbox['text_helpbox_disabled']);
|
||||||
}
|
}
|
||||||
$userid=0;
|
$userid=0;
|
||||||
@@ -80,7 +80,7 @@ else
|
|||||||
{
|
{
|
||||||
$userid=intval($CURUSER["id"] ?? 0);
|
$userid=intval($CURUSER["id"] ?? 0);
|
||||||
if (!$userid){
|
if (!$userid){
|
||||||
write_log("Someone is hacking shoutbox. - IP : ".getip(),'mod');
|
do_log("Someone is hacking shoutbox. no_permission_to_shoutbox - IP : ".getip());
|
||||||
die($lang_shoutbox['text_no_permission_to_shoutbox']);
|
die($lang_shoutbox['text_no_permission_to_shoutbox']);
|
||||||
}
|
}
|
||||||
if (!empty($_GET["toguest"]))
|
if (!empty($_GET["toguest"]))
|
||||||
@@ -89,11 +89,13 @@ else
|
|||||||
}
|
}
|
||||||
$date=sqlesc(time());
|
$date=sqlesc(time());
|
||||||
$text=trim($_GET["shbox_text"]);
|
$text=trim($_GET["shbox_text"]);
|
||||||
if ($userid > 0) {
|
if (isset($userid) && $userid > 0) {
|
||||||
$lockRes = \Nexus\Database\NexusDB::redis()->set($userid, 1, ['nx', 'ex'=>60]);
|
$lock = new \Nexus\Database\NexusLock("shoutbox:$userid", 60);
|
||||||
if ($lockRes !== true){
|
} else {
|
||||||
die($lang_shoutbox['speaking_too_often']);
|
$lock = new \Nexus\Database\NexusLock("shoutbox:" . getip(), 60);
|
||||||
}
|
}
|
||||||
|
if (!$lock->acquire()) {
|
||||||
|
die($lang_shoutbox['speaking_too_often']);
|
||||||
}
|
}
|
||||||
sql_query("INSERT INTO shoutbox (userid, date, text, type) VALUES (" . sqlesc($userid) . ", $date, " . sqlesc($text) . ", ".sqlesc($type).")") or sqlerr(__FILE__, __LINE__);
|
sql_query("INSERT INTO shoutbox (userid, date, text, type) VALUES (" . sqlesc($userid) . ", $date, " . sqlesc($text) . ", ".sqlesc($type).")") or sqlerr(__FILE__, __LINE__);
|
||||||
print "<script type=\"text/javascript\">parent.document.forms['shbox'].shbox_text.value='';</script>";
|
print "<script type=\"text/javascript\">parent.document.forms['shbox'].shbox_text.value='';</script>";
|
||||||
|
|||||||
Reference in New Issue
Block a user