diff --git a/src/app/Http/Controllers/RelationController.php b/src/app/Http/Controllers/RelationController.php --- a/src/app/Http/Controllers/RelationController.php +++ b/src/app/Http/Controllers/RelationController.php @@ -106,6 +106,21 @@ } } + $with_imap = !\config('app.with_imap'); + $with_ldap = !\config('app.with_ldap'); + + $state['isReady'] = (!$with_imap || !isset($state['isImapReady']) || $state['isImapReady']) + && (!$with_ldap || !isset($state['isLdapReady']) || $state['isLdapReady']) + && (!isset($state['isVerified']) || $state['isVerified']) + && (!isset($state['isConfirmed']) || $state['isConfirmed']); + + if (!$with_imap) { + unset($state['isImapReady']); + } + if (!$with_ldap) { + unset($state['isLdapReady']); + } + if (empty($state['isDeleted']) && method_exists($resource, 'trashed')) { $state['isDeleted'] = $resource->trashed(); } diff --git a/src/resources/js/app.js b/src/resources/js/app.js --- a/src/resources/js/app.js +++ b/src/resources/js/app.js @@ -296,7 +296,7 @@ return 'text-warning' } - if (obj.isImapReady === false || obj.isLdapReady === false || obj.isVerified === false || obj.isConfirmed === false) { + if (!obj.isReady) { return 'text-danger' } @@ -315,7 +315,7 @@ return this.$t('status.suspended') } - if (obj.isImapReady === false || obj.isLdapReady === false || obj.isVerified === false || obj.isConfirmed === false) { + if (!obj.isReady) { return this.$t('status.notready') }