2003-03-23 18:42:40 +00:00
|
|
|
<?php
|
2003-03-14 21:59:04 +00:00
|
|
|
/*
|
|
|
|
$Id$
|
|
|
|
|
2009-10-27 18:47:12 +00:00
|
|
|
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
2014-02-02 12:36:12 +00:00
|
|
|
Copyright (C) 2003 - 2014 Roland Gruber
|
2003-03-14 21:59:04 +00:00
|
|
|
|
|
|
|
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
|
|
|
/**
|
2014-02-02 12:36:12 +00:00
|
|
|
* This page redirects to the correct start page after login.
|
2004-06-10 19:01:18 +00:00
|
|
|
*
|
|
|
|
* @package main
|
|
|
|
* @author Roland Gruber
|
2003-03-14 21:59:04 +00:00
|
|
|
*/
|
|
|
|
|
2007-06-16 11:50:25 +00:00
|
|
|
/** config object */
|
|
|
|
include_once('../lib/config.inc');
|
|
|
|
|
|
|
|
// start session
|
|
|
|
startSecureSession();
|
|
|
|
|
|
|
|
setlanguage();
|
2004-10-02 16:40:02 +00:00
|
|
|
|
2003-07-28 18:36:38 +00:00
|
|
|
// check if all suffixes in conf-file exist
|
|
|
|
$conf = $_SESSION['config'];
|
|
|
|
$new_suffs = array();
|
2006-01-01 16:30:05 +00:00
|
|
|
// get list of active types
|
|
|
|
$types = $_SESSION['config']->get_ActiveTypes();
|
|
|
|
for ($i = 0; $i < sizeof($types); $i++) {
|
2009-11-24 15:12:41 +00:00
|
|
|
$info = @ldap_read($_SESSION['ldap']->server(), escapeDN($conf->get_Suffix($types[$i])), "(objectClass=*)", array('objectClass'), 0, 0, 0, LDAP_DEREF_NEVER);
|
2007-07-08 10:51:01 +00:00
|
|
|
$res = @ldap_get_entries($_SESSION['ldap']->server(), $info);
|
2006-01-01 16:30:05 +00:00
|
|
|
if (!$res && !in_array($conf->get_Suffix($types[$i]), $new_suffs)) $new_suffs[] = $conf->get_Suffix($types[$i]);
|
2003-07-28 18:36:38 +00:00
|
|
|
}
|
|
|
|
|
2004-05-30 11:54:18 +00:00
|
|
|
// display page to add suffixes, if needed
|
2007-12-30 16:08:54 +00:00
|
|
|
if ((sizeof($new_suffs) > 0) && checkIfWriteAccessIsAllowed()) {
|
2010-01-01 17:21:46 +00:00
|
|
|
metaRefresh("initsuff.php?suffs='" . implode(";", $new_suffs));
|
2007-12-30 16:08:54 +00:00
|
|
|
}
|
2006-01-01 16:30:05 +00:00
|
|
|
else {
|
|
|
|
if (sizeof($types) > 0) {
|
2013-01-01 20:46:28 +00:00
|
|
|
for ($i = 0; $i < sizeof($types); $i++) {
|
|
|
|
if (isAccountTypeHidden($types[$i])) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
metaRefresh("lists/list.php?type=" . $types[$i]);
|
|
|
|
break;
|
|
|
|
}
|
2006-01-01 16:30:05 +00:00
|
|
|
}
|
|
|
|
else {
|
2011-05-19 16:14:49 +00:00
|
|
|
metaRefresh("tree/treeViewContainer.php");
|
2006-01-01 16:30:05 +00:00
|
|
|
}
|
|
|
|
}
|
2003-03-14 21:59:04 +00:00
|
|
|
?>
|