svn commit: samba r8648 - in branches/SAMBA_4_0: source/scripting/libjs swat

tridge at samba.org tridge at samba.org
Wed Jul 20 11:26:18 GMT 2005


Author: tridge
Date: 2005-07-20 11:26:17 +0000 (Wed, 20 Jul 2005)
New Revision: 8648

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=8648

Log:
automatically redirect to provisioning if not yet provisioned when the
home page in swat is accessed

Modified:
   branches/SAMBA_4_0/source/scripting/libjs/provision.js
   branches/SAMBA_4_0/swat/index.esp


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/libjs/provision.js
===================================================================
--- branches/SAMBA_4_0/source/scripting/libjs/provision.js	2005-07-20 11:18:52 UTC (rev 8647)
+++ branches/SAMBA_4_0/source/scripting/libjs/provision.js	2005-07-20 11:26:17 UTC (rev 8648)
@@ -10,6 +10,27 @@
 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
 */
 function findnss()

Modified: branches/SAMBA_4_0/swat/index.esp
===================================================================
--- branches/SAMBA_4_0/swat/index.esp	2005-07-20 11:18:52 UTC (rev 8647)
+++ branches/SAMBA_4_0/swat/index.esp	2005-07-20 11:26:17 UTC (rev 8648)
@@ -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>



More information about the samba-cvs mailing list