3 * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
4 * Copyright (C) 2002-2007 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-2007 The Nucleus Group
15 * @version $Id: index.php,v 1.4 2007-03-27 12:13:47 kimitake Exp $
16 * $NucleusJP: index.php,v 1.8 2007/02/04 06:28:45 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)
27 // check if files exist and generate an error if so
29 '../install.sql' => 'install.sql should be deleted',
30 '../install.php' => 'install.php should be deleted',
31 'upgrades' => 'nucleus/upgrades directory should be deleted',
32 'convert' => 'nucleus/convert directory should be deleted'
35 foreach($aFiles as $fileName => $fileDesc)
37 if (@file_exists($fileName))
38 array_push($aFound, $fileDesc);
40 if (@is_writable('../config.php')) {
41 array_push($aFound, 'config.php should be non-writable (chmod to 444)');
43 if (sizeof($aFound) > 0)
46 '<p>One or more of the Nucleus installation files are still present on the webserver, or are writable.</p><p>You should remove these files or change their permissions to ensure security. Here are the files that were found by Nucleus</p> <ul><li>'. implode($aFound, '</li><li>').'</li></ul><p>If you don\'t want to see this error message again, without solving the problem, set <code>$CONF[\'alertOnSecurityRisk\']</code> in <code>globalfunctions.php</code> to <code>0</code>, or do this at the end of <code>config.php</code>.</p>',
53 $bIsActivation = in_array($action, array('activate', 'activatesetpwd'));
55 if ($action == 'logout')
58 if (!$member->isLoggedIn() && !$bIsActivation)
61 // show error if member cannot login to admin
62 if ($member->isLoggedIn() && !$member->canLogin() && !$bIsActivation) {
63 $error = _ERROR_LOGINDISALLOWED;
69 setOldAction($action); // see ADMIN::login() (sets old action in POST vars)
70 $action = 'showlogin';
73 sendContentType('application/xhtml+xml', 'admin-' . $action);
76 $admin->action($action);