function privatemsg_view_access

1 privatemsg.module privatemsg_view_access()
7-1 privatemsg.module privatemsg_view_access($thread)
7-2 privatemsg.module privatemsg_view_access($thread)
6-2 privatemsg.module privatemsg_view_access($thread)

Check access to the view messages page.

Function to restrict the access of the view messages page to just the messages/view/% pages and not to leave tabs artifact on other lower level pages such as the messages/new/%.


$thread: A array containing all information about a specific thread, generated by privatemsg_thread_load().

Related topics

1 string reference to 'privatemsg_view_access'
privatemsg_menu in ./privatemsg.module
Implements hook_menu().


./privatemsg.module, line 366
Allows users to send private messages to other users.


function privatemsg_view_access($thread) {
  // Do not allow access to threads without messages.
  if (empty($thread['messages'])) {
    // Count all messages, if there
    return FALSE;
  if (privatemsg_user_access('read privatemsg') && arg(1) == 'view') {
    return TRUE;
  return FALSE;