Skip to content

Commit e989101

Browse files
committed
fix spurious log messages in captcha and mbeans classes
1 parent 53fee4b commit e989101

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

server/src/main/java/password/pwm/PwmConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ public abstract class PwmConstants
217217
"Your password must be scanned by the TSA to ensure the safety of your fellow travelers. Please take off your password's shoes to continue.",
218218
"That password really tied the room together dude.",
219219
"Bite my shiny metal password!",
220+
"ben makes password software go woooo",
220221

221222
//nick helm
222223
"I needed a password eight characters long so I picked Snow White and the Seven Dwarves.",

server/src/main/java/password/pwm/util/CaptchaUtility.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -340,16 +340,19 @@ private static boolean checkIfCaptchaParamPresent( final PwmRequest pwmRequest )
340340
final String configValue = pwmRequest.getConfig().readSettingAsString( PwmSetting.CAPTCHA_SKIP_PARAM );
341341
if ( !StringUtil.isEmpty( configValue ) )
342342
{
343-
final String skipCaptcha = pwmRequest.readParameterAsString( PwmConstants.PARAM_SKIP_CAPTCHA );
344-
if ( StringUtil.nullSafeEquals( configValue, skipCaptcha ) )
343+
final String requestValue = pwmRequest.readParameterAsString( PwmConstants.PARAM_SKIP_CAPTCHA );
344+
if ( !StringUtil.isEmpty( requestValue ) )
345345
{
346-
LOGGER.trace( pwmRequest, () -> "valid skipCaptcha value in request, skipping captcha check for this session" );
347-
pwmRequest.getPwmSession().getSessionStateBean().setCaptchaBypassedViaParameter( true );
348-
return true;
349-
}
350-
else
351-
{
352-
LOGGER.error( pwmRequest, "skipCaptcha value is in request, however value '" + skipCaptcha + "' does not match configured value" );
346+
if ( StringUtil.nullSafeEquals( configValue, requestValue ) )
347+
{
348+
LOGGER.trace( pwmRequest, () -> "valid skipCaptcha value in request, skipping captcha check for this session" );
349+
pwmRequest.getPwmSession().getSessionStateBean().setCaptchaBypassedViaParameter( true );
350+
return true;
351+
}
352+
else
353+
{
354+
LOGGER.error( pwmRequest, "skipCaptcha value is in request, however value '" + requestValue + "' does not match configured value" );
355+
}
353356
}
354357
}
355358

server/src/main/java/password/pwm/util/MBeanUtility.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public static void registerMBean( final PwmApplication pwmApplication )
6464
}
6565
catch ( Exception e )
6666
{
67-
LOGGER.error( "error registering mbean: " + e.getMessage() );
67+
LOGGER.debug( () -> "error registering mbean: " + e.getMessage() );
6868
}
6969
}
7070

@@ -77,7 +77,7 @@ public static void unregisterMBean( final PwmApplication pwmApplication )
7777
}
7878
catch ( Exception e )
7979
{
80-
LOGGER.error( "error unregistering mbean: " + e.getMessage() );
80+
LOGGER.debug( () -> "error unregistering mbean: " + e.getMessage() );
8181
}
8282
}
8383

0 commit comments

Comments
 (0)