diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-05-27 03:59:12 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:17:04 -0500 |
commit | da817b1550c64dbfa581514169637a68b0bc2499 (patch) | |
tree | 786376938846c122b575bcd8b1fdb8046a19312b | |
parent | 1511cde44ccc94b71b8eb317deb73c103dcd8010 (diff) | |
download | samba-da817b1550c64dbfa581514169637a68b0bc2499.tar.gz samba-da817b1550c64dbfa581514169637a68b0bc2499.tar.bz2 samba-da817b1550c64dbfa581514169637a68b0bc2499.zip |
r7003: added an example script for fetching smb.conf parameters from esp scripts
(This used to be commit a9f0caaaf3c72548e61311fe071c6158177bc7f4)
-rw-r--r-- | swat/esptest/index.esp | 2 | ||||
-rw-r--r-- | swat/esptest/loadparm.esp | 74 |
2 files changed, 75 insertions, 1 deletions
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"); %> <HTML> 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 @@ +<HTML> +<TITLE> +Samba4 ESP test +</TITLE> +<BODY> +<h1>Samba4 loadparm test</h1> + +<form name="LoadparmTest" method="POST" action="@@request['SCRIPT_NAME']"> + Share: <input name="Share" type="text" value=""><br> + Parameter: <input name="Name" type="text" value=""><br> + <input name="submit" type="submit" value="OK"> + <input name="submit" type="submit" value="Cancel"><br> +</form> + +<% + +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 + "<br>\n"); + write("Type is: " + typeof(v) + "<br>\n"); + write("Value is: " + stringVar(v) + "<p>\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:<p> + +<% +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"); +%> + +</BODY> +</HTML> |