Skip to content

Commit db14079

Browse files
committed
fix spurious log messages in captcha and mbeans classes
1 parent 21569ae commit db14079

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
@@ -338,16 +338,19 @@ private static boolean checkIfCaptchaParamPresent( final PwmRequest pwmRequest )
338338
final String configValue = pwmRequest.getConfig().readSettingAsString( PwmSetting.CAPTCHA_SKIP_PARAM );
339339
if ( !StringUtil.isEmpty( configValue ) )
340340
{
341-
final String skipCaptcha = pwmRequest.readParameterAsString( PwmConstants.PARAM_SKIP_CAPTCHA );
342-
if ( StringUtil.nullSafeEquals( configValue, skipCaptcha ) )
341+
final String requestValue = pwmRequest.readParameterAsString( PwmConstants.PARAM_SKIP_CAPTCHA );
342+
if ( !StringUtil.isEmpty( requestValue ) )
343343
{
344-
LOGGER.trace( pwmRequest, () -> "valid skipCaptcha value in request, skipping captcha check for this session" );
345-
pwmRequest.getPwmSession().getSessionStateBean().setCaptchaBypassedViaParameter( true );
346-
return true;
347-
}
348-
else
349-
{
350-
LOGGER.error( pwmRequest, "skipCaptcha value is in request, however value '" + skipCaptcha + "' does not match configured value" );
344+
if ( StringUtil.nullSafeEquals( configValue, requestValue ) )
345+
{
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 '" + requestValue + "' does not match configured value" );
353+
}
351354
}
352355
}
353356

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)