Súbor: [Platon] / Metafox / admin / _core.php (stiahnutie)
Revízia 1.2, Fri Jun 10 09:09:46 2005 UTC (18 years, 9 months ago) by nepto
Zmeny od 1.1: +5 -5
[lines]
Quoted some tag attributes in the admin section
|
<?php
/*
* phpMyEzin - e-zin content management system
*
* admin/_core.php - admin core file
* ____________________________________________________________
*
* Developed by Ondrej Jombik <nepto@platon.sk>
* Copyright (c) 2001-2005 Platon SDG, 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/phpMyEzin/
*/
/* $Platon: Metafox/admin/_core.php,v 1.1 2005/06/05 12:13:18 nepto Exp $ */
/* MAINTAINANCE: This file is maintained in phpMyEzin 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 '<center>';
echo '<p><big><b>Unknown status ('; // )
echo $ezin_auth->getStatus().')</b></big>';
echo '</center>';
break;
}
} else { // logged in case
$ezin_USER = $ezin_auth->getUserInfo();
if (empty($ezin_USER['role_login'])) {
echo 'You\'re not allowed to log in.<br>';
$ezin_auth->logout();
} else {
echo '<table class="ezin-admin-main">' . "\n";
echo '<tr><td class="ezin-admin-main" align="left" valign="top">';
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 '<strong><big>·</big></strong> ';
echo '<a href="'.$ar['link'].'">'.$ar['caption'].'</a><br>'."\n";
}
}
require_once 'inc-html/bar-info.html';
echo '</td>';
echo '<td width="100%" align="left" valign="top" class="ezin-admin-main">'."\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;
};
if (@file_exists('inc-html/signature.html')) {
echo '</td></tr>';
echo '<tr><td class="ezin-admin-main" colspan="2">'."\n";
require 'inc-html/signature.html';
}
echo '</td></tr>';
echo '</table>'."\n";
}
}
chdir('inc/');
require_once 'destroy.inc.php';
chdir('../');
?>
Platon Group <platon@platon.sk> http://platon.sk/
|