Skip to content
Snippets Groups Projects
Commit e28e5bf8 authored by nohup's avatar nohup
Browse files

Issue #135533 by akosipax: Added check for current user

parent 53ccea3c
No related branches found
No related tags found
No related merge requests found
...@@ -88,6 +88,14 @@ class me_plugin_argument_validate_me_alias extends views_plugin_argument_validat ...@@ -88,6 +88,14 @@ class me_plugin_argument_validate_me_alias extends views_plugin_argument_validat
// and check to be sure. // and check to be sure.
foreach ($uid_args as $key => $uid_arg) { foreach ($uid_args as $key => $uid_arg) {
$uid_args[$key] = _me_check_arg($uid_arg, $this->argument->options['me_validate_user_argument_type'] == 'name', FALSE); $uid_args[$key] = _me_check_arg($uid_arg, $this->argument->options['me_validate_user_argument_type'] == 'name', FALSE);
//Make sure we only allow access to the current user
if (is_numeric($uid_args[$key])) {
if ($uid_args[$key] != $GLOBALS['user']->uid) {
return FALSE;
}
} else if ($uid_args[$key] != $GLOBALS['user']->name) {
return FALSE;
}
} }
$argument = implode($seperator, $uid_args); $argument = implode($seperator, $uid_args);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment