<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
* pattern and cache the instance in this variable
*
* @var object
- * @static
*/
static private $_singleton = NULL;
/**
- * singleton function used to manage this object
+ * Singleton function used to manage this object
*
- * @param string the key to permit session scope's
*
* @return object
- * @static
- *
*/
- static function &singleton() {
+ public static function &singleton() {
if (self::$_singleton === NULL) {
self::$_singleton = new CRM_Utils_ReCAPTCHA();
}
}
/**
- *
*/
- function __construct() {}
+ public function __construct() {
+ }
/**
* Add element to form
- *
*/
- static function add(&$form) {
- $error = NULL;
+ public static function add(&$form) {
+ $error = NULL;
$config = CRM_Core_Config::singleton();
$useSSL = FALSE;
- if ( !function_exists( 'recaptcha_get_html' ) ) {
+ if (!function_exists('recaptcha_get_html')) {
require_once 'packages/recaptcha/recaptchalib.php';
}
/**
* @param $value
- * @param $form
+ * @param CRM_Core_Form $form
*
* @return mixed
*/
- static function validate($value, $form) {
+ public static function validate($value, $form) {
$config = CRM_Core_Config::singleton();
$resp = recaptcha_check_answer($config->recaptchaPrivateKey,
);
return $resp->is_valid;
}
-}
+}