Skip to content

Commit

Permalink
Merge pull request #30 from NethServer/dev6837
Browse files Browse the repository at this point in the history
Fix condition to check for 'addusers' key in get-configuration script NethServer/dev#6837
stephdl authored Feb 7, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents be2a526 + ac2e161 commit 144f28d
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion imageroot/actions/get-configuration/20read
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ for key in agent.list_service_providers(rdb,'imap','tcp'):
mail = key['module_id']
get_retval = agent.tasks.run(f"module/{mail}",'list-domains')
for kd in get_retval['output']:
if kd['addusers']:
if kd.get('addusers') == True:
obj = {
"name": key['module_id'],
"label": f"{kd['domain']} ({key['mail_hostname']})",
4 changes: 3 additions & 1 deletion ui/public/i18n/en/translation.json
Original file line number Diff line number Diff line change
@@ -40,7 +40,9 @@
"choose_mail_server": "Select a domain",
"choose_the_mail_server_to_use": "Choose the domain suffix used for both identifying and initializing the user account and their mail address preferences",
"mail_server_is_not_valid": "This mail server cannot be used by Roundcube webmail",
"upload_max_filesize_number_lte": "Must be less than 120 MB"
"upload_max_filesize_number_lte": "Must be less than 120 MB",
"no_available_mail_domain_check_users": "Make sure the mail domain you intend to use has \"Add user addresses from user domain\" checkbox enabled",
"mail_module_misconfigured": "No mail domain available"
},
"about": {
"title": "About"
15 changes: 15 additions & 0 deletions ui/src/views/Settings.vue
Original file line number Diff line number Diff line change
@@ -61,6 +61,16 @@
$t("settings.enabled")
}}</template>
</cv-toggle>
<cv-row v-if="mail_server_URL.length === 0 && ! loading.getConfiguration">
<cv-column>
<NsInlineNotification
kind="warning"
:title="$t('settings.mail_module_misconfigured')"
:description="$t('settings.no_available_mail_domain_check_users')"
:showCloseButton="false"
/>
</cv-column>
</cv-row>
<NsComboBox
v-model.trim="mail_server"
:autoFilter="true"
@@ -286,6 +296,11 @@ export default {
} else {
this.mail_server = "";
}
// if mail_server_URL is empty, set default value
if (this.mail_server_URL.length === 0) {
// we want to avoid to save the form, there is no users set in the mail domain
this.mail_server = "";
}
});

this.mail_server_URL = config.mail_server_URL;

0 comments on commit 144f28d

Please sign in to comment.