Permalink
Browse files

Cleans up unused code and database tables

  • Loading branch information...
BenParizek committed Feb 16, 2015
1 parent 40b21bb commit 395280b1430a762f47613b0169082f79c4558896

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -24,30 +24,11 @@ public function verifySubmission()
}
}
// The honeypot field must be left blank or, if we are using the database,
// the field name much match the database field name
// The honeypot field must be left blank
if ( $honeypotValue = craft()->request->getPost($honeypotFieldName) )
{
// If our honeypot uses the database, make sure our unique field
// if ($honeypotRequireJavascript)
// {
// // query the db and see if the value matches, return true if so
// $key = craft()->db->createCommand()
// ->select('keys.key')
// ->from('sproutinvisiblecaptcha_keys as keys')
// ->where('keys.key=:key', array(':key'=> $honeypotValue))
// ->queryScalar();
// if ($key) return true;
// // if the value doesn't match, return false
// craft()->sproutInvisibleCaptcha->honeypotMethodFailed = 1;
// return false;
// }
craft()->sproutInvisibleCaptcha->honeypotMethodFailed = 1;
return false;
return false;
}
return true;
@@ -66,55 +47,16 @@ public function getField()
$honeypotRequireJavascript = craft()->sproutInvisibleCaptcha->getMethodOption('honeypotRequireJavascript');
$formKeyDuration = craft()->sproutInvisibleCaptcha->getMethodOption('formKeyDuration');
// $honeypotFieldName .= "_" . $this->randomString();
$dummyValue = $this->randomString();
$honeypotKey = "";
// If our honeypot uses the database, make our honeypot field unique
// if ( $honeypotRequireJavascript )
// {
// // Log our rejected submission so we can see what's being blocked
// $model = new SproutInvisibleCaptcha_KeyModel();
// $attributes['key'] = $this->randomString();
// $attributes['ipAddress'] = $_SERVER["REMOTE_ADDR"];
// $model->setAttributes($attributes);
// $logRecord = SproutInvisibleCaptcha_KeyRecord::model();
// $record = $logRecord->create();
// $record->setAttributes($model->getAttributes(), false);
// if ($record->save())
// {
// $honeypotKey = $record->key;
// }
// // And while we're at it, let's clean up any
// // old keys that are not needed anymore based on the
// // amount of time we have set in our settings
// $dateToDeleteFrom = date( "Y-m-d H:i:s", strtotime("now") - $formKeyDuration );
// craft()->db->createCommand()->delete('sproutinvisiblecaptcha_keys', 'dateCreated<=:dateToDeleteFrom', array( ':dateToDeleteFrom' => $dateToDeleteFrom ));
// }
$honeypot = '
$honeypot = '
<div id="'.$honeypotFieldName.'_wrapper">
<label>'.$honeypotScreenReaderMessage.'</label>
<input type="text" id="'.$honeypotFieldName.'" name="'.$honeypotFieldName.'" value="" />
</div>
<style>#'.$honeypotFieldName.'_wrapper{display:none;}</style>';
// @TODO - Enable Javascript Test
// $honeypot = '
// <div id="'.$honeypotFieldName.'_wrapper">
// <label>'.$honeypotScreenReaderMessage.'</label>
// <input type="text" id="'.$honeypotFieldName.'" name="'.$honeypotFieldName.'" value="'.$dummyValue.'" />
// </div>
// <style>#'.$honeypotFieldName.'_wrapper{display:none;}</style>
// <script>document.getElementById("'.$honeypotFieldName.'").value="'.$honeypotKey.'"</script>';
return $honeypot;
}

0 comments on commit 395280b

Please sign in to comment.