summaryrefslogtreecommitdiffstats
path: root/etherpad
diff options
context:
space:
mode:
authorEgil Moeller <egil.moller@freecode.no>2010-04-05 23:24:09 +0200
committerEgil Moeller <egil.moller@freecode.no>2010-04-05 23:24:09 +0200
commit8ab9d08d49839ca30305ef92d8d995963d915746 (patch)
tree7f075afefd7d80f8d8ab1e2bfd8adcd0c24feda4 /etherpad
parent397d10d630db17ef590b330a489f07971673d565 (diff)
downloadetherpad-8ab9d08d49839ca30305ef92d8d995963d915746.tar.gz
etherpad-8ab9d08d49839ca30305ef92d8d995963d915746.tar.bz2
etherpad-8ab9d08d49839ca30305ef92d8d995963d915746.zip
Updated SUPERDOMAINS to use /etc/etherpad.localdev-default.properties
Diffstat (limited to 'etherpad')
-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()) {