public static Password getPassword ( PageContext pc , String password , boolean server ) throws lucee . runtime . exp . SecurityException { // TODO: move this to a utility class in a more // generic package? // no password passed if ( StringUtil . isEmpty ( password , true ) ) { ApplicationContext appContext = pc . getApplicationContext ( ) ; if ( appContext instanceof ModernApplicationContext ) password = Caster . toString ( ( ( ModernApplicationContext ) appContext ) . getCustom ( KeyConstants . _webAdminPassword ) , "" ) ; } else password = password . trim ( ) ; if ( StringUtil . isEmpty ( password , true ) ) throw new lucee . runtime . exp . SecurityException ( "A Web Admin Password is required to manipulate Cache connections. " + "You can either pass the password as an argument to this function, or set it in " + ( pc . getRequestDialect ( ) == CFMLEngine . DIALECT_CFML ? Constants . CFML_APPLICATION_EVENT_HANDLER : Constants . LUCEE_APPLICATION_EVENT_HANDLER ) + " with the variable [this.webAdminPassword]." ) ; return PasswordImpl . passwordToCompare ( pc . getConfig ( ) , server , password ) ; }
returns true if the webAdminPassword matches the passed password if one is passed or a password defined in Application . cfc as this . webAdminPassword if null or empty - string is passed for password