3 * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
4 * Copyright (C) 2002-2012 The Nucleus Group
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 * (see nucleus/documentation/index.html#license for more info)
13 * @license http://nucleuscms.org/license.txt GNU General Public License
14 * @copyright Copyright (C) 2002-2012 The Nucleus Group
15 * @version $Id: index.php 1748 2012-04-13 13:27:57Z sakamocchi $
18 // we are using admin stuff:
20 $CONF['UsingAdminArea'] = 1;
22 // include the admin code
23 require_once('../config.php');
25 if ( $CONF['alertOnSecurityRisk'] == 1 )
27 // check if files exist and generate an error if so
29 '../install' => _ERRORS_INSTALLDIR,
30 'upgrades' => _ERRORS_UPGRADESDIR,
31 'convert' => _ERRORS_CONVERTDIR
34 foreach ( $aFiles as $fileName => $fileDesc )
36 if ( @file_exists($fileName) )
38 array_push($aFound, $fileDesc);
41 if ( @is_writable('../config.php') )
43 array_push($aFound, _ERRORS_CONFIGPHP);
45 if ( sizeof($aFound) > 0 )
47 sendContentType('text/html', 'startUpError');
49 _ERRORS_STARTUPERROR1. implode($aFound, '</li><li>')._ERRORS_STARTUPERROR2,
56 $bIsActivation = in_array($action, array('activate', 'activatesetpwd'));
58 if ( $action == 'logout' )
63 if ( !$member->isLoggedIn() && !$bIsActivation )
68 // show error if member cannot login to admin
69 if ( $member->isLoggedIn() && !$member->canLogin() && !$bIsActivation )
71 $error = _ERROR_LOGINDISALLOWED;
77 // see Admin::login() (sets old action in POST vars)
78 setOldAction($action);
79 $action = 'showlogin';
82 sendContentType('text/html', 'admin-' . $action);
85 $admin->action($action);