aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--etherpad/etc/etherpad.localdev-default.properties3
-rw-r--r--etherpad/src/etherpad/globals.js13
-rw-r--r--etherpad/src/etherpad/pro/pro_utils.js4
-rw-r--r--etherpad/src/etherpad/sessions.js2
-rw-r--r--etherpad/src/main.js2
5 files changed, 13 insertions, 11 deletions
diff --git a/etherpad/etc/etherpad.localdev-default.properties b/etherpad/etc/etherpad.localdev-default.properties
index 97f420f..c540d12 100644
--- a/etherpad/etc/etherpad.localdev-default.properties
+++ b/etherpad/etc/etherpad.localdev-default.properties
@@ -15,4 +15,5 @@ modulePath = ./src
transportPrefix = /comet
transportUseWildcardSubdomains = true
useVirtualFileRoot = ./src
-motdPage = /ep/pad/view/ro.3PfHCD0ApLc/latest?fullScreen=1&slider=0&sidebar=0 \ No newline at end of file
+motdPage = /ep/pad/view/ro.3PfHCD0ApLc/latest?fullScreen=1&slider=0&sidebar=0
+topdomains = localhost,redhog.org
diff --git a/etherpad/src/etherpad/globals.js b/etherpad/src/etherpad/globals.js
index 87fe428..fcd5519 100644
--- a/etherpad/src/etherpad/globals.js
+++ b/etherpad/src/etherpad/globals.js
@@ -32,13 +32,14 @@ function isProduction() {
function isProAccountEnabled() {
return (appjet.config['etherpad.proAccounts'] == "true");
}
-
-var SUPERDOMAINS = {
- 'localbox.info': true,
- 'localhost': true,
- 'etherpad.com': true
-};
+function domainEnabled(domain) {
+ var enabled = appjet.config.topdomains.split(',');
+ for (var i = 0; i < enabled.length; i++)
+ if (domain == enabled[i])
+ return true;
+ return false;
+}
var PNE_RELEASE_VERSION = "1.1.3";
var PNE_RELEASE_DATE = "June 15, 2009";
diff --git a/etherpad/src/etherpad/pro/pro_utils.js b/etherpad/src/etherpad/pro/pro_utils.js
index c9874f0..5e8b801 100644
--- a/etherpad/src/etherpad/pro/pro_utils.js
+++ b/etherpad/src/etherpad/pro/pro_utils.js
@@ -72,13 +72,13 @@ function _computeIsProDomainRequest() {
var domain = _stripComet(request.domain);
- if (SUPERDOMAINS[domain]) {
+ if (domainEnabled(domain)) {
return false;
}
var requestSuperdomain = getRequestSuperdomain();
- if (SUPERDOMAINS[requestSuperdomain]) {
+ if (domainEnabled(requestSuperdomain)) {
// now see if this subdomain is actually in our database.
if (domains.getRequestDomainRecord()) {
return true;
diff --git a/etherpad/src/etherpad/sessions.js b/etherpad/src/etherpad/sessions.js
index 633bf0b..3c10963 100644
--- a/etherpad/src/etherpad/sessions.js
+++ b/etherpad/src/etherpad/sessions.js
@@ -156,7 +156,7 @@ function preRequestCookieCheck() {
}
// Only superdomains can set cookies.
- var isSuperdomain = SUPERDOMAINS[request.domain];
+ var isSuperdomain = domainEnabled(request.domain);
if (isSuperdomain) {
// superdomain without cookies
diff --git a/etherpad/src/main.js b/etherpad/src/main.js
index 6faa71a..b77d5ee 100644
--- a/etherpad/src/main.js
+++ b/etherpad/src/main.js
@@ -268,7 +268,7 @@ function checkHost() {
}
// we require the domain to either be <superdomain> or a pro domain request.
- if (SUPERDOMAINS[request.domain]) {
+ if (domainEnabled(request.domain)) {
return;
}
if (pro_utils.isProDomainRequest()) {