リビジョン | 2cf98c47a812b551b49500971fd75964e59a7dee (tree) |
---|---|
日時 | 2022-03-27 01:49:30 |
作者 | umorigu <umorigu@gmai...> |
コミッター | umorigu |
BugTrack/2565 Fix read_auth and edit_auth apply condition
* if $read_auth is 0, is_page_readable() always returns TRUE
* if $edit_auth is 0, is_page_writable() always returns TRUE
@@ -244,7 +244,10 @@ function check_editable($page, $auth_enabled = TRUE, $exit_on_fail = TRUE) | ||
244 | 244 | * Whether the page is readable from current user or not. |
245 | 245 | */ |
246 | 246 | function is_page_readable($page) { |
247 | - global $read_auth_pages; | |
247 | + global $read_auth_pages, $read_auth; | |
248 | + if (!$read_auth) { | |
249 | + return TRUE; | |
250 | + } | |
248 | 251 | return _is_page_accessible($page, $read_auth_pages); |
249 | 252 | } |
250 | 253 |
@@ -252,7 +255,10 @@ function is_page_readable($page) { | ||
252 | 255 | * Whether the page is writable from current user or not. |
253 | 256 | */ |
254 | 257 | function is_page_writable($page) { |
255 | - global $edit_auth_pages; | |
258 | + global $edit_auth_pages, $edit_auth; | |
259 | + if (!$edit_auth) { | |
260 | + return TRUE; | |
261 | + } | |
256 | 262 | return _is_page_accessible($page, $edit_auth_pages); |
257 | 263 | } |
258 | 264 |