From da817b1550c64dbfa581514169637a68b0bc2499 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 27 May 2005 03:59:12 +0000 Subject: r7003: added an example script for fetching smb.conf parameters from esp scripts (This used to be commit a9f0caaaf3c72548e61311fe071c6158177bc7f4) --- swat/esptest/index.esp | 2 +- swat/esptest/loadparm.esp | 74 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 swat/esptest/loadparm.esp (limited to 'swat/esptest') diff --git a/swat/esptest/index.esp b/swat/esptest/index.esp index f229732e3e..e85937e4bf 100644 --- a/swat/esptest/index.esp +++ b/swat/esptest/index.esp @@ -1,5 +1,5 @@ <% - var tests = new Array("formtest", "showvars", "include", "session"); + var tests = new Array("formtest", "showvars", "include", "session", "loadparm"); %> diff --git a/swat/esptest/loadparm.esp b/swat/esptest/loadparm.esp new file mode 100644 index 0000000000..b5f3c86b1d --- /dev/null +++ b/swat/esptest/loadparm.esp @@ -0,0 +1,74 @@ + + +Samba4 ESP test + + +

Samba4 loadparm test

+ +
+ Share:
+ Parameter:
+ +
+
+ +<% + +function stringVar(v) { + var type = typeof(v); + var ret = ""; + if (type == "object") { + for (val in v) { + ret = ret + " " + v[val]; + } + } else { + ret = ret + v; + } + return ret; +} + +function showValue(name, v) { + write("parameter:" + name + "
\n"); + write("Type is: " + typeof(v) + "
\n"); + write("Value is: " + stringVar(v) + "

\n"); +} + + +if (request['REQUEST_METHOD'] == "POST") { + /* if they cancelled then take them back to the list of tests */ + if (form['submit'] == "Cancel") { + redirect("index.esp"); + } + + var v; + + share = form['Share']; + name = form['Name']; + if (share && name) { + v = lpGet(share, name); + } else if (name) { + v = lpGet(name); + } + + showValue(name, v); +} +%> + +Here are some commonly used parameters:

+ +<% +function showParameter(name) { + showValue(name, lpGet(name)); +} + +showParameter("server services"); +showParameter("netbios name"); +showParameter("security"); +showParameter("workgroup"); +showParameter("log level"); +showParameter("server signing"); +showParameter("interfaces"); +%> + + + -- cgit