diff --git a/lam/templates/initsuff.php b/lam/templates/initsuff.php new file mode 100644 index 00000000..e875cf61 --- /dev/null +++ b/lam/templates/initsuff.php @@ -0,0 +1,91 @@ +server(), $dn, $attr); + } + } + } + echo ""; + exit; +} + +// first show of page +$new_suff = $_GET['suffs']; +$new_suff = str_replace("\\'", "", $new_suff); +$new_suff = explode(";", $new_suff); + +echo ("\n"); +echo ("\n"); +echo "initsuff\n"; +echo "\n"; +echo "\n"; + echo "

 

\n"; + echo "

" . _("The following suffix(es) are missing in LDAP. LAM can create them for you.") . "

\n"; + echo "

 

\n"; + // print missing suffixes + for ($i = 0; $i < sizeof($new_suff); $i++) { + echo "

" . $new_suff[$i] . "

\n"; + } + echo "

 

\n"; + echo "
\n"; + echo "\n"; + echo ""; + echo ""; + echo "
\n"; +echo "\n"; +?> diff --git a/lam/templates/main.php b/lam/templates/main.php index 59dea29e..2e6d91f1 100644 --- a/lam/templates/main.php +++ b/lam/templates/main.php @@ -9,20 +9,49 @@ $Id$ 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. - + 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. - + 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. - + This is the main window. The user and group lists will be shown in this frame. + */ +// check if all suffixes in conf-file exist +$conf = $_SESSION['config']; +$new_suffs = array(); +if ($conf->Suff_users && ($conf->Suff_users != "")) { + $info = @ldap_search($_SESSION['ldap']->server, $conf->Suff_users, "", array()); + $res = @ldap_get_entries($_SESSION['ldap']->server, $info); + if (!$res) $new_suffs[] = $conf->Suff_users; +} +if ($conf->Suff_groups && ($conf->Suff_groups != "")) { + $info = @ldap_search($_SESSION['ldap']->server, $conf->Suff_groups, "", array()); + $res = @ldap_get_entries($_SESSION['ldap']->server, $info); + if (!$res) $new_suffs[] = $conf->Suff_groups; +} +if ($conf->Suff_hosts && ($conf->Suff_hosts != "")) { + $info = @ldap_search($_SESSION['ldap']->server, $conf->Suff_hosts, "", array()); + $res = @ldap_get_entries($_SESSION['ldap']->server, $info); + if (!$res) $new_suffs[] = $conf->Suff_hosts; +} +if ($conf->Suff_domains && ($conf->Suff_domains != "")) { + $info = @ldap_search($_SESSION['ldap']->server, $conf->Suff_domains, "", array()); + $res = @ldap_get_entries($_SESSION['ldap']->server, $info); + if (!$res) $new_suffs[] = $conf->Suff_domains; +} +if ($conf->Suff_map && ($conf->Suff_map != "")) { + $info = @ldap_search($_SESSION['ldap']->server, $conf->Suff_map, "", array()); + $res = @ldap_get_entries($_SESSION['ldap']->server, $info); + if (!$res) $new_suffs[] = $conf->Suff_map; +} + echo ("\n"); echo ("\n"); echo ("\n"); @@ -32,7 +61,10 @@ echo ("" echo ("\n"); echo ("\n"); echo ("\n"); -echo ("\n"); +// display page to add suffixes, if needed +if (sizeof($new_suffs) > 0) echo ("\n"); +else echo ("\n"); echo ("\n"); echo ("This page requires a browser that can show frames!\n"); echo ("\n");