summaryrefslogtreecommitdiffstats
path: root/swat/esptest/registry.esp
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-08-10 06:58:05 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:31:34 -0500
commit8942ac69f01acc2e09a56e6accef6034622d40d4 (patch)
tree0b89121731965c95eee5e67053538c063815690e /swat/esptest/registry.esp
parent922f28fcbda983dcd6141f7c746d0f228302d368 (diff)
downloadsamba-8942ac69f01acc2e09a56e6accef6034622d40d4.tar.gz
samba-8942ac69f01acc2e09a56e6accef6034622d40d4.tar.xz
samba-8942ac69f01acc2e09a56e6accef6034622d40d4.zip
r9227: cleanup and simplify the AJAJ code
(This used to be commit ceb7669e5991e9dda759d60a09a0a65e6caba991)
Diffstat (limited to 'swat/esptest/registry.esp')
-rw-r--r--swat/esptest/registry.esp42
1 files changed, 39 insertions, 3 deletions
diff --git a/swat/esptest/registry.esp b/swat/esptest/registry.esp
index 2b6a2144734..6adeb78b819 100644
--- a/swat/esptest/registry.esp
+++ b/swat/esptest/registry.esp
@@ -1,4 +1,38 @@
-<%
+<%
+/******************************/
+/* server side AJAJ functions */
+libinclude("base.js");
+libinclude("winreg.js");
+libinclude("server_call.js");
+
+/*
+ server side call to return a listing of elements in a winreg path
+*/
+function enum_path(binding, path) {
+ printf("enum_path(%s, %s)\n", binding, path);
+ var reg = winreg_init();
+ security_init(reg);
+
+ reg.credentials = session.authinfo.credentials;
+
+ var status = reg.connect(binding);
+ if (status.is_ok != true) {
+ printVars(status);
+ return undefined;
+ }
+ var list = winreg_enum_path(reg, path);
+ return list;
+}
+
+/* register a call for clients to make */
+var call = servCallObj();
+call.add('enum_path', enum_path);
+
+/* run the function that was asked for */
+call.run();
+
+ /***********************/
+ /* now the main page */
page_header("columns", "ESP registry edit", "esptest");
%>
@@ -33,7 +67,7 @@ function folder_list(t, list) {
function folder_click(t) {
if (!t.populated) {
- server_call("registry_calls.esp", 'enum_path',
+ server_call_url("@@request.REQUEST_URI", 'enum_path',
function(list) { folder_list(t, list); },
t.binding, t.reg_path);
}
@@ -54,8 +88,10 @@ function registry_tree(binding) {
setWidth(400);
setHeight(400);
setTop(20);
- addEventListener("click", function() { folder_click(t); });
}
+ t.addEventListener("click", function() {
+ var el = this; folder_click(el);
+ });
return t;
}