Revisión | 20becf2679bd9ddf27d525a801d8a0a08d5b420f (tree) |
---|---|
Tiempo | 2017-09-10 10:30:13 |
Autor | umorigu <umorigu@gmai...> |
Commiter | umorigu |
BugTrack/2265 Enable edit_auth for bugtrack and tracker plugin
@@ -202,6 +202,7 @@ function plugin_bugtrack_write($base, $pagename, $summary, $name, $priority, $st | ||
202 | 202 | } |
203 | 203 | $page = $base . '/' . sprintf(PLUGIN_BUGTRACK_NUMBER_FORMAT, $id); |
204 | 204 | |
205 | + check_editable($page, true, true); | |
205 | 206 | if ($pagename == '') { |
206 | 207 | page_write($page, $postdata); |
207 | 208 | } else { |
@@ -209,6 +210,7 @@ function plugin_bugtrack_write($base, $pagename, $summary, $name, $priority, $st | ||
209 | 210 | if (is_page($pagename) || ! is_pagename($pagename)) { |
210 | 211 | $pagename = $page; // Set default |
211 | 212 | } else { |
213 | + check_editable($pagename, true, true); | |
212 | 214 | page_write($page, 'move to [[' . $pagename . ']]'); |
213 | 215 | } |
214 | 216 | page_write($pagename, $postdata); |
@@ -160,6 +160,7 @@ function plugin_tracker_action() | ||
160 | 160 | |
161 | 161 | $fields = plugin_tracker_get_fields($page,$refer,$config); |
162 | 162 | |
163 | + check_editable($page, true, true); | |
163 | 164 | // Creating an empty page, before attaching files |
164 | 165 | touch(get_filename($page)); |
165 | 166 |
@@ -625,7 +626,7 @@ class Tracker_field_past extends Tracker_field | ||
625 | 626 | // 一覧表示 |
626 | 627 | function plugin_tracker_list_convert() |
627 | 628 | { |
628 | - global $vars; | |
629 | + global $vars, $_title_cannotread; | |
629 | 630 | |
630 | 631 | $config = 'default'; |
631 | 632 | $page = $refer = $vars['page']; |
@@ -650,11 +651,15 @@ function plugin_tracker_list_convert() | ||
650 | 651 | list($config,$list) = array_pad(explode('/',$config,2),2,$list); |
651 | 652 | } |
652 | 653 | } |
654 | + if (!is_page_readable($page)) { | |
655 | + $body = str_replace('$1', htmlsc($page), $_title_cannotread); | |
656 | + return $body; | |
657 | + } | |
653 | 658 | return plugin_tracker_getlist($page,$refer,$config,$list,$order,$limit); |
654 | 659 | } |
655 | 660 | function plugin_tracker_list_action() |
656 | 661 | { |
657 | - global $vars,$_tracker_messages; | |
662 | + global $vars, $_tracker_messages, $_title_cannotread; | |
658 | 663 | |
659 | 664 | $page = $refer = $vars['refer']; |
660 | 665 | $s_page = make_pagelink($page); |
@@ -662,6 +667,13 @@ function plugin_tracker_list_action() | ||
662 | 667 | $list = array_key_exists('list',$vars) ? $vars['list'] : 'list'; |
663 | 668 | $order = array_key_exists('order',$vars) ? $vars['order'] : '_real:SORT_DESC'; |
664 | 669 | |
670 | + if (!is_page_readable($page)) { | |
671 | + $body = str_replace('$1', htmlsc($page), $_title_cannotread); | |
672 | + return array( | |
673 | + 'msg' => $body, | |
674 | + 'body' => $body | |
675 | + ); | |
676 | + } | |
665 | 677 | return array( |
666 | 678 | 'msg' => $_tracker_messages['msg_list'], |
667 | 679 | 'body'=> str_replace('$1',$s_page,$_tracker_messages['msg_back']). |
@@ -879,7 +891,6 @@ class Tracker_list | ||
879 | 891 | } |
880 | 892 | function replace_title($arr) |
881 | 893 | { |
882 | - $script = get_base_uri(); | |
883 | 894 | $field = $sort = $arr[1]; |
884 | 895 | if ($sort == '_name' or $sort == '_page') |
885 | 896 | { |
@@ -917,6 +928,7 @@ class Tracker_list | ||
917 | 928 | $_order[] = "$key:$value"; |
918 | 929 | $r_order = rawurlencode(join(';',$_order)); |
919 | 930 | |
931 | + $script = get_base_uri(PKWK_URI_ABSOLUTE); | |
920 | 932 | return "[[$title$arrow>$script?plugin=tracker_list&refer=$r_page&config=$r_config&list=$r_list&order=$r_order]]"; |
921 | 933 | } |
922 | 934 | function toString($limit=NULL) |