Browse Source

pwnotify ldap updates

jrivard@gmail.com 6 years ago
parent
commit
7147be2211

+ 0 - 6
server/src/main/java/password/pwm/svc/AbstractPwmService.java

@@ -27,7 +27,6 @@ import password.pwm.health.HealthMessage;
 import password.pwm.health.HealthRecord;
 import password.pwm.health.HealthRecord;
 
 
 import java.util.ArrayList;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 import java.util.List;
 
 
 public abstract class AbstractPwmService
 public abstract class AbstractPwmService
@@ -57,11 +56,6 @@ public abstract class AbstractPwmService
 
 
     public final List<HealthRecord> healthCheck( )
     public final List<HealthRecord> healthCheck( )
     {
     {
-        if ( status != PwmService.STATUS.OPEN )
-        {
-            return Collections.emptyList();
-        }
-
         final List<HealthRecord> returnRecords = new ArrayList<>(  );
         final List<HealthRecord> returnRecords = new ArrayList<>(  );
 
 
         final ErrorInformation startupError = this.startupError;
         final ErrorInformation startupError = this.startupError;

+ 12 - 2
server/src/main/java/password/pwm/svc/pwnotify/PwNotifyService.java

@@ -65,7 +65,7 @@ public class PwNotifyService extends AbstractPwmService implements PwmService
 
 
     public StoredJobState getJobState() throws PwmUnrecoverableException
     public StoredJobState getJobState() throws PwmUnrecoverableException
     {
     {
-        if ( status != STATUS.CLOSED )
+        if ( status != STATUS.OPEN )
         {
         {
             if ( getStartupError() != null )
             if ( getStartupError() != null )
             {
             {
@@ -210,6 +210,11 @@ public class PwNotifyService extends AbstractPwmService implements PwmService
     @Override
     @Override
     protected List<HealthRecord> serviceHealthCheck( )
     protected List<HealthRecord> serviceHealthCheck( )
     {
     {
+        if ( status() != STATUS.OPEN )
+        {
+            return Collections.emptyList();
+        }
+
         final List<HealthRecord> returnRecords = new ArrayList<>( );
         final List<HealthRecord> returnRecords = new ArrayList<>( );
 
 
         try
         try
@@ -255,7 +260,12 @@ public class PwNotifyService extends AbstractPwmService implements PwmService
 
 
     public boolean canRunOnThisServer()
     public boolean canRunOnThisServer()
     {
     {
-        return engine.canRunOnThisServer();
+        if ( status() == STATUS.OPEN )
+        {
+            return engine.canRunOnThisServer();
+        }
+
+        return false;
     }
     }
 
 
     class PwNotifyJob implements Runnable
     class PwNotifyJob implements Runnable

+ 1 - 0
server/src/main/resources/password/pwm/i18n/PwmSetting.properties

@@ -992,6 +992,7 @@ Setting_Label_ldap.serverCerts=LDAP Certificates
 Setting_Label_ldap.serverUrls=LDAP URLs
 Setting_Label_ldap.serverUrls=LDAP URLs
 Setting_Label_ldap.testuser.username=LDAP Test User
 Setting_Label_ldap.testuser.username=LDAP Test User
 Setting_Label_ldap.user.group.attribute=User Group Attribute
 Setting_Label_ldap.user.group.attribute=User Group Attribute
+Setting_Label_ldap.user.pwNotify.attribute=Password Notify Service Attribute
 Setting_Label_ldap.user.language.attribute=User Language Attribute
 Setting_Label_ldap.user.language.attribute=User Language Attribute
 Setting_Label_ldap.user.language.autoSet=Auto Set User Language Attribute
 Setting_Label_ldap.user.language.autoSet=Auto Set User Language Attribute
 Setting_Label_ldap.username.attr=Attribute to use for User Name
 Setting_Label_ldap.username.attr=Attribute to use for User Name