diff options
author | javiexin <javiexin@gmail.com> | 2017-06-19 23:29:54 +0200 |
---|---|---|
committer | javiexin <javiexin@gmail.com> | 2017-06-19 23:29:54 +0200 |
commit | ca5243810f313c5438e2c778cdaecfbcb375e8eb (patch) | |
tree | de11621511eb75505848f33a9c389d60ab594f37 /phpBB/posting.php | |
parent | Merge pull request #4832 from marc1706/ticket/15226 (diff) | |
download | phpbb-ca5243810f313c5438e2c778cdaecfbcb375e8eb.tar.gz phpbb-ca5243810f313c5438e2c778cdaecfbcb375e8eb.tar.bz2 phpbb-ca5243810f313c5438e2c778cdaecfbcb375e8eb.zip |
[ticket/15248] Make use of event parameters of core.modify_posting_auth
Fixes is_authed and error not behaving as expected by extensions.
PHPBB-15248
Diffstat (limited to 'phpBB/posting.php')
-rw-r--r-- | phpBB/posting.php | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php index 4651a1fd2c..d0fd2b60e8 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -340,11 +340,6 @@ switch ($mode) $is_authed = true; $mode = 'soft_delete'; } - else if (!$is_authed) - { - // Display the same error message for softdelete we use for delete - $mode = 'delete'; - } break; } /** @@ -393,13 +388,13 @@ $vars = array( ); extract($phpbb_dispatcher->trigger_event('core.modify_posting_auth', compact($vars))); -if (!$is_authed) +if (!$is_authed || !empty($error)) { - $check_auth = ($mode == 'quote') ? 'reply' : $mode; + $check_auth = ($mode == 'quote') ? 'reply' : (($mode == 'soft_delete') ? 'delete' : $mode); if ($user->data['is_registered']) { - trigger_error('USER_CANNOT_' . strtoupper($check_auth)); + trigger_error(empty($error) ? 'USER_CANNOT_' . strtoupper($check_auth) : implode('<br/>', $error)); } $message = $user->lang['LOGIN_EXPLAIN_' . strtoupper($mode)]; |