3 * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
\r
4 * Copyright (C) 2002-2004 The Nucleus Group
\r
6 * This program is free software; you can redistribute it and/or
\r
7 * modify it under the terms of the GNU General Public License
\r
8 * as published by the Free Software Foundation; either version 2
\r
9 * of the License, or (at your option) any later version.
\r
10 * (see nucleus/documentation/index.html#license for more info)
\r
12 // we are using admin stuff:
\r
14 $CONF['UsingAdminArea'] = 1;
\r
16 // include the admin code
\r
17 include('../config.php');
\r
19 if ($CONF['alertOnSecurityRisk'] == 1)
\r
21 // check if files exist and generate an error if so
\r
23 '../install.sql' => 'install.sql should be deleted',
\r
24 '../install.php' => 'install.php should be deleted',
\r
25 'upgrades' => 'nucleus/upgrades directory should be deleted',
\r
26 'convert' => 'nucleus/convert directory should be deleted'
\r
29 foreach($aFiles as $fileName => $fileDesc)
\r
31 if (@file_exists($fileName))
\r
32 array_push($aFound, $fileDesc);
\r
34 if (@is_writable('../config.php')) {
\r
35 array_push($aFound, 'config.php should be non-writable (chmod to 444)');
\r
37 if (sizeof($aFound) > 0)
\r
40 '<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>',
\r
46 if (!$member->isLoggedIn() || ($action == 'logout')) {
\r
47 $HTTP_POST_VARS['oldaction'] = $action; // see ADMIN::login()
\r
48 $_POST['oldaction'] = $action;
\r
49 $action = "showlogin";
\r
52 // show error if member cannot login to admin
\r
53 if ($member->isLoggedIn() && !$member->canLogin()) {
\r
54 $error = _ERROR_LOGINDISALLOWED;
\r
55 $HTTP_POST_VARS['oldaction'] = $action; // see ADMIN::login()
\r
56 $_POST['oldaction'] = $action;
\r
57 $action = "showlogin";
\r
61 sendContentType('application/xhtml+xml', 'admin-' . $action);
\r
63 $admin = new ADMIN();
\r
64 $admin->action($action);
\r