Permalink
Browse files

SAK-19267 merge trunk r83074

git-svn-id: https://source.sakaiproject.org/svn/user/branches/sakai-2.8.x@83185 66ffb92e-73f9-0310-93c1-f5514f145a0a
  • Loading branch information...
1 parent d8111df commit 369351beb16bcc8aae4e4b2347aacae80b86c425 arwhyte@umich.edu committed Oct 11, 2010
@@ -134,12 +134,12 @@ protected void initState(SessionState state, VelocityPortlet portlet, JetspeedRu
state.setAttribute("create-type", config.getInitParameter("create-type", ""));
}
- if (state.getAttribute("recaptcha-enabled") == null)
+ if (state.getAttribute("user.recaptcha-enabled") == null)
{
- String publicKey = ServerConfigurationService.getString("recaptcha.public-key", "");
- String privateKey = ServerConfigurationService.getString("recaptcha.private-key", "");
- Boolean systemEnabled = ServerConfigurationService.getBoolean("recaptcha.enabled", false);
- Boolean toolEnabled = Boolean.parseBoolean(config.getInitParameter("recaptcha-enabled", "false"));
+ String publicKey = ServerConfigurationService.getString("user.recaptcha.public-key", "");
+ String privateKey = ServerConfigurationService.getString("user.recaptcha.private-key", "");
+ Boolean systemEnabled = ServerConfigurationService.getBoolean("user.recaptcha.enabled", false);
+ Boolean toolEnabled = Boolean.parseBoolean(config.getInitParameter("user.recaptcha-enabled", "false"));
Boolean enabled = systemEnabled && toolEnabled;
if (enabled)
{
@@ -154,9 +154,9 @@ protected void initState(SessionState state, VelocityPortlet portlet, JetspeedRu
enabled = Boolean.FALSE;
}
}
- state.setAttribute("recaptcha-public-key", publicKey);
- state.setAttribute("recaptcha-private-key", privateKey);
- state.setAttribute("recaptcha-enabled", enabled);
+ state.setAttribute("user.recaptcha-public-key", publicKey);
+ state.setAttribute("user.recaptcha-private-key", privateKey);
+ state.setAttribute("user.recaptcha-enabled", enabled);
}
} // initState
@@ -371,9 +371,9 @@ private String buildCreateContext(SessionState state, Context context)
value = (String) state.getAttribute("valueEmail");
if (value != null) context.put("valueEmail", value);
- if ((Boolean)state.getAttribute("recaptcha-enabled"))
+ if ((Boolean)state.getAttribute("user.recaptcha-enabled"))
{
- ReCaptcha captcha = ReCaptchaFactory.newReCaptcha((String)state.getAttribute("recaptcha-public-key"), (String)state.getAttribute("recaptcha-private-key"), false);
+ ReCaptcha captcha = ReCaptchaFactory.newReCaptcha((String)state.getAttribute("user.recaptcha-public-key"), (String)state.getAttribute("user.recaptcha-private-key"), false);
String captchaScript = captcha.createRecaptchaHtml((String)state.getAttribute("recaptcha-error"), null);
state.removeAttribute("recaptcha-error");
context.put("recaptchaScript", captchaScript);
@@ -879,13 +879,13 @@ else if ((mode != null) && (mode.equalsIgnoreCase("edit")) && (!singleUser))
}
}
- if ((Boolean)state.getAttribute("recaptcha-enabled"))
+ if ((Boolean)state.getAttribute("user.recaptcha-enabled"))
{
String challengeField = data.getParameters().getString("recaptcha_challenge_field");
String responseField = data.getParameters().getString("recaptcha_response_field");
if (challengeField == null) challengeField = "";
if (responseField == null) responseField = "";
- ReCaptcha captcha = ReCaptchaFactory.newReCaptcha((String)state.getAttribute("recaptcha-public-key"), (String)state.getAttribute("recaptcha-private-key"), false);
+ ReCaptcha captcha = ReCaptchaFactory.newReCaptcha((String)state.getAttribute("user.recaptcha-public-key"), (String)state.getAttribute("user.recaptcha-private-key"), false);
ReCaptchaResponse response = captcha.checkAnswer(data.getRequest().getRemoteAddr(), challengeField, responseField);
if (!response.isValid())
{
@@ -12,7 +12,7 @@
<configuration name="create-login" value="true" type="final" />
<configuration name="create-user" value="true" type="final" />
<configuration name="reset.button" value="false" type="final" />
- <configuration name="recaptcha-enabled" value="true"/>
+ <configuration name="user.recaptcha-enabled" value="true"/>
</tool>

0 comments on commit 369351b

Please sign in to comment.