display new domain page if no domains were found

This commit is contained in:
Roland Gruber 2003-08-12 18:20:27 +00:00
parent 22c6022186
commit 8cc946ab87
2 changed files with 8 additions and 2 deletions

View File

@ -66,7 +66,7 @@ if (($_GET['action'] == "edit") || ($_GET['action'] == "new")) {
echo "</head>\n"; echo "</head>\n";
echo "<body>\n"; echo "<body>\n";
// print message, if needed // print message, if needed
if ($_SESSION['domain_message']) echo "<p><font color=\"red\"><b>" . $_SESSION['domain_message'] . "</b></font></p><p>&nbsp;</p>"; if ($_SESSION['domain_message']) StatusMessage("INFO", $_SESSION['domain_message'], "");
// print fieldset // print fieldset
echo "<form action=\"domain.php\" method=\"post\">\n"; echo "<form action=\"domain.php\" method=\"post\">\n";
echo "<p>&nbsp;</p>\n"; echo "<p>&nbsp;</p>\n";

View File

@ -52,6 +52,8 @@ if ($conf->Suff_map && ($conf->Suff_map != "")) {
if (!$res) $new_suffs[] = $conf->Suff_map; if (!$res) $new_suffs[] = $conf->Suff_map;
} }
$doms = $_SESSION['ldap']->search_domains($_SESSION['config']->get_domainSuffix());
echo $_SESSION['header']; echo $_SESSION['header'];
echo ("<html>\n"); echo ("<html>\n");
echo ("<head>\n"); echo ("<head>\n");
@ -60,9 +62,13 @@ echo ("<link rel=\"stylesheet\" type=\"text/css\" href=\"../style/layout.css\">"
echo ("</head>\n"); echo ("</head>\n");
echo ("<frameset rows=\"130,*\">\n"); echo ("<frameset rows=\"130,*\">\n");
echo ("<frame src=\"./main_header.php\" name=\"head\" frameborder=\"0\" scrolling=\"no\" noresize>\n"); echo ("<frame src=\"./main_header.php\" name=\"head\" frameborder=\"0\" scrolling=\"no\" noresize>\n");
// display page to add suffixes, if needed // display page to add suffixes or add domain, if needed
if (sizeof($new_suffs) > 0) echo ("<frame src=\"initsuff.php?suffs='" . implode(";", $new_suffs) . if (sizeof($new_suffs) > 0) echo ("<frame src=\"initsuff.php?suffs='" . implode(";", $new_suffs) .
"'\" name=\"mainpart\" frameborder=\"0\" scrolling=\"yes\">\n"); "'\" name=\"mainpart\" frameborder=\"0\" scrolling=\"yes\">\n");
elseif (sizeof($doms) < 1) {
$_SESSION['domain_message'] = _("No domains found, please create one.");
echo ("<frame src=\"domain.php?action=new\" name=\"mainpart\" frameborder=\"0\" scrolling=\"yes\">\n");
}
else echo ("<frame src=\"./lists/listusers.php\" name=\"mainpart\" frameborder=\"0\" scrolling=\"yes\">\n"); else echo ("<frame src=\"./lists/listusers.php\" name=\"mainpart\" frameborder=\"0\" scrolling=\"yes\">\n");
echo ("<noframes>\n"); echo ("<noframes>\n");
echo ("This page requires a browser that can show frames!\n"); echo ("This page requires a browser that can show frames!\n");