use library function to determine if https should be used for recaptcha

This commit is contained in:
Craig Andrews 2010-10-27 00:11:55 -04:00
parent 9f9126e524
commit 255ba42ef1
1 changed files with 2 additions and 11 deletions

View File

@ -51,15 +51,6 @@ class RecaptchaPlugin extends Plugin
} }
} }
function checkssl()
{
if(common_config('site', 'ssl') === 'sometimes' || common_config('site', 'ssl') === 'always') {
return true;
}
return false;
}
function onEndRegistrationFormData($action) function onEndRegistrationFormData($action)
{ {
$action->elementStart('li'); $action->elementStart('li');
@ -79,7 +70,7 @@ class RecaptchaPlugin extends Plugin
{ {
if (isset($action->recaptchaPluginNeedsOutput) && $action->recaptchaPluginNeedsOutput) { if (isset($action->recaptchaPluginNeedsOutput) && $action->recaptchaPluginNeedsOutput) {
// Load the AJAX API // Load the AJAX API
if ($this->checkssl()) { if (StatusNet::isHTTPS()) {
$url = "https://api-secure.recaptcha.net/js/recaptcha_ajax.js"; $url = "https://api-secure.recaptcha.net/js/recaptcha_ajax.js";
} else { } else {
$url = "http://api.recaptcha.net/js/recaptcha_ajax.js"; $url = "http://api.recaptcha.net/js/recaptcha_ajax.js";
@ -120,4 +111,4 @@ class RecaptchaPlugin extends Plugin
'captcha to the registration page.')); 'captcha to the registration page.'));
return true; return true;
} }
} }