From c8dfaec28a470c09430454a52bf3f4206ebf7037 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 8 Aug 2005 03:23:20 +0000 Subject: [PATCH] r9212: the beginnings of a registry editor in SWAT, using client side javascript and AJAJ This doesn't work at all well yet, mostly because of my inexperience with client side javascript and what events are available (This used to be commit 8073e84c7a5fd8d483685d769661c790a803ff49) --- swat/esptest/registry.esp | 120 ++++++++++++++++++++++++++++++++ swat/esptest/registry_calls.esp | 37 ++++++++++ swat/menu.js | 3 +- 3 files changed, 159 insertions(+), 1 deletion(-) create mode 100644 swat/esptest/registry.esp create mode 100644 swat/esptest/registry_calls.esp diff --git a/swat/esptest/registry.esp b/swat/esptest/registry.esp new file mode 100644 index 00000000000..85843c41d9c --- /dev/null +++ b/swat/esptest/registry.esp @@ -0,0 +1,120 @@ +<% + page_header("columns", "ESP registry edit", "esptest"); +%> + + + + +

Registry Editor

+ + + + +
+ +<% page_footer(); %> diff --git a/swat/esptest/registry_calls.esp b/swat/esptest/registry_calls.esp new file mode 100644 index 00000000000..a5c1ae7a124 --- /dev/null +++ b/swat/esptest/registry_calls.esp @@ -0,0 +1,37 @@ +<% +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); + if (path == "\\") { + printf("IN ROOT\n"); + var list = new Array("HKLM", "HKCR", "HKPD"); + return list; + } + printf("binding=%s path=%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(); +%> diff --git a/swat/menu.js b/swat/menu.js index 7e8281349f1..83529825f12 100644 --- a/swat/menu.js +++ b/swat/menu.js @@ -32,7 +32,8 @@ swat_menus.esptest = simple_menu( "loadparm access", session_uri("/esptest/loadparm.esp"), "exception handling", session_uri("/esptest/exception.esp"), "environment variables", session_uri("/esptest/showvars.esp"), - "qooxdoo", session_uri("/esptest/qooxdoo.esp")); + "qooxdoo", session_uri("/esptest/qooxdoo.esp"), + "registry", session_uri("/esptest/registry.esp")); swat_menus.install = simple_menu( -- 2.34.1