Commit 8b360cf5 authored by guus's avatar guus

Guenther's fix for OF-27. MUC services should not be created, if the provided...

Guenther's fix for OF-27. MUC services should not be created, if the provided service name is not a legal JID subdomain.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@11097 b35dd754-fafc-0310-a699-88a17e54d16e
parent 9d4de84b
......@@ -344,6 +344,7 @@ groupchat.service.properties.saved_successfully2=server, aby se zm\u011bny proje
groupchat.service.properties.legend=Jm\u00e9no slu\u017eby
groupchat.service.properties.label_service_name=Jm\u00e9no slu\u017eby skupinov\u00e9ho chatu:
groupchat.service.properties.error_service_name=Pros\u00edm zadejte platn\u00e9 jm\u00e9no.
groupchat.service.properties.error_already_exists=A service with the specified name already exists.
groupchat.service.properties.save=Ulo\u017eit vlastnosti
# Group Chat History Settings Page
......
......@@ -332,6 +332,7 @@ groupchat.service.properties.saved_successfully2=muss neu gestartet werden damit
groupchat.service.properties.legend=Service-Name
groupchat.service.properties.label_service_name=Gruppenchat Service-Name:
groupchat.service.properties.error_service_name=Bitte einen g\u00fcltigen Namen eingeben.
groupchat.service.properties.error_already_exists=Es gibt bereits einen Gruppenchat mit dem angegebenen Namen.
groupchat.service.properties.save=Eigenschaften speichern
# Group Chat History Settings Page
......
......@@ -461,6 +461,9 @@
## Added key: 'prelogin.setup.error.clearspace.sharedsecret'
## Added key: 'prelogin.setup.error.clearspace.connection'
## Added key: 'ssl.settings.client.label_self-signed'
##
## 3.6.5
## Added key: 'groupchat.service.properties.error_already_exists'
......@@ -818,6 +821,8 @@ groupchat.service.properties.saved_successfully=Service properties edited succes
groupchat.service.properties.legend=Service Name
groupchat.service.properties.label_service_name=Group chat service name:
groupchat.service.properties.error_service_name=Please enter a valid name.
groupchat.service.properties.error_already_exists=A service with the specified name already exists.
groupchat.service.properties.label_service_description=Group chat service description (optional):
groupchat.service.properties.save=Save Properties
groupchat.service.settings_affect=Changes you make here will affect the group chat service:
......
......@@ -336,6 +336,7 @@ groupchat.service.properties.saved_successfully2=el servidor para que los cambio
groupchat.service.properties.legend=Nombre del Servicio
groupchat.service.properties.label_service_name=Nombre del servicio de conferencia:
groupchat.service.properties.error_service_name=Por favor introduzca un nombre v\u00e1lido.
groupchat.service.properties.error_already_exists=A service with the specified name already exists.
groupchat.service.properties.save=Guardar las Propiedades
# Group Chat History Settings Page
......
......@@ -310,6 +310,7 @@ groupchat.service.properties.saved_successfully2 = le serveur pour que les modif
groupchat.service.properties.legend = Nom du Service
groupchat.service.properties.label_service_name = Nom du service de Salon de Discussion \:
groupchat.service.properties.error_service_name = Veuillez saisir un nom valide.
groupchat.service.properties.error_already_exists=A service with the specified name already exists.
groupchat.service.properties.save = Sauvegarder les propri\u00E9t\u00E9s
# Group Chat History Settings Page
groupchat.history.settings.title = Param\u00E8tres d'Historique du Salon de Discussion
......
......@@ -522,6 +522,7 @@ groupchat.service.properties.saved_successfully2=\u5909\u66f4\u3092\u53cd\u6620\
groupchat.service.properties.legend=\u30b5\u30fc\u30d3\u30b9\u540d
groupchat.service.properties.label_service_name=\u30b0\u30eb\u30fc\u30d7\u30c1\u30e3\u30c3\u30c8\u30b5\u30fc\u30d3\u30b9\u540d:
groupchat.service.properties.error_service_name=\u9069\u5207\u306a\u540d\u79f0\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002
groupchat.service.properties.error_already_exists=A service with the specified name already exists.
groupchat.service.properties.save=\u5c5e\u6027\u306e\u4fdd\u5b58
# Group Chat History Settings Page
......
......@@ -331,6 +331,7 @@ groupchat.service.properties.saved_successfully2=om de wijzigingen toe te passen
groupchat.service.properties.legend=Naam van de chatdienst
groupchat.service.properties.label_service_name=Naam van de chatdienst:
groupchat.service.properties.error_service_name=Geef een geldige naam op.
groupchat.service.properties.error_already_exists=Een dienst met deze naam bestaat al.
groupchat.service.properties.save=Eigenschappen opslaan
# Group Chat History Settings Page
......
......@@ -334,6 +334,7 @@ groupchat.service.properties.saved_successfully2=serwer, aby zmiany odnios\u0142
groupchat.service.properties.legend=Nazwa us\u0142ugi
groupchat.service.properties.label_service_name=Nazwa us\u0142ugi konferencji wielou\u017cytkownikowych:
groupchat.service.properties.error_service_name=Prosz\u0119 wpisa\u0107 poprawn\u0105 nazw\u0119.
groupchat.service.properties.error_already_exists=A service with the specified name already exists.
groupchat.service.properties.save=Zapisz
# Group Chat History Settings Page
......
......@@ -340,6 +340,7 @@ groupchat.service.properties.saved_successfully2=o servidor para que as mudan\u0
groupchat.service.properties.legend=Nome do Servi\u00e7o
groupchat.service.properties.label_service_name=Nome do servi\u00e7o de Confer\u00eancia:
groupchat.service.properties.error_service_name=Por favor digite um nome v\u00e1lido.
groupchat.service.properties.error_already_exists=A service with the specified name already exists.
groupchat.service.properties.save=Salvar propriedades
# Group Chat History Settings Page
......
......@@ -696,6 +696,7 @@ groupchat.service.properties.saved_successfully2=server, aby sa zmeny prejavili
groupchat.service.properties.legend=N\u00E1zov slu\u017Eby
groupchat.service.properties.label_service_name=N\u00E1zov slu\u017Eby skupinov\u00E9ho rozhovoru:
groupchat.service.properties.error_service_name=Pros\u00EDm zadajte platn\u00FD n\u00E1zov.
groupchat.service.properties.error_already_exists=A service with the specified name already exists.
groupchat.service.properties.save=Ulo\u017Ei\u0165 vlastnosti
# Group Chat History Settings Page
......
......@@ -338,6 +338,7 @@ groupchat.service.properties.saved_successfully2=\u670d\u52a1\u5668\uff0c\u4ee5\
groupchat.service.properties.legend=\u670d\u52a1\u540d\u79f0
groupchat.service.properties.label_service_name=\u5206\u7ec4\u804a\u5929\u670d\u52a1\u540d\u79f0\uff1a
groupchat.service.properties.error_service_name=\u8bf7\u8f93\u5165\u6709\u6548\u540d\u79f0\u3002
groupchat.service.properties.error_already_exists=A service with the specified name already exists.
groupchat.service.properties.save=\u4fdd\u5b58\u5c5e\u6027
# Group Chat History Settings Page
......
......@@ -126,9 +126,9 @@ public class MultiUserChatManager extends BasicModule implements ClusterEventLis
*/
public void registerMultiUserChatService(MultiUserChatService service) {
Log.debug("MultiUserChatManager: Registering MUC service "+service.getServiceName());
mucServices.put(service.getServiceName(), service);
try {
ComponentManagerFactory.getComponentManager().addComponent(service.getServiceName(), service);
mucServices.put(service.getServiceName(), service);
}
catch (ComponentException e) {
Log.error("MultiUserChatManager: Unable to add "+service.getServiceName()+" as component.", e);
......@@ -186,8 +186,8 @@ public class MultiUserChatManager extends BasicModule implements ClusterEventLis
*/
public MultiUserChatServiceImpl createMultiUserChatService(String subdomain, String description, Boolean isHidden) throws AlreadyExistsException {
if (getMultiUserChatServiceID(subdomain) != null) throw new AlreadyExistsException();
insertService(subdomain, description, isHidden);
MultiUserChatServiceImpl muc = new MultiUserChatServiceImpl(subdomain, description, isHidden);
insertService(subdomain, description, isHidden);
registerMultiUserChatService(muc);
return muc;
}
......
......@@ -120,7 +120,7 @@ public class MultiUserChatServiceImpl implements Component, MultiUserChatService
/**
* the chat service's hostname (subdomain)
*/
private String chatServiceName = null;
private final String chatServiceName;
/**
* the chat service's description
*/
......@@ -254,11 +254,20 @@ public class MultiUserChatServiceImpl implements Component, MultiUserChatService
/**
* Create a new group chat server.
*
* @param subdomain Subdomain portion of the conference services (for example, conference for conference.example.org)
* @param description Short description of service for disco and such.
* @param isHidden True if this service should be hidden from services views.
* @param subdomain
* Subdomain portion of the conference services (for example,
* conference for conference.example.org)
* @param description
* Short description of service for disco and such. If
* <tt>null</tt> or empty, a default value will be used.
* @param isHidden
* True if this service should be hidden from services views.
* @throws IllegalArgumentException
* if the provided subdomain is an invalid, according to the JID
* domain definition.
*/
public MultiUserChatServiceImpl(String subdomain, String description, Boolean isHidden) {
// Check subdomain and throw an IllegalArgumentException if its invalid new JID(null,subdomain + "." + XMPPServer.getInstance().getServerInfo().getXMPPDomain(), null);
this.chatServiceName = subdomain;
if (description != null && description.trim().length() > 0) {
this.chatDescription = description;
......@@ -268,7 +277,6 @@ public class MultiUserChatServiceImpl implements Component, MultiUserChatService
}
this.isHidden = isHidden;
historyStrategy = new HistoryStrategy(null);
initialize(XMPPServer.getInstance());
}
public String getDescription() {
......@@ -351,7 +359,7 @@ public class MultiUserChatServiceImpl implements Component, MultiUserChatService
}
public void initialize(JID jid, ComponentManager componentManager) {
initialize(XMPPServer.getInstance());
}
public void shutdown() {
......
......@@ -10,6 +10,7 @@
--%>
<%@ page import="org.jivesoftware.util.ParamUtils,
org.jivesoftware.util.AlreadyExistsException,
java.util.*"
errorPage="error.jsp"
%>
......@@ -66,12 +67,20 @@
return;
}
else {
try {
webManager.getMultiUserChatManager().createMultiUserChatService(mucname, mucdesc, false);
// Log the event
webManager.logEvent("created MUC service "+mucname, "name = "+mucname+"\ndescription = "+mucdesc);
response.sendRedirect("muc-service-edit-form.jsp?success=true&mucname="+mucname);
return;
}
catch (IllegalArgumentException e) {
errors.put("mucname","mucname");
}
catch (AlreadyExistsException e) {
errors.put("already_exists","already_exists");
}
}
}
}
%>
......@@ -116,6 +125,9 @@
<% if (errors.get("mucname") != null) { %>
<fmt:message key="groupchat.service.properties.error_service_name" />
<% } %>
<% if (errors.get("already_exists") != null) { %>
<fmt:message key="groupchat.service.properties.error_already_exists" />
<% } %>
</td></tr>
</tbody>
</table>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment