mirror of
https://github.com/samba-team/samba.git
synced 2025-01-04 05:18:06 +03:00
r7003: added an example script for fetching smb.conf parameters from esp scripts
(This used to be commit a9f0caaaf3
)
This commit is contained in:
parent
1511cde44c
commit
da817b1550
@ -1,5 +1,5 @@
|
|||||||
<%
|
<%
|
||||||
var tests = new Array("formtest", "showvars", "include", "session");
|
var tests = new Array("formtest", "showvars", "include", "session", "loadparm");
|
||||||
%>
|
%>
|
||||||
|
|
||||||
<HTML>
|
<HTML>
|
||||||
|
74
swat/esptest/loadparm.esp
Normal file
74
swat/esptest/loadparm.esp
Normal file
@ -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>
|
Loading…
Reference in New Issue
Block a user