| 
									
										
										
										
											2003-03-23 18:42:40 +00:00
										 |  |  | <?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-07-28 18:36:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											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-07-28 18:36:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											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 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-10 19:01:18 +00:00
										 |  |  | */ | 
					
						
							| 
									
										
										
										
											2003-07-28 18:36:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-10 19:01:18 +00:00
										 |  |  | /** | 
					
						
							|  |  |  | * This is the main window. The user and group lists will be shown in this frameset. | 
					
						
							|  |  |  | * | 
					
						
							|  |  |  | * @package main | 
					
						
							|  |  |  | * @author Roland Gruber | 
					
						
							| 
									
										
										
										
											2003-03-14 21:59:04 +00:00
										 |  |  | */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-10-02 16:40:02 +00:00
										 |  |  | /** LDAP attibute cache */ | 
					
						
							|  |  |  | include_once('../lib/cache.inc'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // create cache object
 | 
					
						
							|  |  |  | if (!isset($_SESSION['cache'])) { | 
					
						
							|  |  |  | 	$_SESSION['cache'] = new cache(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-01-23 14:16:20 +00:00
										 |  |  | $startPage = ""; | 
					
						
							| 
									
										
										
										
											2004-06-10 19:01:18 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-07-28 18:36:38 +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() != "")) { | 
					
						
							| 
									
										
										
										
											2005-01-23 14:16:20 +00:00
										 |  |  | 	$startPage = "./lists/listusers.php"; | 
					
						
							| 
									
										
										
										
											2003-09-19 19:46:35 +00:00
										 |  |  | 	$info = @ldap_search($_SESSION['ldap']->server, $conf->get_UserSuffix(), "", array()); | 
					
						
							| 
									
										
										
										
											2003-07-28 18:36:38 +00:00
										 |  |  | 	$res = @ldap_get_entries($_SESSION['ldap']->server, $info); | 
					
						
							| 
									
										
										
										
											2003-11-03 17:48:15 +00:00
										 |  |  | 	if (!$res && !in_array($conf->get_UserSuffix(), $new_suffs)) $new_suffs[] = $conf->get_UserSuffix(); | 
					
						
							| 
									
										
										
										
											2003-07-28 18:36:38 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2003-09-19 19:46:35 +00:00
										 |  |  | if ($conf->get_GroupSuffix() && ($conf->get_GroupSuffix() != "")) { | 
					
						
							| 
									
										
										
										
											2005-01-23 14:16:20 +00:00
										 |  |  | 	if ($startPage == "") { | 
					
						
							|  |  |  | 		$startPage = "./lists/listgroups.php"; | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2003-09-19 19:46:35 +00:00
										 |  |  | 	$info = @ldap_search($_SESSION['ldap']->server, $conf->get_GroupSuffix(), "", array()); | 
					
						
							| 
									
										
										
										
											2003-07-28 18:36:38 +00:00
										 |  |  | 	$res = @ldap_get_entries($_SESSION['ldap']->server, $info); | 
					
						
							| 
									
										
										
										
											2003-11-03 17:48:15 +00:00
										 |  |  | 	if (!$res && !in_array($conf->get_GroupSuffix(), $new_suffs)) $new_suffs[] = $conf->get_GroupSuffix(); | 
					
						
							| 
									
										
										
										
											2003-07-28 18:36:38 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2003-09-19 19:46:35 +00:00
										 |  |  | if ($conf->get_HostSuffix() && ($conf->get_HostSuffix() != "")) { | 
					
						
							| 
									
										
										
										
											2005-01-23 14:16:20 +00:00
										 |  |  | 	if ($startPage == "") { | 
					
						
							|  |  |  | 		$startPage = "./lists/listhosts.php"; | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2003-09-19 19:46:35 +00:00
										 |  |  | 	$info = @ldap_search($_SESSION['ldap']->server, $conf->get_HostSuffix(), "", array()); | 
					
						
							| 
									
										
										
										
											2003-07-28 18:36:38 +00:00
										 |  |  | 	$res = @ldap_get_entries($_SESSION['ldap']->server, $info); | 
					
						
							| 
									
										
										
										
											2003-11-03 17:48:15 +00:00
										 |  |  | 	if (!$res && !in_array($conf->get_HostSuffix(), $new_suffs)) $new_suffs[] = $conf->get_HostSuffix(); | 
					
						
							| 
									
										
										
										
											2003-07-28 18:36:38 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											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()); | 
					
						
							| 
									
										
										
										
											2003-07-28 18:36:38 +00:00
										 |  |  | 	$res = @ldap_get_entries($_SESSION['ldap']->server, $info); | 
					
						
							| 
									
										
										
										
											2003-11-03 17:48:15 +00:00
										 |  |  | 	if (!$res && !in_array($conf->get_DomainSuffix(), $new_suffs)) $new_suffs[] = $conf->get_DomainSuffix(); | 
					
						
							| 
									
										
										
										
											2003-07-28 18:36:38 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-04 11:06:46 +00:00
										 |  |  | // get encoding
 | 
					
						
							|  |  |  | $lang = explode(":",$_SESSION['language']); | 
					
						
							|  |  |  | $lang = $lang[1]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | echo "<?xml version=\"1.0\" encoding=\"$lang\"?>\n";
 | 
					
						
							|  |  |  | echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\" \"http://www.w3.org/TR/html4/frameset.dtd\">\n"; | 
					
						
							|  |  |  | echo "<html>\n"; | 
					
						
							|  |  |  | echo "<head>\n"; | 
					
						
							|  |  |  | echo "<meta http-equiv=\"content-type\" content=\"text/html; charset=$lang\">\n";
 | 
					
						
							|  |  |  | echo "<meta http-equiv=\"pragma\" content=\"no-cache\">\n"; | 
					
						
							|  |  |  | echo "<meta http-equiv=\"cache-control\" content=\"no-cache\">\n"; | 
					
						
							| 
									
										
										
										
											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"); | 
					
						
							| 
									
										
										
										
											2004-05-30 11:54:18 +00:00
										 |  |  | // display page to add suffixes, if needed
 | 
					
						
							| 
									
										
										
										
											2003-07-28 18:36:38 +00:00
										 |  |  | if (sizeof($new_suffs) > 0) echo ("<frame src=\"initsuff.php?suffs='" . implode(";", $new_suffs) . | 
					
						
							|  |  |  | 	"'\" name=\"mainpart\" frameborder=\"0\" scrolling=\"yes\">\n"); | 
					
						
							| 
									
										
										
										
											2005-01-23 14:16:20 +00:00
										 |  |  | else echo ("<frame src=\"$startPage\" 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
										 |  |  | ?>
 |