Commit d5885b3c authored by guus's avatar guus

Undoing accidental checking.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@13552 b35dd754-fafc-0310-a699-88a17e54d16e
parent 55bb1594
...@@ -35,7 +35,6 @@ import org.jivesoftware.openfire.event.UserEventListener; ...@@ -35,7 +35,6 @@ import org.jivesoftware.openfire.event.UserEventListener;
import org.jivesoftware.openfire.group.Group; import org.jivesoftware.openfire.group.Group;
import org.jivesoftware.openfire.group.GroupManager; import org.jivesoftware.openfire.group.GroupManager;
import org.jivesoftware.openfire.group.GroupNotFoundException; import org.jivesoftware.openfire.group.GroupNotFoundException;
import org.jivesoftware.openfire.handler.IQRegisterHandler;
import org.jivesoftware.openfire.user.User; import org.jivesoftware.openfire.user.User;
import org.jivesoftware.util.EmailService; import org.jivesoftware.util.EmailService;
import org.jivesoftware.util.JiveGlobals; import org.jivesoftware.util.JiveGlobals;
...@@ -169,16 +168,9 @@ public class RegistrationPlugin implements Plugin { ...@@ -169,16 +168,9 @@ public class RegistrationPlugin implements Plugin {
public void initializePlugin(PluginManager manager, File pluginDirectory) { public void initializePlugin(PluginManager manager, File pluginDirectory) {
AuthCheckFilter.addExclude(URL); AuthCheckFilter.addExclude(URL);
// Replace the registered IQBindHandler with our own.
XMPPServer.getInstance().getIQRouter().addHandler(new IQExtendedRegisterHandler());
} }
public void destroyPlugin() { public void destroyPlugin() {
// Replace the our own IQBindHandler with the one that ships with Openfire.
XMPPServer.getInstance().getIQRouter().addHandler(new IQRegisterHandler());
AuthCheckFilter.removeExclude(URL); AuthCheckFilter.removeExclude(URL);
UserEventDispatcher.removeListener(listener); UserEventDispatcher.removeListener(listener);
serverAddress = null; serverAddress = null;
...@@ -186,6 +178,22 @@ public class RegistrationPlugin implements Plugin { ...@@ -186,6 +178,22 @@ public class RegistrationPlugin implements Plugin {
router = null; router = null;
} }
public void setIMNotificationEnabled(boolean enable) {
JiveGlobals.setProperty(IM_NOTIFICATION_ENABLED, enable ? "true" : "false");
}
public boolean imNotificationEnabled() {
return JiveGlobals.getBooleanProperty(IM_NOTIFICATION_ENABLED, false);
}
public void setEmailNotificationEnabled(boolean enable) {
JiveGlobals.setProperty(EMAIL_NOTIFICATION_ENABLED, enable ? "true" : "false");
}
public boolean emailNotificationEnabled() {
return JiveGlobals.getBooleanProperty(EMAIL_NOTIFICATION_ENABLED, false);
}
public Collection<String> getIMContacts() { public Collection<String> getIMContacts() {
Collections.sort(imContacts); Collections.sort(imContacts);
return imContacts; return imContacts;
...@@ -230,104 +238,88 @@ public class RegistrationPlugin implements Plugin { ...@@ -230,104 +238,88 @@ public class RegistrationPlugin implements Plugin {
} }
} }
public static void setIMNotificationEnabled(boolean enable) { public void setWelcomeEnabled(boolean enable) {
JiveGlobals.setProperty(IM_NOTIFICATION_ENABLED, enable ? "true" : "false");
}
public static boolean imNotificationEnabled() {
return JiveGlobals.getBooleanProperty(IM_NOTIFICATION_ENABLED, false);
}
public static void setEmailNotificationEnabled(boolean enable) {
JiveGlobals.setProperty(EMAIL_NOTIFICATION_ENABLED, enable ? "true" : "false");
}
public static boolean emailNotificationEnabled() {
return JiveGlobals.getBooleanProperty(EMAIL_NOTIFICATION_ENABLED, false);
}
public static void setWelcomeEnabled(boolean enable) {
JiveGlobals.setProperty(WELCOME_ENABLED, enable ? "true" : "false"); JiveGlobals.setProperty(WELCOME_ENABLED, enable ? "true" : "false");
} }
public static boolean welcomeEnabled() { public boolean welcomeEnabled() {
return JiveGlobals.getBooleanProperty(WELCOME_ENABLED, false); return JiveGlobals.getBooleanProperty(WELCOME_ENABLED, false);
} }
public static void setWelcomeMessage(String message) { public void setWelcomeMessage(String message) {
JiveGlobals.setProperty(WELCOME_MSG, message); JiveGlobals.setProperty(WELCOME_MSG, message);
} }
public static String getWelcomeMessage() { public String getWelcomeMessage() {
return JiveGlobals.getProperty(WELCOME_MSG, "Welcome to Openfire!"); return JiveGlobals.getProperty(WELCOME_MSG, "Welcome to Openfire!");
} }
public static void setGroupEnabled(boolean enable) { public void setGroupEnabled(boolean enable) {
JiveGlobals.setProperty(GROUP_ENABLED, enable ? "true" : "false"); JiveGlobals.setProperty(GROUP_ENABLED, enable ? "true" : "false");
} }
public static boolean groupEnabled() { public boolean groupEnabled() {
return JiveGlobals.getBooleanProperty(GROUP_ENABLED, false); return JiveGlobals.getBooleanProperty(GROUP_ENABLED, false);
} }
public static void setWebEnabled(boolean enable) { public void setWebEnabled(boolean enable) {
JiveGlobals.setProperty(WEB_ENABLED, enable ? "true" : "false"); JiveGlobals.setProperty(WEB_ENABLED, enable ? "true" : "false");
} }
public static boolean webEnabled() { public boolean webEnabled() {
return JiveGlobals.getBooleanProperty(WEB_ENABLED, false); return JiveGlobals.getBooleanProperty(WEB_ENABLED, false);
} }
public static String webRegistrationAddress() { public String webRegistrationAddress() {
return "http://" + XMPPServer.getInstance().getServerInfo().getXMPPDomain() + ":" return "http://" + XMPPServer.getInstance().getServerInfo().getXMPPDomain() + ":"
+ JiveGlobals.getXMLProperty("adminConsole.port") + "/plugins/" + URL; + JiveGlobals.getXMLProperty("adminConsole.port") + "/plugins/" + URL;
} }
public static void setReCaptchaEnabled(boolean enable) { public void setReCaptchaEnabled(boolean enable) {
JiveGlobals.setProperty(RECAPTCHA_ENABLED, enable ? "true" : "false"); JiveGlobals.setProperty(RECAPTCHA_ENABLED, enable ? "true" : "false");
} }
public static boolean reCaptchaEnabled() { public boolean reCaptchaEnabled() {
return JiveGlobals.getBooleanProperty(RECAPTCHA_ENABLED, false); return JiveGlobals.getBooleanProperty(RECAPTCHA_ENABLED, false);
} }
public static void setReCaptchaNoScript(boolean enable) { public void setReCaptchaNoScript(boolean enable) {
JiveGlobals.setProperty(RECAPTCHA_NOSCRIPT, enable ? "true" : "false"); JiveGlobals.setProperty(RECAPTCHA_NOSCRIPT, enable ? "true" : "false");
} }
public static boolean reCaptchaNoScript() { public boolean reCaptchaNoScript() {
return JiveGlobals.getBooleanProperty(RECAPTCHA_NOSCRIPT, true); return JiveGlobals.getBooleanProperty(RECAPTCHA_NOSCRIPT, true);
} }
public static void setReCaptchaPublicKey(String publicKey) { public void setReCaptchaPublicKey(String publicKey) {
JiveGlobals.setProperty(RECAPTCHA_PUBLIC_KEY, publicKey); JiveGlobals.setProperty(RECAPTCHA_PUBLIC_KEY, publicKey);
} }
public static String getReCaptchaPublicKey() { public String getReCaptchaPublicKey() {
return JiveGlobals.getProperty(RECAPTCHA_PUBLIC_KEY); return JiveGlobals.getProperty(RECAPTCHA_PUBLIC_KEY);
} }
public static void setReCaptchaPrivateKey(String privateKey) { public void setReCaptchaPrivateKey(String privateKey) {
JiveGlobals.setProperty(RECAPTCHA_PRIVATE_KEY, privateKey); JiveGlobals.setProperty(RECAPTCHA_PRIVATE_KEY, privateKey);
} }
public static String getReCaptchaPrivateKey() { public String getReCaptchaPrivateKey() {
return JiveGlobals.getProperty(RECAPTCHA_PRIVATE_KEY); return JiveGlobals.getProperty(RECAPTCHA_PRIVATE_KEY);
} }
public static void setGroup(String group) { public void setGroup(String group) {
JiveGlobals.setProperty(REGISTRAION_GROUP, group); JiveGlobals.setProperty(REGISTRAION_GROUP, group);
} }
public static String getGroup() { public String getGroup() {
return JiveGlobals.getProperty(REGISTRAION_GROUP); return JiveGlobals.getProperty(REGISTRAION_GROUP);
} }
public static void setHeader(String message) { public void setHeader(String message) {
JiveGlobals.setProperty(HEADER, message); JiveGlobals.setProperty(HEADER, message);
} }
public static String getHeader() { public String getHeader() {
return JiveGlobals.getProperty(HEADER, "Web Sign-In"); return JiveGlobals.getProperty(HEADER, "Web Sign-In");
} }
...@@ -409,7 +401,7 @@ public class RegistrationPlugin implements Plugin { ...@@ -409,7 +401,7 @@ public class RegistrationPlugin implements Plugin {
} }
} }
private static String propPrep(Collection<String> props) { private String propPrep(Collection<String> props) {
StringBuilder buf = new StringBuilder(); StringBuilder buf = new StringBuilder();
Iterator<String> iter = props.iterator(); Iterator<String> iter = props.iterator();
while (iter.hasNext()) { while (iter.hasNext()) {
...@@ -423,7 +415,7 @@ public class RegistrationPlugin implements Plugin { ...@@ -423,7 +415,7 @@ public class RegistrationPlugin implements Plugin {
return buf.toString(); return buf.toString();
} }
public static boolean isValidAddress(String address) { public boolean isValidAddress(String address) {
if (address == null) { if (address == null) {
return false; return false;
} }
......
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