_ERRORS_INSTALLSQL,
'../install.php' => _ERRORS_INSTALLPHP,
'upgrades' => _ERRORS_UPGRADESDIR,
'convert' => _ERRORS_CONVERTDIR
);
$aFound = array();
foreach($aFiles as $fileName => $fileDesc) {
if (@file_exists($fileName))
array_push($aFound, $fileDesc);
}
if (@is_writable('../config.php')) {
array_push($aFound, _ERRORS_CONFIGPHP);
}
if (sizeof($aFound) > 0) {
startUpError(
_ERRORS_STARTUPERROR1. implode($aFound, '
')._ERRORS_STARTUPERROR2,
_ERRORS_STARTUPERROR3
);
}
}
$bNeedsLogin = false;
$bIsActivation = in_array($action, array('activate', 'activatesetpwd'));
if ($action == 'logout') {
$bNeedsLogin = true;
}
if (!$member->isLoggedIn() && !$bIsActivation) {
$bNeedsLogin = true;
}
// show error if member cannot login to admin
if ($member->isLoggedIn() && !$member->canLogin() && !$bIsActivation) {
$error = _ERROR_LOGINDISALLOWED;
$bNeedsLogin = true;
}
if ($bNeedsLogin) {
setOldAction($action); // see ADMIN::login() (sets old action in POST vars)
$action = 'showlogin';
}
sendContentType('text/html', 'admin-' . $action);
$admin = new ADMIN();
$admin->action($action);
?>