OSDN Git Service

3.15 taka-san version
[nucleus-jp/nucleus-jp-ancient.git] / utf8 / nucleus / index.php
1 <?php\r
2 /**\r
3   * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)\r
4   * Copyright (C) 2002-2004 The Nucleus Group\r
5   *\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
11   */\r
12         // we are using admin stuff:\r
13         $CONF = array();\r
14         $CONF['UsingAdminArea'] = 1;\r
15 \r
16         // include the admin code\r
17         include('../config.php');\r
18 \r
19         if ($CONF['alertOnSecurityRisk'] == 1)\r
20         {\r
21                 // check if files exist and generate an error if so\r
22                 $aFiles = array(\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
27                 );\r
28                 $aFound = array();\r
29                 foreach($aFiles as $fileName => $fileDesc)\r
30                 {\r
31                         if (@file_exists($fileName))\r
32                                 array_push($aFound, $fileDesc);\r
33                 }\r
34                 if (@is_writable('../config.php')) {\r
35                         array_push($aFound, 'config.php should be non-writable (chmod to 444)');\r
36                 }\r
37                 if (sizeof($aFound) > 0)\r
38                 {\r
39                         startUpError(\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
41                                 'Security Risk'\r
42                         );\r
43                 }\r
44         }\r
45 \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
50         }\r
51 \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
58 \r
59         }\r
60 \r
61         sendContentType('application/xhtml+xml', 'admin-' . $action);\r
62         \r
63         $admin = new ADMIN();\r
64         $admin->action($action);\r
65 ?>