mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
Show error messages from xmpp-setup and xmpp-register.
Avoid causing plinth to show error page.
This commit is contained in:
parent
9d6e17660d
commit
ac0f0c9eba
@ -16,4 +16,4 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
ejabberdctl register "$1" `hostname` "$2"
|
||||
ejabberdctl register "$1" `hostname` "$2" || echo "Failed to register XMPP account."
|
||||
|
||||
@ -58,5 +58,5 @@ if [ "$xmpp_inband_enable" != "$xmpp_inband_enable_cur" ] ; then
|
||||
else
|
||||
sed -i s/"ip_access: all"/"ip_access: trusted_network"/ /etc/ejabberd/ejabberd.yml
|
||||
fi
|
||||
ejabberdctl restart
|
||||
ejabberdctl restart || echo "Failed to restart ejabberd with new configuration."
|
||||
fi
|
||||
|
||||
@ -127,14 +127,21 @@ def _apply_changes(request, old_status, new_status):
|
||||
return
|
||||
|
||||
if new_status['inband_enabled']:
|
||||
messages.success(request, _('Inband registration enabled'))
|
||||
option = 'inband_enable'
|
||||
else:
|
||||
messages.success(request, _('Inband registration disabled'))
|
||||
option = 'noinband_enable'
|
||||
|
||||
LOGGER.info('Option - %s', option)
|
||||
actions.superuser_run('xmpp-setup', [option])
|
||||
output = actions.superuser_run('xmpp-setup', [option])
|
||||
|
||||
if 'Failed' in output:
|
||||
messages.error(request,
|
||||
_('Error when configuring XMPP server: %s') %
|
||||
output)
|
||||
elif option == 'inband_enable':
|
||||
messages.success(request, _('Inband registration enabled'))
|
||||
else:
|
||||
messages.success(request, _('Inband registration disabled'))
|
||||
|
||||
|
||||
class RegisterForm(forms.Form): # pylint: disable-msg=W0232
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user