Changeset 1317 in ExiteCMS for trunk/forum/post.php
- Timestamp:
- 02/27/08 22:00:23 (4 years ago)
- File:
-
- 1 edited
-
trunk/forum/post.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/forum/post.php
r1316 r1317 580 580 // insert a new post record 581 581 $flood = false; 582 $result = dbquery("SELECT MAX(post_datestamp) AS last_post FROM ".$db_prefix."posts WHERE post_author='".$userdata['user_id']."'"); 583 if (!iSUPERADMIN && dbrows($result) > 0) { 584 $data = dbarray($result); 585 if ((time() - $data['last_post']) < $settings['flood_interval']) { 586 $flood = true; 587 $error = $locale['431']; 588 $result = dbquery("INSERT INTO ".$db_prefix."flood_control (flood_ip, flood_timestamp) VALUES ('".USER_IP."', '".time()."')"); 589 if (dbcount("(flood_ip)", "flood_control", "flood_ip='".USER_IP."'") > 4) { 590 $result = dbquery("UPDATE ".$db_prefix."users SET user_status='1', user_ban_reason='".$locale['434']."' WHERE user_id='".$userdata['user_id']."'"); 591 $error .= "<br />".$locale['432']; 592 } else { 593 $error .= "<br />".sprintf($locale['433'], $settings['flood_interval']); 582 if (!iSUPERADMIN) { 583 // for non-webmasters, check for post flooding 584 $result = dbquery("SELECT MAX(post_datestamp) AS last_post FROM ".$db_prefix."posts WHERE post_author='".$userdata['user_id']."'"); 585 if (dbrows($result) > 0) { 586 $data = dbarray($result); 587 if ((time() - $data['last_post']) < $settings['flood_interval']) { 588 $flood = true; 589 $error = $locale['431']; 590 $result = dbquery("INSERT INTO ".$db_prefix."flood_control (flood_ip, flood_timestamp) VALUES ('".USER_IP."', '".time()."')"); 591 if (dbcount("(flood_ip)", "flood_control", "flood_ip='".USER_IP."'") > 4) { 592 $result = dbquery("UPDATE ".$db_prefix."users SET user_status='1', user_ban_reason='".$locale['434']."' WHERE user_id='".$userdata['user_id']."'"); 593 $error .= "<br />".$locale['432']; 594 } else { 595 $error .= "<br />".sprintf($locale['433'], $settings['flood_interval']); 596 } 594 597 } 595 598 }
Note: See TracChangeset
for help on using the changeset viewer.
