3 * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
4 * Copyright (C) 2002-2010 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-2010 The Nucleus Group
16 * $NucleusJP: index.php,v 1.8.2.1 2007/09/07 07:36:09 kimitake Exp $
18 // we are using admin stuff:
20 $CONF['UsingAdminArea'] = 1;
22 // include the admin code
23 include('../config.php');
25 if ($CONF['alertOnSecurityRisk'] == 1) {
26 // check if files exist and generate an error if so
28 '../install' => _ERRORS_INSTALLDIR,
29 'upgrades' => _ERRORS_UPGRADESDIR,
\r
30 'convert' => _ERRORS_CONVERTDIR
\r
33 foreach($aFiles as $fileName => $fileDesc) {
34 if (@file_exists($fileName))
35 array_push($aFound, $fileDesc);
37 if (@is_writable('../config.php')) {
38 array_push($aFound, _ERRORS_CONFIGPHP);
40 if (sizeof($aFound) > 0) {
42 _ERRORS_STARTUPERROR1. implode($aFound, '</li><li>')._ERRORS_STARTUPERROR2,
\r
43 _ERRORS_STARTUPERROR3
\r
49 $bIsActivation = in_array($action, array('activate', 'activatesetpwd'));
51 if ($action == 'logout') {
52 $bNeedsLogin = true;
\r
55 if (!$member->isLoggedIn() && !$bIsActivation) {
56 $bNeedsLogin = true;
\r
59 // show error if member cannot login to admin
60 if ($member->isLoggedIn() && !$member->canLogin() && !$bIsActivation) {
61 $error = _ERROR_LOGINDISALLOWED;
66 setOldAction($action); // see ADMIN::login() (sets old action in POST vars)
67 $action = 'showlogin';
70 sendContentType('text/html', 'admin-' . $action);
73 $admin->action($action);