Modules are now included in modules.inc

Changed edit-Page to single page
This commit is contained in:
katagia 2004-02-10 19:59:41 +00:00
parent 88333091e3
commit 01bfb82e0f
5 changed files with 25 additions and 91 deletions

View File

@ -36,20 +36,12 @@ include_once($lampath_include.'lib/modules.inc'); // LDAP-functions
include_once($lampath_include.'lib/cache.inc'); include_once($lampath_include.'lib/cache.inc');
include_once($lampath_include.'lib/account.inc'); include_once($lampath_include.'lib/account.inc');
/* We have to include all modules
* before start session
*/
$dir = opendir($lampath_include.'lib/modules');
while ($entry = readdir($dir))
if (is_file($lampath_include.'lib/modules/'.$entry)) include_once ($lampath_include.'lib/modules/'.$entry);
// Start session // Start session
session_save_path($lampath_include.'sess'); session_save_path($lampath_include.'sess');
@session_start(); @session_start();
// Redirect to startpage if user is not loged in // Redirect to startpage if user is not loged in
if (!isset($_SESSION['loggedIn'])) { if (!isset($_SESSION['loggedIn'])) {
// *** fixme ../../
metaRefresh("../../login.php"); metaRefresh("../../login.php");
exit; exit;
} }

View File

@ -24,6 +24,24 @@ $Id$
*/ */
/* We have to include all modules
* before start session
*/
// Get Lampath, needed 4 includes
$stay=0;
$relative='';
while ($stay<7) {
if (is_dir($relative.'lib/modules')) {
$dir = opendir($relative.'lib/modules');
while ($entry = readdir($dir))
if (is_file($relative.'lib/modules/'.$entry)) include_once ($relative.'lib/modules/'.$entry);
$stay=10;
}
else {
$stay++;
$relative .= '../';
}
}
// returns the alias name of a module // returns the alias name of a module
function getModuleAlias($name) { function getModuleAlias($name) {

View File

@ -27,12 +27,17 @@ include_once('../../lib/include.inc');
if ($_GET['DN']) { if ($_GET['DN']) {
//load account //load account
if ($_GET['DN'] == $DN) $DN = str_replace("'", '',$_GET['DN']);
$DN = str_replace("\'", '', $_GET['DN']); $DN = str_replace("\'", '', $_GET['DN']);
$_SESSION['account'] = new accountContainer('host', 'account'); $type = str_replace("\'", '', $_GET['type']);
if ($_GET['type'] == $type) $type = str_replace("'", '',$_GET['type']);
$_SESSION['account'] = new accountContainer($type, 'account');
$_SESSION['account']->load_account($DN); $_SESSION['account']->load_account($DN);
} }
else if (count($_POST)==0) { else if (count($_POST)==0) {
$_SESSION['account'] = new accountContainer('host', 'account'); $type = str_replace("\'", '', $_GET['type']);
if ($_GET['type'] == $type) $type = str_replace("'", '',$_GET['type']);
$_SESSION['account'] = new accountContainer($type, 'account');
$_SESSION['account']->new_account(); $_SESSION['account']->new_account();
} }
$_SESSION['account']->continue_main($_POST); $_SESSION['account']->continue_main($_POST);

View File

@ -1,40 +0,0 @@
<?php
/*
$Id$
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
Copyright (C) 2003 Tilo Lutz
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.
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
LDAP Account Manager displays table for creating or modifying accounts in LDAP
*/
include_once('../../lib/include.inc');
if ($_GET['DN']) {
//load account
$DN = str_replace("\'", '', $_GET['DN']);
$_SESSION['account'] = new accountContainer('group', 'account');
$_SESSION['account']->load_account($DN);
}
else if (count($_POST)==0) {
$_SESSION['account'] = new accountContainer('group', 'account');
$_SESSION['account']->new_account();
}
$_SESSION['account']->continue_main($_POST);
?>

View File

@ -1,41 +0,0 @@
<?php
/*
$Id$
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
Copyright (C) 2003 Tilo Lutz
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.
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
LDAP Account Manager displays table for creating or modifying accounts in LDAP
*/
include_once('../../lib/include.inc');
if ($_GET['DN']) {
//load account
$DN = str_replace("\'", '', $_GET['DN']);
$_SESSION['account'] = new accountContainer('user', 'account');
$_SESSION['account']->load_account($DN);
}
else if (count($_POST)==0) {
$_SESSION['account'] = new accountContainer('user', 'account');
$_SESSION['account']->new_account();
}
$_SESSION['account']->continue_main($_POST);
?>