1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-02 08:58:33 +03:00

r8648: automatically redirect to provisioning if not yet provisioned when the

home page in swat is accessed
(This used to be commit 78fb559c08d55c01f5ede81d43cdd857cce8d338)
This commit is contained in:
Andrew Tridgell 2005-07-20 11:26:17 +00:00 committed by Gerald (Jerry) Carter
parent 01b9564909
commit 2fd92cb1b4
2 changed files with 27 additions and 0 deletions

View File

@ -9,6 +9,27 @@ provision_next_usn = 1;
sys = sys_init();
/*
return true if the current install seems to be OK
*/
function install_ok()
{
var lp = loadparm_init();
var ldb = ldb_init();
if (lp.get("realm") == "") {
return false;
}
var ok = ldb.connect(lp.get("sam database"));
if (!ok) {
return false;
}
var res = ldb.search("(name=Administrator)");
if (res.length != 1) {
return false;
}
return true;
}
/*
find a user or group from a list of possibilities
*/

View File

@ -1,6 +1,12 @@
<% page_header("columns", "Server Status", "");
libinclude("base.js");
libinclude("management.js");
libinclude("provision.js");
if (install_ok() == false) {
redirect("/install/provision.esp");
}
%>
<h1>Server Status</h1>