_ERRORS_INSTALLDIR,
'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 )
{
sendContentType('text/html', 'startUpError');
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 )
{
// see Admin::login() (sets old action in POST vars)
setOldAction($action);
$action = 'showlogin';
}
sendContentType('text/html', 'admin-' . $action);
$admin = new Admin();
$admin->action($action);