summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEgil Moeller <egil.moller@freecode.no>2010-04-05 16:23:32 +0200
committerEgil Moeller <egil.moller@freecode.no>2010-04-05 16:23:32 +0200
commita2d2b610b28bf7c75e65933872ee0655f83da9cf (patch)
treeebf2c0c5677c6aeb9a7ae3dc5162d9b336225b3a
parentea4340f31dab4c6af7632dfc348ea9dfab2799eb (diff)
downloadetherpad-a2d2b610b28bf7c75e65933872ee0655f83da9cf.tar.gz
etherpad-a2d2b610b28bf7c75e65933872ee0655f83da9cf.tar.bz2
etherpad-a2d2b610b28bf7c75e65933872ee0655f83da9cf.zip
Updated the plugin manager to use the admin auth system
-rw-r--r--etherpad/src/etherpad/control/admincontrol.js17
-rw-r--r--etherpad/src/main.js2
2 files changed, 14 insertions, 5 deletions
diff --git a/etherpad/src/etherpad/control/admincontrol.js b/etherpad/src/etherpad/control/admincontrol.js
index 02f6428..ec48824 100644
--- a/etherpad/src/etherpad/control/admincontrol.js
+++ b/etherpad/src/etherpad/control/admincontrol.js
@@ -51,6 +51,8 @@ import("etherpad.collab.collab_server");
import("etherpad.pro.pro_accounts");
import("etherpad.pro.pro_utils");
import("etherpad.pro.domains");
+import("etherpad.admin.plugins");
+import("etherpad.control.admin.pluginmanager");
jimport("java.lang.System.out.println");
@@ -87,7 +89,8 @@ var _mainLinks = [
['reload-blog-db', 'Reload blog DB'],
['pro-domain-accounts', 'Pro Domain Accounts'],
['beta-valve', 'Beta Valve'],
- ['reset-subscription', "Reset Subscription"]
+ ['reset-subscription', "Reset Subscription"],
+ ['pluginmanager/', "Plugin manager"]
];
function onRequest(name) {
@@ -100,7 +103,11 @@ function onRequest(name) {
}
var disp = new Dispatcher();
+
+ disp.addLocations(plugins.callHook("handleAdminPath"));
+
disp.addLocations([
+ [PrefixMatcher('/ep/admin/pluginmanager/'), forward(pluginmanager)],
[PrefixMatcher('/ep/admin/usagestats/'), forward(statscontrol)]
]);
@@ -152,9 +159,13 @@ function render_main() {
div.push(A({href: "/"}, html("&laquo;"), " home"));
div.push(H1("Admin"));
- _mainLinks.forEach(function(l) {
+ function addMenuItem(l) {
div.push(DIV(A({href: l[0]}, l[1])));
- });
+ }
+
+ plugins.callHook("adminMenu").forEach(addMenuItem);
+ _mainLinks.forEach(addMenuItem);
+
if (sessions.isAnEtherpadAdmin()) {
div.push(P(A({href: "/ep/admin/setadminmode?v=false"},
"Exit Admin Mode")));
diff --git a/etherpad/src/main.js b/etherpad/src/main.js
index 9035f2d..2d92a1a 100644
--- a/etherpad/src/main.js
+++ b/etherpad/src/main.js
@@ -34,7 +34,6 @@ import("etherpad.importexport.importexport");
import("etherpad.legacy_urls");
import("etherpad.control.aboutcontrol");
-import("etherpad.control.admin.pluginmanager");
import("etherpad.control.admincontrol");
import("etherpad.control.blogcontrol");
import("etherpad.control.connection_diagnostics_control");
@@ -387,7 +386,6 @@ function handlePath() {
[DirMatcher('/ep/beta-account/'), forward(pro_beta_control)],
[DirMatcher('/ep/pro-signup/'), forward(pro_signup_control)],
[DirMatcher('/ep/about/'), forward(aboutcontrol)],
- [DirMatcher('/ep/admin/pluginmanager'), forward(pluginmanager)],
[DirMatcher('/ep/admin/'), forward(admincontrol)],
[DirMatcher('/ep/blog/posts/'), blogcontrol.render_post],
[DirMatcher('/ep/blog/'), forward(blogcontrol)],