Ajax sorting of exposed filter not working when "access code" used at View's Page settings

- checking if the user watching his profile

global $user;
if (arg(0) == 'user' && is_numeric(arg(1)) && $user->uid == arg(1)) {
return TRUE; // tab & view will be shown
}
return FALSE;

But admin could make ajax sorting.
Also user can do
with "Bypass views access control" permission or
if Ajax switched off or
if Javascript is off (at admin/structure/views/settings/advanced).

Comments

A.Kotov’s picture

strange this code is working as expected

global $user;
  if (arg(0) == 'user' && is_numeric(arg(1)) && $user->uid <> arg(1)) {  // change from $user->uid == arg(1))
  return FALSE;  
  }
   return TRUE; // block will be shown