r24985: Start to revert us back to the old-style SWAT, while trying not to
loose some of the fixes in the meantime. Andrew Bartlett
13
swat/cldap_server/index.esp
Normal file
@ -0,0 +1,13 @@
|
||||
<% page_header("columns", "CLDAP Server", "servers");
|
||||
|
||||
libinclude("base.js");
|
||||
libinclude("management.js");
|
||||
%>
|
||||
|
||||
<h1>CLDAP Server</h1>
|
||||
|
||||
<%
|
||||
writefln("Status: %s\n", server_status("cldap"));
|
||||
%>
|
||||
|
||||
<% page_footer(); %>
|
261
swat/desktop/index.esp
Normal file
@ -0,0 +1,261 @@
|
||||
<%
|
||||
libinclude("base.js");
|
||||
page_header("desktop", "Virtual Desktop Design Test", "desktop");
|
||||
%>
|
||||
|
||||
<script type="text/javascript" src="/scripting/client/encoder.js"></script>
|
||||
<script type="text/javascript" src="/scripting/client/call.js"></script>
|
||||
<script type="text/javascript" src="/scripting/client/js_scripts.js"></script>
|
||||
<script type="text/javascript" src="/scripting/client/desktop.js"></script>
|
||||
<script type="text/javascript" src="/scripting/client/status.js"></script>
|
||||
<script type="text/javascript" src="/scripting/client/regedit.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function showMessage(m)
|
||||
{
|
||||
var message = new QxWindow();
|
||||
with(message) {
|
||||
setWidth(300);
|
||||
setTop("35%");
|
||||
setLeft("35%");
|
||||
setShowMaximize(false);
|
||||
setShowMinimize(false);
|
||||
}
|
||||
|
||||
var note = new QxAtom(m);
|
||||
with(note) {
|
||||
setTop(10);
|
||||
setLeft(10);
|
||||
}
|
||||
|
||||
var ok = new QxButton("OK");
|
||||
with(ok) {
|
||||
setLeft("42%");
|
||||
setBottom(2);
|
||||
}
|
||||
ok.addEventListener("click", function() {
|
||||
doc.remove(message);
|
||||
});
|
||||
|
||||
message.add(note);
|
||||
message.add(ok);
|
||||
doc.add(message);
|
||||
message.setVisible(true);
|
||||
}
|
||||
|
||||
function blankW()
|
||||
{
|
||||
var blank = new Window.standard('SWAT');
|
||||
doc.add(blank);
|
||||
blank.setVisible(true);
|
||||
}
|
||||
|
||||
function showReg()
|
||||
{
|
||||
document.js.add('/scripting/client/regedit.js');
|
||||
|
||||
var regWin = new QxWindow("Registry Editor");
|
||||
regWin._onclosebuttonclick = function(e)
|
||||
{
|
||||
this.close();
|
||||
e.stopPropagation();
|
||||
document.js.remove('/scripting/client/regedit.js');
|
||||
};
|
||||
with(regWin) {
|
||||
setTop(100);
|
||||
setLeft(100);
|
||||
setMinWidth(450);
|
||||
setMinHeight(450);
|
||||
}
|
||||
|
||||
var regedit = regedit_widget("ncalrpc:");
|
||||
regWin.add(regedit);
|
||||
doc.add(regWin);
|
||||
regWin.setVisible('true');
|
||||
}
|
||||
|
||||
function clientContextMenu(e)
|
||||
{
|
||||
var aboutCmd = new QxCommand();
|
||||
aboutCmd.addEventListener("execute", function() {
|
||||
showMessage("SWAT, the Samba Web Administration Tool.<br/>This tool is currently under development.");
|
||||
});
|
||||
|
||||
var newWin = new QxCommand();
|
||||
newWin.addEventListener("execute", blankW);
|
||||
|
||||
var cmenu = new QxMenu;
|
||||
|
||||
var sub1 = new QxMenuButton("About SWAT", null, aboutCmd);
|
||||
var sep = new QxMenuSeparator();
|
||||
var sub2 = new QxMenuButton("New Window", null, newWin);
|
||||
|
||||
cmenu.add(sub1, sep, sub2);
|
||||
|
||||
cmenu.setLeft(e.getClientX());
|
||||
cmenu.setTop(e.getClientY());
|
||||
doc.add(cmenu);
|
||||
cmenu.setVisible(true);
|
||||
}
|
||||
|
||||
function windowContextMenu(t, e)
|
||||
{
|
||||
var WinWin = new QxCommand();
|
||||
WinWin.addEventListener("execute", function() {
|
||||
var blank = new QxWindow();
|
||||
t.add(blank);
|
||||
blank.setVisible(true);
|
||||
});
|
||||
|
||||
var inset = new QxMenu;
|
||||
var sub1 = new QxMenuButton("Open window in a window", null, WinWin);
|
||||
|
||||
inset.add(sub1);
|
||||
t.add(inset)
|
||||
|
||||
inset.setVisible(true);
|
||||
}
|
||||
|
||||
function startMenu()
|
||||
{
|
||||
var sMenu = new QxMenu;
|
||||
with(sMenu) {
|
||||
setWidth(150);
|
||||
setHeight(150);
|
||||
}
|
||||
|
||||
var srvMenu = new QxMenu;
|
||||
var srv1 = new QxMenuButton("LDAP Server", null);
|
||||
var srv2 = new QxMenuButton("CDAP Server", null);
|
||||
var srv3 = new QxMenuButton("RPC Server", null);
|
||||
var srv4 = new QxMenuButton("NBT Server", null);
|
||||
var srv5 = new QxMenuButton("WINS Server", null);
|
||||
var srv6 = new QxMenuButton("Kerberos Server", null);
|
||||
srvMenu.add(srv1, srv2, srv3, srv4, srv5, srv6);
|
||||
doc.add(srvMenu);
|
||||
srvMenu.setVisible(false);
|
||||
|
||||
var editReg = new QxCommand;
|
||||
editReg.addEventListener("execute", function() {
|
||||
showReg();
|
||||
});
|
||||
|
||||
var espMenu = new QxMenu;
|
||||
var esp1 = new QxMenuButton("Registry Editor", null, editReg);
|
||||
espMenu.add(esp1);
|
||||
doc.add(espMenu);
|
||||
espMenu.setVisible(false);
|
||||
|
||||
var opt1 = new QxMenuButton("Servers", null)
|
||||
opt1.addEventListener("mouseover", function() {
|
||||
srvMenu.setVisible(true);
|
||||
srvMenu.setLeft(this.getComputedPageBoxRight() + 4);
|
||||
srvMenu.setTop(this.getComputedPageBoxTop() - 3);
|
||||
if (espMenu.getVisible()) {
|
||||
espMenu.setVisible(false);
|
||||
} else if (newMenu.getVisible()) {
|
||||
newMenu.setVisible(false);
|
||||
}
|
||||
});
|
||||
|
||||
var openWin = new QxCommand;
|
||||
openWin.addEventListener("execute", function() {
|
||||
blankW();
|
||||
});
|
||||
|
||||
var newMenu = new QxMenu;
|
||||
var new1 = new QxMenuButton("Window", null, openWin);
|
||||
newMenu.add(new1);
|
||||
doc.add(newMenu);
|
||||
newMenu.setVisible(false);
|
||||
|
||||
var opt2 = new QxMenuButton("Installation", null);
|
||||
var opt3 = new QxMenuButton("Configuration", null);
|
||||
var opt4 = new QxMenuButton("ESP Tests", null);
|
||||
opt4.addEventListener("mouseover", function() {
|
||||
espMenu.setVisible(true);
|
||||
espMenu.setLeft(this.getComputedPageBoxRight() + 4);
|
||||
espMenu.setTop(this.getComputedPageBoxTop() - 3);
|
||||
if (srvMenu.getVisible()) {
|
||||
srvMenu.setVisible(false);
|
||||
} else if (newMenu.getVisible()) {
|
||||
newMenu.setVisible(false);
|
||||
}
|
||||
});
|
||||
var opt5 = new QxMenuButton("Documentation", null);
|
||||
var opt6 = new QxMenuButton("New", null);
|
||||
opt6.addEventListener("mouseover", function() {
|
||||
newMenu.setVisible(true);
|
||||
newMenu.setLeft(this.getComputedPageBoxRight() + 4);
|
||||
newMenu.setTop(this.getComputedPageBoxTop() - 3);
|
||||
if (srvMenu.getVisible()) {
|
||||
srvMenu.setVisible(false);
|
||||
} else if (espMenu.getVisible()) {
|
||||
espMenu.setVisible(false);
|
||||
}
|
||||
});
|
||||
var sep1 = new QxMenuSeparator();
|
||||
var sep2 = new QxMenuSeparator();
|
||||
|
||||
sMenu.add(opt1, opt2, opt3, sep1, opt4, sep2, opt5, opt6);
|
||||
sMenu.setLeft(0);
|
||||
sMenu.setTop(docY() - 150);
|
||||
doc.add(sMenu);
|
||||
sMenu.setVisible(true);
|
||||
}
|
||||
|
||||
function contextMenu(e)
|
||||
{
|
||||
var t = e.getTarget()
|
||||
var tObj = t.getHtmlAttribute("class")
|
||||
|
||||
if (tObj == 'QxClientDocument QxThemeWin9x') {
|
||||
clientContextMenu(e);
|
||||
} else if (tObj == 'QxWindowPane') {
|
||||
windowContextMenu(t, e);
|
||||
}
|
||||
}
|
||||
|
||||
window.application.main = function()
|
||||
{
|
||||
doc = this.getClientWindow().getClientDocument();
|
||||
doc.addEventListener("contextmenu", contextMenu);
|
||||
|
||||
var bar = new QxMenuBar;
|
||||
with (bar) {
|
||||
setBottom(0);
|
||||
setLeft(0);
|
||||
setWidth("100%");
|
||||
setHeight(25);
|
||||
setBackgroundColor("ThreeDFace");
|
||||
}
|
||||
|
||||
var start = new QxMenuButton("START");
|
||||
start.addEventListener("click", function() {
|
||||
startMenu();
|
||||
});
|
||||
bar.add(start);
|
||||
|
||||
doc.add(bar);
|
||||
|
||||
// Always open with stats
|
||||
var win = new QxWindow();
|
||||
document.js.add('/scripting/client/status.js');
|
||||
win._onclosebuttonclick = function(e)
|
||||
{
|
||||
this.close();
|
||||
e.stopPropagation();
|
||||
document.js.remove('/scripting/client/status.js');
|
||||
};
|
||||
with(win) {
|
||||
setTop(50);
|
||||
setRight(50);
|
||||
setHeight(175);
|
||||
}
|
||||
doc.add(win);
|
||||
getServerStatus(win);
|
||||
}
|
||||
</script>
|
||||
|
||||
<% page_footer(); %>
|
32
swat/esptest/exception.esp
Normal file
@ -0,0 +1,32 @@
|
||||
<% page_header("columns", "ESP Exception test", "esptest");
|
||||
include("/scripting/forms.js");
|
||||
%>
|
||||
|
||||
<h1>Samba4 exception test</h1>
|
||||
|
||||
|
||||
<%
|
||||
var f = FormObj("ExceptionTest", 0, 2);
|
||||
f.submit[0] = "Generate Exception";
|
||||
f.submit[1] = "No Exception";
|
||||
|
||||
f.display();
|
||||
|
||||
if (request['REQUEST_METHOD'] == "POST") {
|
||||
function TestFunction(arg1, arg2) {
|
||||
return "OK";
|
||||
}
|
||||
|
||||
if (form['submit'] == "Generate Exception") {
|
||||
write("I expect you to die Mr Bond!<br>\n");
|
||||
TestFunction("foo");
|
||||
} else {
|
||||
write("no exception<br>\n");
|
||||
TestFunction("foo", "bar");
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
and here is some filler text ...
|
||||
|
||||
<% page_footer(); %>
|
35
swat/esptest/formtest.esp
Normal file
@ -0,0 +1,35 @@
|
||||
<% page_header("columns", "ESP Form Test", "esptest");
|
||||
include("/scripting/forms.js");
|
||||
%>
|
||||
|
||||
<%
|
||||
var f = FormObj("FormTest", 3, 2);
|
||||
f.element[0].label = "First Name";
|
||||
f.element[0].name = "firstName";
|
||||
f.element[0].value = form['firstName'];
|
||||
f.element[1].label = "Last Name";
|
||||
f.element[1].name = "lastName";
|
||||
f.element[1].value = form['lastName'];
|
||||
f.element[2].label = "Color";
|
||||
f.element[2].type = "select";
|
||||
f.element[2].list = new Array("Red", "Green", "Blue", "Yellow");
|
||||
f.element[2].value = form['Color'];
|
||||
f.submit[0] = "OK";
|
||||
f.submit[1] = "Cancel";
|
||||
|
||||
f.display();
|
||||
|
||||
<%
|
||||
/* if its a post then the user has filled in the form, so
|
||||
report the values
|
||||
*/
|
||||
if (form['submit'] == "OK") {
|
||||
%>
|
||||
You chose firstName=@@form['firstName'] lastName=@@form['lastName']<p>
|
||||
|
||||
<%
|
||||
simple_table(form);
|
||||
}
|
||||
%>
|
||||
|
||||
<% page_footer(); %>
|
14
swat/esptest/include.esp
Normal file
@ -0,0 +1,14 @@
|
||||
<% page_header("columns", "ESP Include Test", "esptest"); %>
|
||||
|
||||
including /scripting/test.ejs<p/>
|
||||
<% include("/scripting/test.ejs"); %>
|
||||
calling a function from test.ejs ...<p/>
|
||||
<% showArray("request", request); %>
|
||||
|
||||
including /scripting/test.esp<p/>
|
||||
<% include /scripting/test.esp %>
|
||||
calling a function from test.esp ...<p/>
|
||||
<% res = testfn('foo'); %>
|
||||
result is: @@res
|
||||
|
||||
<% page_footer(); %>
|
7
swat/esptest/index.esp
Normal file
@ -0,0 +1,7 @@
|
||||
<% page_header("columns", "ESP Tests", "esptest"); %>
|
||||
|
||||
<h1>ESP Test functions</h1>
|
||||
|
||||
Please select a menu item from the selection on the left
|
||||
|
||||
<% page_footer(); %>
|
36
swat/esptest/ldb.esp
Normal file
@ -0,0 +1,36 @@
|
||||
<% page_header("columns", "ESP ldb test", "esptest"); %>
|
||||
|
||||
<h1>Samba4 ldb test</h1>
|
||||
|
||||
<h3>An attribute constrained search</h3>
|
||||
|
||||
<%
|
||||
var lp = loadparm_init();
|
||||
var dbfile = lp.get("sam database");
|
||||
var attrs = new Array("name", "dnsDomain", "objectSid", "dn");
|
||||
var ldb = ldb_init();
|
||||
ldb.session_info = session.authinfo.session_info;
|
||||
|
||||
var ok = ldb.connect(dbfile);
|
||||
assert(ok);
|
||||
|
||||
res = ldb.search("(objectClass=domain)", NULL, ldb.SCOPE_DEFAULT, attrs);
|
||||
multi_table(res, "dn");
|
||||
%>
|
||||
|
||||
<h3>An unconstrained search</h3>
|
||||
|
||||
<%
|
||||
res = ldb.search("(objectClass=user)");
|
||||
multi_table(res, "dn");
|
||||
%>
|
||||
|
||||
<h3>A search with bad arguments</h3>
|
||||
|
||||
<%
|
||||
res = ldb.search("=blah", "foo");
|
||||
%>
|
||||
|
||||
all done
|
||||
|
||||
<% page_footer() %>
|
75
swat/esptest/loadparm.esp
Normal file
@ -0,0 +1,75 @@
|
||||
<% page_header("columns", "ESP loadparm test", "esptest" );
|
||||
include("/scripting/forms.js");
|
||||
%>
|
||||
|
||||
<h1>Samba4 loadparm test</h1>
|
||||
|
||||
<%
|
||||
lp = loadparm_init();
|
||||
|
||||
var f = FormObj("LoadparmTest", 2, 1);
|
||||
f.element[0].label = "Share";
|
||||
f.element[1].label = "Parameter";
|
||||
f.submit[0] = "OK";
|
||||
|
||||
f.display();
|
||||
|
||||
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("/");
|
||||
}
|
||||
|
||||
var v;
|
||||
|
||||
share = form['Share'];
|
||||
name = form['Parameter'];
|
||||
if (share && name) {
|
||||
v = lp.get(share, name);
|
||||
} else if (name) {
|
||||
v = lp.get(name);
|
||||
}
|
||||
|
||||
showValue(name, v);
|
||||
}
|
||||
%>
|
||||
|
||||
Here are some commonly used parameters:<p>
|
||||
|
||||
<%
|
||||
showValue("defined services", lp.services());
|
||||
|
||||
function showParameter(name) {
|
||||
showValue(name, lp.get(name));
|
||||
}
|
||||
|
||||
showParameter("server services");
|
||||
showParameter("netbios name");
|
||||
showParameter("security");
|
||||
showParameter("workgroup");
|
||||
showParameter("log level");
|
||||
showParameter("server signing");
|
||||
showParameter("interfaces");
|
||||
%>
|
||||
|
||||
<% page_footer(); %>
|
133
swat/esptest/qooxdoo.esp
Normal file
@ -0,0 +1,133 @@
|
||||
<%
|
||||
/******************************/
|
||||
/* server side AJAJ functions */
|
||||
libinclude("server_call.js");
|
||||
|
||||
/* this is a call that the client js code can make - it just adds
|
||||
some more elements to the passed object, then returns the object */
|
||||
function testfunc(x) {
|
||||
var sys = sys_init();
|
||||
x.nttime = sys.nttime();
|
||||
x.timestring = sys.httptime(x.nttime);
|
||||
return x;
|
||||
}
|
||||
|
||||
/* register a call for clients to make */
|
||||
var call = servCallObj();
|
||||
call.add('testfunc', testfunc);
|
||||
|
||||
/* run the function that was asked for */
|
||||
call.run();
|
||||
|
||||
/***********************/
|
||||
/* now the main page */
|
||||
page_header("columns", "ESP qooxdoo test", "esptest");
|
||||
%>
|
||||
|
||||
<script type="text/javascript" src="/scripting/client/encoder.js"></script>
|
||||
<script type="text/javascript" src="/scripting/client/call.js"></script>
|
||||
|
||||
<h1>Samba4 qooxdoo test</h1>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
window.application.main = function()
|
||||
{
|
||||
var inlineWidget = new QxInline;
|
||||
var fieldSet = new QxFieldSet("thefieldset");
|
||||
|
||||
with(fieldSet)
|
||||
{
|
||||
setWidth("40%");
|
||||
setMinHeight(400);
|
||||
setBottom(48);
|
||||
setMinWidth(500);
|
||||
};
|
||||
|
||||
var gl = new QxGridLayout("auto,auto,auto,auto,auto", "100%");
|
||||
gl.setEdge(0);
|
||||
gl.setCellPaddingTop(3);
|
||||
gl.setCellPaddingBottom(3);
|
||||
|
||||
inlineWidget.add(fieldSet);
|
||||
|
||||
var d = this.getClientWindow().getDocument();
|
||||
|
||||
var stopit = 0;
|
||||
var shared = new Object();
|
||||
|
||||
function callback(o) {
|
||||
shared = o;
|
||||
var r = "Response:\\n";
|
||||
for (var i in shared) {
|
||||
r = r + "\\t" + i + " : " + shared[i] + "\\n";
|
||||
}
|
||||
ta.setText(r);
|
||||
if (shared.start_time == 0) {
|
||||
shared.start_time = shared.nttime;
|
||||
}
|
||||
shared.time_diff = shared.nttime - shared.start_time;
|
||||
shared.rate = shared.counter / (shared.time_diff * 0.0000001);
|
||||
shared.counter++;
|
||||
if (stopit == 0) {
|
||||
server_call_url("@@request.REQUEST_URI", 'testfunc', callback, shared);
|
||||
}
|
||||
}
|
||||
|
||||
function start_call() {
|
||||
srv_printf("Starting calls ... (stopit=%d)\\n", stopit);
|
||||
stopit = 0;
|
||||
shared.counter = 0;
|
||||
shared.start_time = 0;
|
||||
server_call_url("@@request.REQUEST_URI", 'testfunc', callback, shared);
|
||||
};
|
||||
|
||||
function stop_call() {
|
||||
srv_printf("Stopping calls\\n");
|
||||
stopit = 1;
|
||||
};
|
||||
|
||||
function myButton(name, label, call) {
|
||||
var b = new QxButton(label);
|
||||
b.setWidth("25%");
|
||||
b.addEventListener("click", call);
|
||||
return b;
|
||||
};
|
||||
|
||||
function myCheckBox(label, name, value) {
|
||||
var w = new QxCheckBox(label, value, name, value);
|
||||
w.setWidth("100%");
|
||||
return w;
|
||||
}
|
||||
|
||||
var c1 = myCheckBox("Enable The Server", 'checkbox1', false);
|
||||
var c2 = myCheckBox("Another Server", 'checkbox2', true);
|
||||
var t3 = new QxTextField("hello");
|
||||
var b1 = myButton("send", "Make Call", start_call);
|
||||
var b2 = myButton("stop", "Stop Call", stop_call);
|
||||
var ta = new QxTextArea;
|
||||
ta.setText("initial text");
|
||||
ta.setWidth("80%");
|
||||
ta.setHeight(150);
|
||||
ta.setVerticalAlign("top");
|
||||
|
||||
gl.add(c1, { row : 1, col : 1 });
|
||||
gl.add(c2, { row : 2, col : 1 });
|
||||
gl.add(t3, { row : 3, col : 1, scaleHorizontal: true });
|
||||
gl.add(b1, { row : 4, col : 1 });
|
||||
gl.add(ta, { row : 5, col : 1 });
|
||||
gl.add(b2, { row : 6, col : 1 });
|
||||
|
||||
fieldSet.add(gl);
|
||||
|
||||
inlineWidget.add(fieldSet);
|
||||
|
||||
d.add(inlineWidget, "canvas");
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<div id="canvas" style="overflow:hidden;position:static;margin-top:38px;margin-left:10px;margin-right:700px;width:700px"></div>
|
||||
|
||||
<% page_footer(); %>
|
50
swat/esptest/registry.esp
Normal file
@ -0,0 +1,50 @@
|
||||
<%
|
||||
page_header("columns", "ESP registry edit", "esptest");
|
||||
%>
|
||||
|
||||
<script type="text/javascript" src="/scripting/client/encoder.js"></script>
|
||||
<script type="text/javascript" src="/scripting/client/call.js"></script>
|
||||
<script type="text/javascript" src="/scripting/client/regedit.js"></script>
|
||||
|
||||
<h1>Registry Editor</h1>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
/*** init the page for qooxdoo ***/
|
||||
window.application.main = function()
|
||||
{
|
||||
var doc = this.getClientWindow().getDocument();
|
||||
var inlineWidget = new QxInline;
|
||||
var qwidget = new QxWidget;
|
||||
qwidget.setHeight(800);
|
||||
qwidget.setWidth("100%");
|
||||
qwidget.setBorder(QxBorder.presets.groove);
|
||||
|
||||
var btn1 = new QxButton("Registry Editor");
|
||||
btn1.set({ top: 20, left : 30 });
|
||||
btn1.addEventListener("click", function() {
|
||||
var regWindow = new QxWindow("Registry Editor");
|
||||
with(regWindow) {
|
||||
setTop(50);
|
||||
setLeft(50);
|
||||
setMinWidth(600);
|
||||
setMinHeight(600);
|
||||
setResizeMethod("frame");
|
||||
}
|
||||
|
||||
var regedit = regedit_widget("ncalrpc:");
|
||||
regWindow.add(regedit);
|
||||
qwidget.add(regWindow);
|
||||
regWindow.setVisible(true);
|
||||
|
||||
});
|
||||
qwidget.add(btn1);
|
||||
inlineWidget.add(qwidget);
|
||||
doc.add(inlineWidget, "canvas");
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div id="canvas" style="overflow:hidden;position:static;margin-top:38px;margin-left:10px;margin-right:700px;width:700px"></div>
|
||||
|
||||
<% page_footer(); %>
|
36
swat/esptest/samr.esp
Normal file
@ -0,0 +1,36 @@
|
||||
<% page_header("columns", "ESP samr test", "esptest");
|
||||
|
||||
libinclude("base.js");
|
||||
libinclude("samr.js");
|
||||
%>
|
||||
|
||||
<h1>Samba4 samr rpc test</h1>
|
||||
|
||||
<%
|
||||
var conn = samr_init();
|
||||
var binding = "ncalrpc:";
|
||||
status = conn.connect(binding);
|
||||
check_status_ok(status);
|
||||
|
||||
handle = samrConnect(conn);
|
||||
|
||||
domains = samrEnumDomains(conn, handle);
|
||||
|
||||
for (i=0;i<domains.length;i++) {
|
||||
write("<h2>Domain " + domains[i].name + "</h2>\n");
|
||||
sid = samrLookupDomain(conn, handle, domains[i].name);
|
||||
dom_handle = samrOpenDomain(conn, handle, sid);
|
||||
users = samrEnumDomainUsers(conn, dom_handle);
|
||||
samrFillUserInfo(conn, dom_handle, users, 3);
|
||||
if (users.length == 0) {
|
||||
write("no users in domain<br>\n");
|
||||
} else {
|
||||
multi_table(users, "name");
|
||||
}
|
||||
samrClose(conn, dom_handle);
|
||||
}
|
||||
|
||||
%>
|
||||
|
||||
|
||||
<% page_footer(); %>
|
53
swat/esptest/session.esp
Normal file
@ -0,0 +1,53 @@
|
||||
<% page_header("columns", "ESP session test", "esptest");
|
||||
include("/scripting/forms.js");
|
||||
%>
|
||||
|
||||
<h1>Samba4 session test</h1>
|
||||
|
||||
<%
|
||||
var f = FormObj("SessionTest", 3, 4);
|
||||
f.element[0].label = "Name";
|
||||
f.element[1].label = "Value";
|
||||
f.element[2].label = "Timeout";
|
||||
f.submit[0] = "Append";
|
||||
f.submit[1] = "Reset";
|
||||
f.submit[2] = "Destroy";
|
||||
f.submit[3] = "Cancel";
|
||||
|
||||
f.display();
|
||||
|
||||
/* if its a post then the user has filled in the form, so
|
||||
report the values
|
||||
*/
|
||||
if (request['REQUEST_METHOD'] == "POST") {
|
||||
/* if they cancelled then take them back to the list of tests */
|
||||
if (form['submit'] == "Cancel") {
|
||||
redirect("/");
|
||||
}
|
||||
|
||||
name = form['Name'];
|
||||
value = form['Value'];
|
||||
timeout = form['Timeout'];
|
||||
|
||||
if (timeout) {
|
||||
useSession(timeout);
|
||||
}
|
||||
|
||||
if (form['submit'] == "Reset" && name) {
|
||||
session[name] = null;
|
||||
}
|
||||
|
||||
if (form['submit'] == "Append" && name) {
|
||||
session[name] = "" + session[name] + value;
|
||||
}
|
||||
|
||||
if (form['submit'] == "Destroy") {
|
||||
destroySession();
|
||||
}
|
||||
}
|
||||
|
||||
simple_table(session);
|
||||
write("SessionId=" + request['SESSION_ID'] + "<br/>\n");
|
||||
%>
|
||||
|
||||
<% page_footer(); %>
|
24
swat/esptest/showvars.esp
Normal file
@ -0,0 +1,24 @@
|
||||
<% page_header("columns", "ESP standard variables test", "esptest"); %>
|
||||
|
||||
<h1>Samba4 showvars test</h1>
|
||||
|
||||
<%
|
||||
function showArray(name, array) {
|
||||
write("<h3>Array: " + name + "</h3>\n");
|
||||
if (array == undefined) {
|
||||
write("undefined<br>\n");
|
||||
} else {
|
||||
simple_table(array);
|
||||
}
|
||||
}
|
||||
|
||||
showArray("headers", headers);
|
||||
showArray("application", application);
|
||||
showArray("cookies", cookies);
|
||||
showArray("files", files);
|
||||
showArray("request", request);
|
||||
showArray("server", server);
|
||||
showArray("session", session);
|
||||
%>
|
||||
|
||||
<% page_footer(); %>
|
BIN
swat/favicon.ico
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
swat/images/core/alpha.gif
Normal file
After Width: | Height: | Size: 64 B |
BIN
swat/images/core/blank.gif
Normal file
After Width: | Height: | Size: 49 B |
BIN
swat/images/core/brightness.jpg
Normal file
After Width: | Height: | Size: 456 B |
BIN
swat/images/core/brightnesshandle.gif
Normal file
After Width: | Height: | Size: 80 B |
BIN
swat/images/core/dotted.gif
Normal file
After Width: | Height: | Size: 44 B |
BIN
swat/images/core/huesaturation.jpg
Normal file
After Width: | Height: | Size: 6.2 KiB |
BIN
swat/images/core/huesaturationhandle.gif
Normal file
After Width: | Height: | Size: 63 B |
BIN
swat/images/favicon.ico
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
swat/images/icons/crystalsvg/128/antivirus.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
swat/images/icons/crystalsvg/128/back.png
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
swat/images/icons/crystalsvg/128/background.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
swat/images/icons/crystalsvg/128/bell.png
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
swat/images/icons/crystalsvg/128/blockdevice.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
swat/images/icons/crystalsvg/128/browser.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
swat/images/icons/crystalsvg/128/cache.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
swat/images/icons/crystalsvg/128/clock.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
swat/images/icons/crystalsvg/128/colors.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
swat/images/icons/crystalsvg/128/core.png
Normal file
After Width: | Height: | Size: 5.0 KiB |
BIN
swat/images/icons/crystalsvg/128/date.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
swat/images/icons/crystalsvg/128/desktop.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
swat/images/icons/crystalsvg/128/display.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
swat/images/icons/crystalsvg/128/document.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
swat/images/icons/crystalsvg/128/email.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
swat/images/icons/crystalsvg/128/empty.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
swat/images/icons/crystalsvg/128/encrypted.png
Normal file
After Width: | Height: | Size: 9.9 KiB |
BIN
swat/images/icons/crystalsvg/128/energy.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
swat/images/icons/crystalsvg/128/error.png
Normal file
After Width: | Height: | Size: 8.7 KiB |
BIN
swat/images/icons/crystalsvg/128/exec.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
swat/images/icons/crystalsvg/128/fileprint.png
Normal file
After Width: | Height: | Size: 5.0 KiB |
BIN
swat/images/icons/crystalsvg/128/folder.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
swat/images/icons/crystalsvg/128/folder_home.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
swat/images/icons/crystalsvg/128/folder_important.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
swat/images/icons/crystalsvg/128/folder_locked.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
swat/images/icons/crystalsvg/128/folder_open.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
swat/images/icons/crystalsvg/128/font.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
swat/images/icons/crystalsvg/128/forward.png
Normal file
After Width: | Height: | Size: 9.3 KiB |
BIN
swat/images/icons/crystalsvg/128/gohome.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
swat/images/icons/crystalsvg/128/hwinfo.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
swat/images/icons/crystalsvg/128/info.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
swat/images/icons/crystalsvg/128/kcoloredit.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
swat/images/icons/crystalsvg/128/kcontrol.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
swat/images/icons/crystalsvg/128/keyboard.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
swat/images/icons/crystalsvg/128/khelpcenter.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
swat/images/icons/crystalsvg/128/konqueror.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
swat/images/icons/crystalsvg/128/kpaint.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
swat/images/icons/crystalsvg/128/krita.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
swat/images/icons/crystalsvg/128/ksmiletris.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
swat/images/icons/crystalsvg/128/ksnapshot.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
swat/images/icons/crystalsvg/128/ktalkd.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
swat/images/icons/crystalsvg/128/kuser.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
swat/images/icons/crystalsvg/128/kview.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
swat/images/icons/crystalsvg/128/linuxconf.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
swat/images/icons/crystalsvg/128/locale.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
swat/images/icons/crystalsvg/128/looknfeel.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
swat/images/icons/crystalsvg/128/mac.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
swat/images/icons/crystalsvg/128/mail.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
swat/images/icons/crystalsvg/128/mimetypes.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
swat/images/icons/crystalsvg/128/mouse.png
Normal file
After Width: | Height: | Size: 9.0 KiB |
BIN
swat/images/icons/crystalsvg/128/mozilla.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
swat/images/icons/crystalsvg/128/mycomputer.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
swat/images/icons/crystalsvg/128/mymac.png
Normal file
After Width: | Height: | Size: 9.3 KiB |
BIN
swat/images/icons/crystalsvg/128/netscape.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
swat/images/icons/crystalsvg/128/network.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
swat/images/icons/crystalsvg/128/password.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
swat/images/icons/crystalsvg/128/penguin.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
swat/images/icons/crystalsvg/128/proxy.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
swat/images/icons/crystalsvg/128/quicktime.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
swat/images/icons/crystalsvg/128/realplayer.png
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
swat/images/icons/crystalsvg/128/reload.png
Normal file
After Width: | Height: | Size: 8.9 KiB |
BIN
swat/images/icons/crystalsvg/128/services.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
swat/images/icons/crystalsvg/128/socket.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
swat/images/icons/crystalsvg/128/stylesheet.png
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
swat/images/icons/crystalsvg/128/tux.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
swat/images/icons/crystalsvg/128/up.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
swat/images/icons/crystalsvg/16/access.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
swat/images/icons/crystalsvg/16/agent.png
Normal file
After Width: | Height: | Size: 828 B |
BIN
swat/images/icons/crystalsvg/16/antivirus.png
Normal file
After Width: | Height: | Size: 788 B |
BIN
swat/images/icons/crystalsvg/16/appearance.png
Normal file
After Width: | Height: | Size: 1023 B |
BIN
swat/images/icons/crystalsvg/16/apply.png
Normal file
After Width: | Height: | Size: 661 B |
BIN
swat/images/icons/crystalsvg/16/back.png
Normal file
After Width: | Height: | Size: 868 B |
BIN
swat/images/icons/crystalsvg/16/background.png
Normal file
After Width: | Height: | Size: 733 B |
BIN
swat/images/icons/crystalsvg/16/bell.png
Normal file
After Width: | Height: | Size: 567 B |
BIN
swat/images/icons/crystalsvg/16/blockdevice.png
Normal file
After Width: | Height: | Size: 794 B |
BIN
swat/images/icons/crystalsvg/16/bookmark.png
Normal file
After Width: | Height: | Size: 690 B |
BIN
swat/images/icons/crystalsvg/16/browser.png
Normal file
After Width: | Height: | Size: 925 B |
BIN
swat/images/icons/crystalsvg/16/button_cancel.png
Normal file
After Width: | Height: | Size: 963 B |