* Copyright (c) 2001-2006 Platon Group, http://platon.sk/ * All rights reserved. * * See README file for more information about this software. * See COPYING file for license information. * * Download the latest version from * http://platon.sk/projects/Metafox/ */ /* $Platon: Metafox/admin/_core.php,v 1.4 2005/08/13 23:06:17 nepto Exp $ */ /* MAINTAINANCE: This file is maintained in Metafox project and distributed across the particular projects accordingly. */ header('Pragma: no-cache'); // HTTP/1.0 header('Cache-Control: no-cache, must-revalidate'); // HTTP/1.1 header('Expires: Mon, 01 Jun 1981 05:00:00 GMT'); // Date in the past header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified chdir('inc/'); require_once 'init.inc.php'; chdir('../'); require_once 'inc/functions.inc.php'; require_once 'Platon.php'; require_once 'Auth/AuthDB.php'; $ezin_auth === false && $ezin_auth = new AuthDB($ezin_auth_options); isset($ezin_admin_action) || $ezin_admin_action = ''; /* If admin's authentifaction function was defined, use it. */ if (strlen($ezin_cfg['admin_auth_function']) > 0) { $ezin_auth->setLoggedFunction($ezin_cfg['admin_auth_function']); } if ($ezin_admin_action == 'logout') { if ($ezin_auth->getAuth()) { $ezin_auth->logout(); if (strlen($ezin_cfg['admin_auth_function']) > 0 /* <-- consider if this is neccessary */ && strlen($ezin_cfg['admin_auth_logout_redirect']) > 0) { header('Location: '.ezin_adjust_link($ezin_cfg['admin_auth_logout_redirect'])); exit; } } else { header('Location: http://'.$_SERVER['HTTP_HOST'].$ezin_cfg['url'].$ezin_sys['dir']['admin']); exit; } } if (strlen($ezin_cfg['admin_auth_function']) > 0 && function_exists($ezin_cfg['admin_auth_function']) && (string) @$ezin_cfg['admin_auth_function']() == '') { if ($ezin_auth->getAuth()) { $ezin_auth->logout(); } else { if (strlen($ezin_cfg['admin_auth_login_redirect']) > 0) { header('Location: '.ezin_adjust_link($ezin_cfg['admin_auth_login_redirect'])); exit; } } } if (! $ezin_auth->getAuth()) { // not logged in case switch ($ezin_auth->getStatus()) { case AUTH_DB_NOT_LOGGED: require 'inc-html/login.html'; break; case AUTH_DB_LOGGED_OUT: require 'inc-html/logout.html'; break; case AUTH_DB_FAILED: require 'inc-html/logfail.html'; break; case AUTH_DB_TIMEOUT: require 'inc-html/timeout.html'; break; case AUTH_DB_EXPIRED: require 'inc-html/expired.html'; break; default: echo '
Unknown status ('; // ) echo $ezin_auth->getStatus().')'; echo '
';
echo '';
require_once 'inc-html/bar-title.html';
require_once 'inc/menu.inc.php';
foreach ($ezin_ADMIN_MENU as $ar) {
$ok = 0;
if (0) { /* change if's 0 to 1 to get all menu links */
$ok = 1;
} elseif (! isset($ar['column'])) {
$ok = 1;
} elseif (is_array($ar['column'])) {
foreach ($ar['column'] as $col) {
if (ezin_admin_check_list_privileges($ezin_USER[$col])) {
$ok = 1;
break;
}
}
} elseif (ezin_admin_check_list_privileges($ezin_USER[$ar['column']])) {
$ok = 1;
}
if ($ok) {
echo '· ';
echo ''.$ar['caption'].' '."\n"; } } require_once 'inc-html/bar-info.html'; echo ' | ',"\n";
echo ''; echo '',"\n"; switch ($ezin_admin_action) { /* * Empty action */ case '': require 'inc-html/welcome.html'; break; /* * File management action */ case 'file_management': if (ezin_admin_check_list_privileges($ezin_USER['role_file_management'])) { $ezin_admin_orig_dir = getcwd(); Platon::chdir_back($ezin_sys['dir']['admin']); if (@file_exists($ezin_sys['dir']['upload'])) { chdir('lib/phpWebFileManager/'); require_once 'index.php'; chdir($ezin_admin_orig_dir); } else { chdir($ezin_admin_orig_dir); require 'inc-html/nofilemngdir.html'; } } else { require 'inc-html/permdenied.html'; } break; /* * Database manipulation action */ default: foreach ($ezin_ADMIN_MENU as $ar) { if (isset($ar['action']) && ! strcmp($ar['action'], $ezin_admin_action)) { $inc_filename = 'inc-db/'.$ar['inc_file']; if (@file_exists($inc_filename) && @is_file($inc_filename) && @is_readable($inc_filename)) { require_once $inc_filename; } else { require 'inc-html/failure.html'; } break; } } break; }; echo ' |
'; echo '',"\n"; require 'inc-html/signature.html'; echo ' |