LDAPAccountManager/lam/templates/main.php

75 lines
3.4 KiB
PHP
Raw Normal View History

<?php
2003-03-14 21:59:04 +00:00
/*
$Id$
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
Copyright (C) 2003 Roland Gruber
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
2003-03-14 21:59:04 +00:00
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
2003-03-14 21:59:04 +00:00
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
This is the main window. The user and group lists will be shown in this frame.
2003-03-14 21:59:04 +00:00
*/
// check if all suffixes in conf-file exist
$conf = $_SESSION['config'];
$new_suffs = array();
2003-09-19 19:46:35 +00:00
if ($conf->get_UserSuffix() && ($conf->get_UserSuffix() != "")) {
$info = @ldap_search($_SESSION['ldap']->server, $conf->get_UserSuffix(), "", array());
$res = @ldap_get_entries($_SESSION['ldap']->server, $info);
if (!$res && !in_array($conf->get_UserSuffix(), $new_suffs)) $new_suffs[] = $conf->get_UserSuffix();
}
2003-09-19 19:46:35 +00:00
if ($conf->get_GroupSuffix() && ($conf->get_GroupSuffix() != "")) {
$info = @ldap_search($_SESSION['ldap']->server, $conf->get_GroupSuffix(), "", array());
$res = @ldap_get_entries($_SESSION['ldap']->server, $info);
if (!$res && !in_array($conf->get_GroupSuffix(), $new_suffs)) $new_suffs[] = $conf->get_GroupSuffix();
}
2003-09-19 19:46:35 +00:00
if ($conf->get_HostSuffix() && ($conf->get_HostSuffix() != "")) {
$info = @ldap_search($_SESSION['ldap']->server, $conf->get_HostSuffix(), "", array());
$res = @ldap_get_entries($_SESSION['ldap']->server, $info);
if (!$res && !in_array($conf->get_HostSuffix(), $new_suffs)) $new_suffs[] = $conf->get_HostSuffix();
}
2003-09-19 19:46:35 +00:00
if ($conf->get_DomainSuffix() && ($conf->get_DomainSuffix() != "")) {
$info = @ldap_search($_SESSION['ldap']->server, $conf->get_DomainSuffix(), "", array());
$res = @ldap_get_entries($_SESSION['ldap']->server, $info);
if (!$res && !in_array($conf->get_DomainSuffix(), $new_suffs)) $new_suffs[] = $conf->get_DomainSuffix();
}
2003-09-15 16:24:44 +00:00
if ($_SESSION['config']->is_samba3()) {
2003-08-12 18:45:07 +00:00
$doms = $_SESSION['ldap']->search_domains($_SESSION['config']->get_domainSuffix());
}
2003-07-29 11:52:26 +00:00
echo $_SESSION['header'];
2003-03-19 16:39:26 +00:00
echo ("<title>LDAP Account Manager</title>\n");
2003-06-08 18:09:07 +00:00
echo ("<link rel=\"stylesheet\" type=\"text/css\" href=\"../style/layout.css\">");
2003-03-19 16:39:26 +00:00
echo ("</head>\n");
2003-04-26 13:30:36 +00:00
echo ("<frameset rows=\"130,*\">\n");
2003-05-09 16:26:02 +00:00
echo ("<frame src=\"./main_header.php\" name=\"head\" frameborder=\"0\" scrolling=\"no\" noresize>\n");
// display page to add suffixes or add domain, if needed
if (sizeof($new_suffs) > 0) echo ("<frame src=\"initsuff.php?suffs='" . implode(";", $new_suffs) .
"'\" name=\"mainpart\" frameborder=\"0\" scrolling=\"yes\">\n");
2003-09-15 16:24:44 +00:00
elseif (($_SESSION['config']->is_samba3()) && (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");
2003-03-19 16:39:26 +00:00
echo ("<noframes>\n");
echo ("This page requires a browser that can show frames!\n");
echo ("</noframes>\n");
echo ("</frameset>\n");
echo ("</html>\n");
2003-03-14 21:59:04 +00:00
?>