* is_edit_auth() が欲しい [#s5c62ddc] - ページ: [[BugTrack2]] - 投稿者: [[sonots]] - 優先順位: 低 - 状態: 提案 - カテゴリー: その他 - 投稿日: 2006-06-25 (日) 04:41:11 - バージョン: ** メッセージ [#q4ea43a4] 凍結に対しては is_freeze がありますが、 ほぼ同等の効果のある編集制限に対しては is_edit_auth がありません。 プラグインを作成していて欲しいときがあるので、Pukiwiki API にほしいです。 //referred lib/auth.php#basic_auth function is_edit_auth($page, $user = '') { global $edit_auth, $edit_auth_pages, $auth_method_type; if (! $edit_auth) { return FALSE; } // Checked by: $target_str = ''; if ($auth_method_type == 'pagename') { $target_str = $page; // Page name } else if ($auth_method_type == 'contents') { $target_str = join('', get_source($page)); // Its contents } foreach($edit_auth_pages as $regexp => $users) { if (preg_match($regexp, $target_str)) { if ($user == '' || in_array($user, explode(',', $users))) { return TRUE; } } } return FALSE; } ついでに is_read_auth もあったほうがいいとは思います((1.4.7 前に言えればよかったナァ))。 -------- #comment