OSDN Git Service

instructions for manually adding .htaccess files to media and skins folder after...
authorshizuki <shizuki@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Fri, 13 Feb 2009 05:22:07 +0000 (05:22 +0000)
committershizuki <shizuki@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Fri, 13 Feb 2009 05:22:07 +0000 (05:22 +0000)
Comment count at items list display via 'sprintf()'.

git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/nucleus-jp/trunk/utf8@938 1ca29b6e-896d-4ea0-84a5-967f57386b96

extra/htaccess/media/readme.ja.txt
extra/htaccess/media/readme.txt
extra/htaccess/skins/readme.ja.txt
extra/htaccess/skins/readme.txt
nucleus/documentation/history.html
nucleus/upgrades/index.php
nucleus/upgrades/upgrade.functions.php
nucleus/upgrades/upgrade.php
nucleus/upgrades/upgrade3.4.php [new file with mode: 0644]

index 73b4d8a..45be204 100644 (file)
@@ -1,17 +1,12 @@
-Nucleus Media ディレクトリ
------------------------
+このディレクトリのmedia.htaccessファイルは、mediaディレクトリでのスクリプトの実行を阻止し、サーバのセキュリティを強化することを意図しています。
+これは悪意を持ったものが、mediaディレクトリにアップロードしたファイルを実行させることを防ぎます。
+ただし、.htaccessでの制限の許可・不許可はサーバの設定に依存しているので、コードが意図されたとおりに動くとは限りません。
 
 
-アップロードされた画像等のファイルは、最終的にこのディレクトリに移動されます。
+下記の手順に従って、.htaccessを適用してください
 
 
+1. mediaディレクトリに他の.htaccessファイルがないことを確認します。
+2. 「mrdia.htaccess」ファイルを、Nucleusのmediaディレクトリにコピーします。
+3. ファイルを「mrdia.htaccess」から「.htaccess」にリネームします。
+4. もし、すでに.htaccessファイルがmediaディレクトリに存在した場合は、すでにある.htaccessファイルに「mrdia.htaccess」の内容を追記します。
 
 
-サブディレクトリについて:
-
-* 数字 (例 /media/1/)
-
-アップロードしたメンバーだけがファイルを使用できます。(ディレクトリ名はメンバーIDになります)
-
-* 数字以外 (例 /media/common/)
-
-誰が使ってもいいファイルを保存しておく為のディレクトリ。
-ディレクトリを作ってパーミッションを777等にしておくだけで、新しいコレクションとして追加されます。
-
+これでmediaディレクトリを、意図しないスクリプトの実行から保護することが出来ます。
index 308d3a1..b302899 100644 (file)
@@ -1,15 +1,10 @@
-Nucleus Media Directory
------------------------
+PLEASE NOTE: The media.htaccess file in this directory is intended to enhance security of your server by disallowing the running of scripts from the media folder. This will protect against rogue members, or external exploits, that rely on uploading script files to this folder for execution at a later time. Depending on the configuration of your web server, this code may not run as intended. 
 
 
-Uploaded images will end up in the media directory.
+To apply it, follow these instructions:
 
 
-Subdirectories work as follows:
-
-* numeric (e.g. /media/1/)
-
-Media files for a certain member (directory name is the memberid)
-
-* other directories (e.g. /media/common/)
-
-Global media collections that can be used by any member that is on a team. In order to create a new collection, simply create a new directory and assure write access is enabled for it.
+1. Be sure that another .htaccess file does not exist in the /media folder
+2. Copy the media.htaccess file into the media folder of your Nucleus CMS installation
+3. Rename the file to .htaccess
+4. If you have an existing .htaccess file in your media folder, copy the contents from the media.htaccess file into the existing .htacces file.
 
 
+You can disable after installing it by renaming the file to something else, or by removing the file from that folder.
\ No newline at end of file
index 073d092..728c356 100644 (file)
@@ -1,12 +1,13 @@
-Nucleus skins ディレクトリ
------------------------
+このディレクトリのskins.htaccessファイルは、各スキンで使用する「.inc」ファイルや「.php」ファイルに対する外部からの直接アクセスを禁止し、サーバのセキュリティを強化することを意図しています。
+ただし.htaccessでの制限の許可・不許可はサーバの設定に依存しているので、コードが意図されたとおりに動くとは限りません。
+例えば、意図せずに一部のファイルへのサーバ内でのアクセスまで禁止されてしまって、あなたのサイトにCSSが適用されずに表示されるようなことがあるかもしれません。
+その時は.htaccessファイルをリネームして問題を解決してください。
 
 
-注意:このディレクトリ内(サブディレクトリを含む)にある、skinbackup.xml や skindata.xml 等のファイルを直接編集することは避けてください。
-         これらのファイルはユーザーに配布する為に、Nucleusの機能を使用して作成されています。
+下記の手順に従って、.htaccessを適用してください
 
 
-         スキンを編集する時は、Nucleusの管理エリアで左のメニューから「スキン編集」を選択し、スキン編集画面へと進んでください。
+1. skinsディレクトリに他の.htaccessファイルがないことを確認します。
+2. 「mrdia.htaccess」ファイルを、Nucleusのskinsディレクトリにコピーします。
+3. ファイルを「skins.htaccess」から「.htaccess」にリネームします。
+4. もし、すでに.htaccessファイルがskinsディレクトリに存在した場合は、すでにある.htaccessファイルに「skins.htaccess」の内容を追記します。
 
 
-注意:このディレクトリの.htaccessファイルは、ディレクトリ内(サブディレクトリを含む)の .inc ファイルや .php ファイルに外部から直接アクセス
-         することを禁止する為のものです。
-         サーバの設定によっては、.htaccessに記述された内容が、意図したとおりに動作しないことがあります。
-         スキンの表示が壊れている時は、.htaccess ファイルを修正することで直ることがあります。
\ No newline at end of file
+これでskinsディレクトリを、不要なアクセスから保護することが出来ます。
index 3844617..6d61376 100644 (file)
@@ -1,8 +1,10 @@
-Nucleus skins directory
------------------------
+PLEASE NOTE: the skins.htaccess file in this directory is intended to prohibit, for enhanced security, direct access .inc and .php files in the skin folders. Depending on the web server configuration, the code in this .htaccess file may not work as intended. In this case, your site will be displayed incorrectly, with missing content or style. Renaming the .htaccess file should fix the problem.
 
 
-PLEASE NOTE: the skinbackup.xml or skindata.xml files in these directories are not where you should edit the skins. These files get generated by the Nucleus skin export function and are meant to distribute skins between Nucleus users.
+To apply it, follow these instructions:
 
 
-To edit skins, open the Nucleus Admin Area, and select 'skins' in the left menu.
+1. Be sure that another .htaccess file does not exist in the /skins folder
+2. Copy the skins.htaccess file into the skins folder of your Nucleus CMS installation
+3. Rename the file to .htaccess
+4. If you have an existing .htaccess file in your skins folder, copy the contents from the skins.htaccess file into the existing .htacces file.
 
 
-PLEASE NOTE: the .htaccess file in this directory is intended to prohibit, for enhanced security, direct access .inc and .php files in the skin folders. Depending on the web server configuration, the code in this .htaccess file may not work as intended. In this case, your site will be displayed incorrectly, with missing content or style. Renaming the .htaccess file should fix the problem.
\ No newline at end of file
+You can disable after installing it by renaming the file to something else, or by removing the file from that folder.
\ No newline at end of file
index 07521a7..b6ad1a1 100755 (executable)
        <li>\r
                <strong>Nucleus v3.3 (May 1, 2007)</strong>\r
                <ul>\r
        <li>\r
                <strong>Nucleus v3.3 (May 1, 2007)</strong>\r
                <ul>\r
+                       <li>ADDED: check cmail column to separate to URL and cemail when Nucleus upgrade to 3.3 or later. (kimitake/katsumi)</li>\r
                        <li>\r
                                ADDED: Serveral changes and fixes from Nucleus Japan (details in the log files of the <a href="http://sourceforge.net/svn/?group_id=66479">Nucleus repository</a> at sourceforge.net)\r
                                <ul>\r
                        <li>\r
                                ADDED: Serveral changes and fixes from Nucleus Japan (details in the log files of the <a href="http://sourceforge.net/svn/?group_id=66479">Nucleus repository</a> at sourceforge.net)\r
                                <ul>\r
index 9772f60..f176b10 100755 (executable)
@@ -55,9 +55,10 @@ upgrade_head();
   else  if (!upgrade_checkinstall(32)) $current = 31;
   else  if (!upgrade_checkinstall(33)) $current = 32;
   else  if (!upgrade_checkinstall(331)) $current = 33;
   else  if (!upgrade_checkinstall(32)) $current = 31;
   else  if (!upgrade_checkinstall(33)) $current = 32;
   else  if (!upgrade_checkinstall(331)) $current = 33;
-  else  $current = 331;
+  else  if (!upgrade_checkinstall(34)) $current = 33;
+  else  $current = 34;
 
 
-  if ($current == 331) {        
+  if ($current == 34) {         
          ?>     
            <p class="ok">自動でできるアップグレードはありません。データベースは既に最新の Nucleus 用にアップデートされています。</p>     
          <?php          
          ?>     
            <p class="ok">自動でできるアップグレードはありません。データベースは既に最新の Nucleus 用にアップデートされています。</p>     
          <?php          
@@ -77,6 +78,10 @@ upgrade_head();
 <p>いくつかの変更は手動で行う必要があります。下記にその手順を示します。</p>
 
 <?php
 <p>いくつかの変更は手動で行う必要があります。下記にその手順を示します。</p>
 
 <?php
+$from = intGetVar('from');
+if (!$from) 
+       $from = $current;
+
 $sth = 0;
 if (!$DIR_MEDIA) {
   upgrade_manual_96();
 $sth = 0;
 if (!$DIR_MEDIA) {
   upgrade_manual_96();
@@ -97,6 +102,13 @@ if (phpversion() < '4.0.6') {
 // from v3.3, atom feed supports 1.0 and blogsetting is added
 $sth = upgrade_manual_atom1_0();
 
 // from v3.3, atom feed supports 1.0 and blogsetting is added
 $sth = upgrade_manual_atom1_0();
 
+// upgrades from pre-340 version need to be told of recommended .htaccess files for the media and skins folders.
+// these .htaccess files are included in new installs of 340 or higher
+if (in_array($from,array(95,96)) || $from < 34) {
+  upgrade_manual_34();
+  $sth = 1;
+} 
+
 if ($sth == 0)
   echo "<p class='ok'>手動変更は必要ありません。今日はラッキーな日ですね!</p>";
 
 if ($sth == 0)
   echo "<p class='ok'>手動変更は必要ありません。今日はラッキーな日ですね!</p>";
 
@@ -150,6 +162,26 @@ function upgrade_manual_20() {
 
 <?php }
 
 
 <?php }
 
+function upgrade_manual_34() {
+  global $DIR_NUCLEUS;
+
+?>
+  <h2>Nucleus 3.4 用に必要な変更</h2>
+  <p>
+       <em>skins</em>ディレクトリと<em>media</em>ディレクトリに「.haccess」を設置して、アクセス制限をかけることが推奨されます。この変更は、Nucleusの機能やセキュリティに直接関係があるわけではありませんが、不正アクセスを防ぐ為の重要な助けになるでしょう。
+  </p>
+  
+  <p>
+    Instructions for applying the restrictions are found in the following two files on your server:
+       <ul>
+          <li><a href="../../extra/htaccess/media/readme.txt">extra/htaccess/media/readme.txt</a></li>
+          <li><a href="../../extra/htaccess/skins/readme.txt">extra/htaccess/skins/readme.txt</a></li>
+       </ul>
+  </p>
+  
+
+<?php }
+
 function upgrade_manual_php405() {
 ?>
 <h2>PHP のバージョンが 4.0.3, 4.0.4 または 4.0.5 の場合に必要となる変更</h2>
 function upgrade_manual_php405() {
 ?>
 <h2>PHP のバージョンが 4.0.3, 4.0.4 または 4.0.5 の場合に必要となる変更</h2>
index 4d4e952..af907c3 100755 (executable)
                                $query = 'SELECT * FROM '.sql_table('config').' WHERE name=\'DatabaseVersion\' and value >= 331 LIMIT 1';
                                $minrows = 1;
                                break;
                                $query = 'SELECT * FROM '.sql_table('config').' WHERE name=\'DatabaseVersion\' and value >= 331 LIMIT 1';
                                $minrows = 1;
                                break;
+                       case '34':
+                               $query = 'SELECT * FROM '.sql_table('config').' WHERE name=\'DatabaseVersion\' and value >= 340 LIMIT 1';
+                               $minrows = 1;
+                               break;
                }
 
                $res = mysql_query($query);
                }
 
                $res = mysql_query($query);
 
        function upgrade_end($msg = "") {
                global $upgrade_failures;
 
        function upgrade_end($msg = "") {
                global $upgrade_failures;
+               $from = intGetVar('from');
                if ($upgrade_failures > 0)
                        $msg = "いくつかのデータベース操作に失敗しました。もし以前にこのアップグレードスクリプトを実行していたのであれば、問題ないと思われます。";
 
                if ($upgrade_failures > 0)
                        $msg = "いくつかのデータベース操作に失敗しました。もし以前にこのアップグレードスクリプトを実行していたのであれば、問題ないと思われます。";
 
 
                <p><?php echo $msg?></p>
 
 
                <p><?php echo $msg?></p>
 
-               <p><a href="index.php">アップグレード最初のページ</a>にもどる</p>
+               <p><a href="index.php?from=<?php echo $from; ?>">アップグレード最初のページ</a>にもどる</p>
 
                <?php
                upgrade_foot();
 
                <?php
                upgrade_foot();
index 60c5de5..0190304 100755 (executable)
@@ -24,7 +24,7 @@ if (!$member->isLoggedIn()) {
 }
 
 if (!$member->isAdmin()) {
 }
 
 if (!$member->isAdmin()) {
-       upgrade_error('Only Super-Admins are allowed to perform upgrades');
+       upgrade_error('Super-admin(最高管理者)のみがアップグレードを実行できます。');
 }
 
 include('upgrade0.95.php');
 }
 
 include('upgrade0.95.php');
@@ -39,6 +39,7 @@ include('upgrade3.1.php');
 include('upgrade3.2.php');
 include('upgrade3.3.php');
 include('upgrade3.31.php');
 include('upgrade3.2.php');
 include('upgrade3.3.php');
 include('upgrade3.31.php');
+include('upgrade3.4.php');
 
 $from = intGetVar('from');
 
 
 $from = intGetVar('from');
 
@@ -64,12 +65,15 @@ switch($from) {
                upgrade_do31();
        case 31:
                upgrade_do32();
                upgrade_do31();
        case 31:
                upgrade_do32();
-               break;
+//             break;
        case 32:
                upgrade_do33();
        case 32:
                upgrade_do33();
-               break;
+//             break;
        case 33:
                upgrade_do331();
        case 33:
                upgrade_do331();
+//             break;
+       case 331:
+               upgrade_do34();
                break;
        default:
                echo "<li>エラー! 実行すべきアップデートはありません</li>";
                break;
        default:
                echo "<li>エラー! 実行すべきアップデートはありません</li>";
diff --git a/nucleus/upgrades/upgrade3.4.php b/nucleus/upgrades/upgrade3.4.php
new file mode 100644 (file)
index 0000000..37d609c
--- /dev/null
@@ -0,0 +1,63 @@
+<?php
+/*
+ * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
+ * Copyright (C) 2002-2007 The Nucleus Group
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * (see nucleus/documentation/index.html#license for more info)
+ */
+/**
+ * @license http://nucleuscms.org/license.txt GNU General Public License
+ * @copyright Copyright (C) 2002-2007 The Nucleus Group
+ * $NucleusJP: upgrade3.3.php,v 1.5.2.1 2007/10/24 05:39:16 kimitake Exp $
+ *
+ */
+
+function upgrade_do34() {
+
+       if (upgrade_checkinstall(34))
+               return 'already installed';
+       
+       // Give user warning if they are running old version of PHP
+        if (phpversion() < '5') {
+                echo '\8cx\8d\90\81F Nucleus\82ð\8cÃ\82¢\83o\81[\83W\83\87\83\93\82ÌPHP\82Å\89^\97p\82µ\82æ\82¤\82Æ\82µ\82Ä\82¢\82Ü\82·\81B\8e\9f\82Ì\83\8a\83\8a\81[\83X\83o\81[\83W\83\87\83\93\82©\82ç\82ÍPHP4\82Ì\83T\83|\81[\83g\82Í\82µ\82È\82¢\82Ì\82Å\81A\82Í\82â\82­PHP5\82É\90Ø\82è\91Ö\82¦\82Ü\82µ\82å\82¤\81I';
+        }
+
+       // lengthen tpartname column of nucleus_template
+       $query = "      ALTER TABLE `" . sql_table('template') . "`
+                                       MODIFY `tpartname` varchar(64) NOT NULL default '' ;";
+
+       upgrade_query('Altering ' . sql_table('template') . ' table', $query);
+       
+       // lengthen tdname column of nucleus_template_desc
+       $query = "      ALTER TABLE `" . sql_table('template_desc') . "`
+                                       MODIFY `tdname` varchar(64) NOT NULL default '' ;";
+
+       upgrade_query('Altering ' . sql_table('template_desc') . ' table', $query);
+       
+       // create DebugVars setting
+       if (!upgrade_checkIfCVExists('DebugVars')) {
+               $query = 'INSERT INTO '.sql_table('config')." VALUES ('DebugVars',0)";
+               upgrade_query('Creating DebugVars config value',$query);        
+       }
+       
+       // create DefaultListSize setting
+       if (!upgrade_checkIfCVExists('DefaultListSize')) {
+               $query = 'INSERT INTO '.sql_table('config')." VALUES ('DefaultListSize',10)";
+               upgrade_query('Creating DefaultListSize config value',$query);  
+       }
+       
+       // changing the member table
+    $query = ' ALTER TABLE ' . sql_table('member') . ' ADD mautosave TINYINT(2) DEFAULT 1';
+       upgrade_query('Adding a new row for the autosave member option', $query);
+
+       // 3.31 -> 3.4
+       // update database version
+       update_version('340');
+       
+}
+
+?>