Skip to content
Snippets Groups Projects
Commit b70bd5fd authored by srosse's avatar srosse
Browse files

OO-1747: show a message if someone try the self registration on a system where...

OO-1747: show a message if someone try the self registration on a system where it is disabled instead of a red screen, beautify the error and warning panel
parent 42d3e380
No related branches found
No related tags found
No related merge requests found
<div id="o_msg_error" class="panel-danger"> <div id="o_msg_error" class="panel panel-danger">
<div class="panel-heading">$r.translate("error.header")</div> <div class="panel-heading">$r.translate("error.header")</div>
<div class="panel-body">$message</div> <div class="panel-body">$message</div>
</div> </div>
\ No newline at end of file
<div id="o_msg_warn" class="panel-warning"> <div id="o_msg_warn" class="panel panel-warning">
<div class="panel-heading">$r.translate("warn.header")</div> <div class="panel-heading">$r.translate("warn.header")</div>
<div class="panel-body">$message</div> <div class="panel-body">$message</div>
</div> </div>
\ No newline at end of file
...@@ -51,6 +51,8 @@ import org.olat.core.gui.control.Event; ...@@ -51,6 +51,8 @@ import org.olat.core.gui.control.Event;
import org.olat.core.gui.control.WindowControl; import org.olat.core.gui.control.WindowControl;
import org.olat.core.gui.control.controller.BasicController; import org.olat.core.gui.control.controller.BasicController;
import org.olat.core.gui.control.generic.dtabs.Activateable2; import org.olat.core.gui.control.generic.dtabs.Activateable2;
import org.olat.core.gui.control.generic.messages.MessageController;
import org.olat.core.gui.control.generic.messages.MessageUIFactory;
import org.olat.core.gui.control.generic.wizard.WizardInfoController; import org.olat.core.gui.control.generic.wizard.WizardInfoController;
import org.olat.core.gui.media.RedirectMediaResource; import org.olat.core.gui.media.RedirectMediaResource;
import org.olat.core.helpers.Settings; import org.olat.core.helpers.Settings;
...@@ -59,7 +61,6 @@ import org.olat.core.id.Preferences; ...@@ -59,7 +61,6 @@ import org.olat.core.id.Preferences;
import org.olat.core.id.User; import org.olat.core.id.User;
import org.olat.core.id.context.ContextEntry; import org.olat.core.id.context.ContextEntry;
import org.olat.core.id.context.StateEntry; import org.olat.core.id.context.StateEntry;
import org.olat.core.logging.OLATRuntimeException;
import org.olat.core.util.StringHelper; import org.olat.core.util.StringHelper;
import org.olat.core.util.Util; import org.olat.core.util.Util;
import org.olat.core.util.WebappHelper; import org.olat.core.util.WebappHelper;
...@@ -106,9 +107,14 @@ public class RegistrationController extends BasicController implements Activatea ...@@ -106,9 +107,14 @@ public class RegistrationController extends BasicController implements Activatea
*/ */
public RegistrationController(UserRequest ureq, WindowControl wControl) { public RegistrationController(UserRequest ureq, WindowControl wControl) {
super(ureq, wControl); super(ureq, wControl);
if (!CoreSpringFactory.getImpl(RegistrationModule.class).isSelfRegistrationEnabled()) { if (!CoreSpringFactory.getImpl(RegistrationModule.class).isSelfRegistrationEnabled()) {
throw new OLATRuntimeException(RegistrationController.class, String contact = WebappHelper.getMailConfig("mailSupport");
"Registration controller launched but self registration is turned off in the config file", null); String text = translate("reg.error.disabled.body", new String[]{ contact });
MessageController msg = MessageUIFactory.createWarnMessage(ureq, getWindowControl(), null, text);
LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), null, msg.getInitialComponent(), null);
listenTo(layoutCtr);
putInitialPanel(layoutCtr.getInitialComponent());
return;
} }
// override language when not the same as in ureq and add fallback to // override language when not the same as in ureq and add fallback to
// property handler translator for user properties // property handler translator for user properties
......
...@@ -71,6 +71,7 @@ reg.notiEmail.body=Soeben hat sich ein neuer Benutzer in OpenOLAT registriert\: ...@@ -71,6 +71,7 @@ reg.notiEmail.body=Soeben hat sich ein neuer Benutzer in OpenOLAT registriert\:
reg.notiEmail.subject=Neuer OpenOLAT-Benutzer\: {1} {2} ({0}) reg.notiEmail.subject=Neuer OpenOLAT-Benutzer\: {1} {2} ({0})
reg.subject=Registrierungsschl\u00FCssel f\u00FCr OpenOLAT reg.subject=Registrierungsschl\u00FCssel f\u00FCr OpenOLAT
reg.wherefrom=Diese Anfrage an den Server {0} wurde am {1} \nvon der IP-Adresse {2} abgeschickt. reg.wherefrom=Diese Anfrage an den Server {0} wurde am {1} \nvon der IP-Adresse {2} abgeschickt.
reg.error.disabled.body=Die Selbstregistrierung wurde für dieses System deaktiviert. Bitte kontaktieren Sie den zuständigen Systemadministrator unter {0} um einen Zugang zu erhalten.
reg.error.title=Registrierung abgebrochen reg.error.title=Registrierung abgebrochen
reg.error.no_username=Kein Benutzername konnte erstellt werden reg.error.no_username=Kein Benutzername konnte erstellt werden
reg.error.user_in_use=Benutzername ist schon besetzt reg.error.user_in_use=Benutzername ist schon besetzt
......
...@@ -68,6 +68,7 @@ pwform.cancelled=OpenOLAT password change was cancelled. Password remains unchan ...@@ -68,6 +68,7 @@ pwform.cancelled=OpenOLAT password change was cancelled. Password remains unchan
pwform.failed=An unexpected server error occurred. Your password was not altered. pwform.failed=An unexpected server error occurred. Your password was not altered.
pwkey.missingentry=Key for OpenOLAT password change not found. pwkey.missingentry=Key for OpenOLAT password change not found.
reg.body=Thank you for your interest in OpenOLAT.\r\n\r\nPlease use the link {0}/dmz/registration/index.html?key\={1}&language\={2} \r\nto complete your registration.\r\n\r\nIn case you do not want to register, just ignore this e-mail.\r\n\r\nYour OpenOLAT team reg.body=Thank you for your interest in OpenOLAT.\r\n\r\nPlease use the link {0}/dmz/registration/index.html?key\={1}&language\={2} \r\nto complete your registration.\r\n\r\nIn case you do not want to register, just ignore this e-mail.\r\n\r\nYour OpenOLAT team
reg.error.disabled.body=The self registration for this system has been disabled. Please contact the system administrator ({0}) in order to gain access.
reg.error.no_username=User name could not be created reg.error.no_username=User name could not be created
reg.error.title=Registration cancelled reg.error.title=Registration cancelled
reg.error.user_in_use=This user name already exists reg.error.user_in_use=This user name already exists
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment