1: <?php
2:
3: define('PROTECTOR_POSTCOMMON_POST_REGISTER_MORATORIUM', 60); // minutes
4:
5: /**
6: * Class protector_postcommon_post_register_moratorium
7: */
8: class Protector_postcommon_post_register_moratorium extends ProtectorFilterAbstract
9: {
10: /**
11: * @return bool
12: */
13: public function execute()
14: {
15: global $xoopsUser;
16:
17: if (!is_object($xoopsUser)) {
18: return true;
19: }
20:
21: $moratorium_result = (int)(($xoopsUser->getVar('user_regdate') + PROTECTOR_POSTCOMMON_POST_REGISTER_MORATORIUM * 60 - time()) / 60);
22: if ($moratorium_result > 0) {
23: if (preg_match('#(https?\:|\[\/url\]|www\.)#i', serialize($_POST))) {
24: printf(_MD_PROTECTOR_FMT_REGISTER_MORATORIUM, $moratorium_result);
25: exit;
26: }
27: }
28: return null;
29: }
30: }
31: