* Copyright (c) 2001-2008 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.7 2007-11-12 16:12:57 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 = ''; ezin_reset_session_records(); /* 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 '
'; echo '

Unknown status ('; // ) echo $ezin_auth->getStatus().')'; echo '

'; break; } } else { // logged in case $ezin_user = $ezin_auth->getUserInfo(); if (empty($ezin_user['role_login'])) { echo 'You\'re not allowed to log in.
'; $ezin_auth->logout(); } else { echo '' . "\n"; echo '',"\n"; echo ''; if (@file_exists('inc-html/signature.html')) { echo ''; } 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 '
'; 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 '
'."\n"; } } chdir('inc/'); require_once 'destroy.inc.php'; chdir('../'); ?>