From 8cc946ab870f8d9a536e5dd44240bc2d376ebdf7 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Tue, 12 Aug 2003 18:20:27 +0000 Subject: [PATCH] display new domain page if no domains were found --- lam/templates/domain.php | 2 +- lam/templates/main.php | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lam/templates/domain.php b/lam/templates/domain.php index 43be866e..db744f8b 100644 --- a/lam/templates/domain.php +++ b/lam/templates/domain.php @@ -66,7 +66,7 @@ if (($_GET['action'] == "edit") || ($_GET['action'] == "new")) { echo "\n"; echo "\n"; // print message, if needed - if ($_SESSION['domain_message']) echo "

" . $_SESSION['domain_message'] . "

 

"; + if ($_SESSION['domain_message']) StatusMessage("INFO", $_SESSION['domain_message'], ""); // print fieldset echo "
\n"; echo "

 

\n"; diff --git a/lam/templates/main.php b/lam/templates/main.php index 635a9deb..66154202 100644 --- a/lam/templates/main.php +++ b/lam/templates/main.php @@ -52,6 +52,8 @@ if ($conf->Suff_map && ($conf->Suff_map != "")) { if (!$res) $new_suffs[] = $conf->Suff_map; } +$doms = $_SESSION['ldap']->search_domains($_SESSION['config']->get_domainSuffix()); + echo $_SESSION['header']; echo ("\n"); echo ("\n"); @@ -60,9 +62,13 @@ echo ("" echo ("\n"); echo ("\n"); echo ("\n"); -// display page to add suffixes, if needed +// display page to add suffixes or add domain, if needed if (sizeof($new_suffs) > 0) echo ("\n"); +elseif (sizeof($doms) < 1) { + $_SESSION['domain_message'] = _("No domains found, please create one."); + echo ("\n"); +} else echo ("\n"); echo ("\n"); echo ("This page requires a browser that can show frames!\n");