*さくらインターネットでpukiwikiの編集認証を個別のページにかけられない [#c3b89dc6] お手数をかけてしまって申し訳ありません。~ 行った手順を書きます。 **手順 [#oce1b848] +バイナリ「pukiwiki-1.4.6.tar.gz」をサーバにアップロードしtarコマンドでwww直下に展開、ディレクトリ名をpukiwikiに変更。 +.htaccessを編集(追記)する。 +/home/usernameに.htpasswdを作成。ユーザをsandとする。 +index.phpをコピーし、edit.phpを作成・編集。 +pukiwiki.ini.phpを編集。 +lib/auth.phpを編集。 +アクセスしてみる ++FrontPageにアクセス。(index.php) ++SandBoxにアクセス。(index.php) ++SandBoxの編集(index.php)>編集できません。 ++FrontPageにアクセス。(edit.php) ++ベーシック認証。 ++SandBoxにアクセス。(edit.php) ++SandBoxの編集(edit.php)>編集できません。 ここまでです。 **編集したファイルの中身 [#d3745831] ***.htaccess [#hf15757d] <Files edit.php> AuthUserFile /home/username/.htpasswd AuthGroupFile /dev/null AuthName "Please enter your ID and password" AuthType Basic require valid-user </Files> ***.htpasswd [#l1c483de] sand:ugCnl/No3ak9E ***edit.php [#pab99bef] ///////////////////////////////////////////////// // Directory definition // (Ended with a slash like '../path/to/pkwk/', or '') define('DATA_HOME', ''); define('LIB_DIR', 'lib/'); define('EDIT_OK','yes'); //ココ ///////////////////////////////////////////////// require(LIB_DIR . 'pukiwiki.php'); ?> ***pukiwiki.ini.php [#gd826103] if(defined('EDIT_OK')) $script = 'http://hostname/edit.php';//L118 を追加(正しく変更) $modifierlink = 'http://pukiwiki.example.com/';//L126 を修正 $adminpass = '{x-php-md5}1a1dc91c907325c69271ddf0c944bc72'; //L193 を修正 'foo' => 'foo_passwd', 'bar' => '{x-php-md5}f53ae779077e987718cc285b14dfbe86', をそれぞれ 'sand' => 'pass', 'test' => 'pass', に変更。 'hoge'はコメントアウト。 L239、L240を //$auth_method_type = 'contents'; $auth_method_type = 'pagename'; に。 L252からL261を ///////////////////////////////////////////////// // Edit auth (0:Disable, 1:Enable) $edit_auth = 1; // Edit auth regex $edit_auth_pages = array( '#^.*$#' => 'test', '#^SandBox$#' => 'sand', // '#(ネタバレ|ねたばれ)#' => 'foo,bar,hoge', ); に。 ***lib/auth.php [#p4f752d8] if (empty($user_list)) return TRUE; // No limit の後、 L187の位置に $auth_flag = FALSE; if(defined('EDIT_AUTH') and isset($_SERVER['REMOTE_USER'])) { $_SERVER['PHP_AUTH_USER'] = $_SERVER['REMOTE_USER']; $_SERVER['PHP_AUTH_PW'] = 'pass'; } 追加。