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 keys in a winreg path
|
---|
12 | */
|
---|
13 | function enum_keys(binding, path) {
|
---|
14 | printf("enum_keys(%s, %s)\n", binding, path);
|
---|
15 | var reg = winregObj();
|
---|
16 |
|
---|
17 | reg.credentials = session.authinfo.credentials;
|
---|
18 |
|
---|
19 | var status = reg.connect(binding);
|
---|
20 | if (status.is_ok != true) {
|
---|
21 | printVars(status);
|
---|
22 | return undefined;
|
---|
23 | }
|
---|
24 | return reg.enum_path(path);
|
---|
25 | }
|
---|
26 |
|
---|
27 | /*
|
---|
28 | server side call to return a listing of values in a winreg path
|
---|
29 | */
|
---|
30 | function enum_values(binding, path) {
|
---|
31 | printf("enum_values(%s, %s)\n", binding, path);
|
---|
32 | var reg = winregObj();
|
---|
33 |
|
---|
34 | reg.credentials = session.authinfo.credentials;
|
---|
35 |
|
---|
36 | var status = reg.connect(binding);
|
---|
37 | if (status.is_ok != true) {
|
---|
38 | printVars(status);
|
---|
39 | return undefined;
|
---|
40 | }
|
---|
41 | return reg.enum_values(path);
|
---|
42 | }
|
---|
43 |
|
---|
44 | /* register a call for clients to make */
|
---|
45 | var call = servCallObj();
|
---|
46 | call.add('enum_keys', enum_keys);
|
---|
47 | call.add('enum_values', enum_values);
|
---|
48 |
|
---|
49 | /* run the function that was asked for */
|
---|
50 | call.run();
|
---|
51 | %>
|
---|