r9434: moved the registry editor into a common js library. Deryck, does this
[kai/samba.git] / swat / scripting / server / regedit.esp
1 <%
2 /* 
3    server side AJAJ functions for registry editing. These go along
4    with scripting/client/regedit.js 
5 */
6 libinclude("base.js");
7 libinclude("winreg.js");
8 libinclude("server_call.js");
9
10 /* 
11    server side call to return a listing of elements in a winreg path
12 */
13 function enum_path(binding, path) {
14         printf("enum_path(%s, %s)\n", binding, path);
15         var reg = winreg_init();
16         security_init(reg);
17
18         reg.credentials = session.authinfo.credentials;
19
20         var status = reg.connect(binding);
21         if (status.is_ok != true) {
22                 printVars(status);
23                 return undefined;
24         }
25         var list = winreg_enum_path(reg, path);
26         return list;
27 }
28
29 /* register a call for clients to make */
30 var call = servCallObj();
31 call.add('enum_path', enum_path);
32
33 /* run the function that was asked for */
34 call.run();
35 %>