[ticket/11915] Make it possible to display trigger_error() messages to user.

PHPBB3-11915
This commit is contained in:
Cesar G 2013-11-10 18:31:58 -08:00
parent 0ea110292b
commit 2719a18f7f
2 changed files with 23 additions and 3 deletions

View file

@ -255,8 +255,18 @@ if (!$auth->acl_get('f_read', $forum_id))
{
trigger_error('USER_CANNOT_READ');
}
$message = $user->lang['LOGIN_EXPLAIN_POST'];
login_box('', $user->lang['LOGIN_EXPLAIN_POST']);
if ($request->is_ajax())
{
$json = new phpbb\json_response();
$json->send(array(
'title' => $user->lang['INFORMATION'],
'message' => $message,
));
}
login_box('', $message);
}
// Permission to do the action asked?
@ -326,8 +336,18 @@ if (!$is_authed)
{
trigger_error('USER_CANNOT_' . strtoupper($check_auth));
}
$message = $user->lang['LOGIN_EXPLAIN_' . strtoupper($mode)];
login_box('', $user->lang['LOGIN_EXPLAIN_' . strtoupper($mode)]);
if ($request->is_ajax())
{
$json = new phpbb\json_response();
$json->send(array(
'title' => $user->lang['INFORMATION'],
'message' => $message,
));
}
login_box('', $message);
}
// Is the user able to post within this forum?

View file

@ -51,7 +51,7 @@ phpbb.plupload = {
unique_names: true,
filters: [{FILTERS}],
{S_RESIZE}
headers: {'X-PHPBB-USING-PLUPLOAD': '1'},
headers: {'X-PHPBB-USING-PLUPLOAD': '1', 'X-Requested-With': 'XMLHttpRequest'},
file_data_name: 'fileupload',
multipart_params: {'add_file': '{LA_ADD_FILE}'},
img_path: '{T_ASSETS_PATH}/plupload/jquery.plupload.queue/img',