/** * checks for duplicate signups from same IP * * @return boolean */ private function checkMultipleSignupsFromSameIp(Pap_Signup_SignupFormContext $context) { $checkIt = Gpf_Settings::get(Pap_Settings::REPEATING_SIGNUPS_SETTING_NAME); if($checkIt != Gpf::YES) { return true; } $checkPeriod = Gpf_Settings::get(Pap_Settings::REPEATING_SIGNUPS_SECONDS_SETTING_NAME); $checkAction = Gpf_Settings::get(Pap_Settings::REPEATING_SIGNUPS_ACTION_SETTING_NAME); if($checkPeriod == '' || $checkPeriod == '0' || !is_numeric($checkPeriod)) { return true; } if($checkAction != self::ACTION_DECLINE && $checkAction != self::ACTION_DONTSAVE) { return true; } $userObject = new Pap_Common_User(); $recordsCount = $userObject->getNumberOfUsersFromSameIP($context->getIp(), $checkPeriod); if(($recordsCount > 0) && ($checkAction == self::ACTION_DONTSAVE)) { $context->getForm()->setErrorMessage($this->_("Not saved by fraud protection")); $context->setAllowSave(false); return false; } else if (($recordsCount > 0) && ($checkAction == self::ACTION_DECLINE)) { $context->getRow()->setStatus(Gpf_Db_User::DECLINED); } return true; }