Skip to content

Commit

Permalink
Partially revert 4da58a5
Browse files Browse the repository at this point in the history
This won't work as inteded, as both agendas AND alarms can set $user.
This was causing non-admin users to have 'busy' appear as the alarm
title in place of the actual event title.
  • Loading branch information
mrubinsk committed Nov 6, 2015
1 parent 1090f9f commit 847e6bc
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions kronolith/lib/Event.php
Expand Up @@ -2583,9 +2583,8 @@ public function boundExceptions($flat = true)
* Returns whether the event should be considered private.
*
* The event's private flag can be overriden if the current user
* is an administrator and the code is run from command line, and no
* $user parameter was passed. This is to allow full event notifications in
* alarm messages (agendas know the user the agenda is being prepared for).
* is an administrator and the code is run from command line. This is to
* allow full event notifications in alarm messages.
*
* @param string $user The current user. If omitted, uses the current user.
*
Expand All @@ -2595,21 +2594,20 @@ public function isPrivate($user = null)
{
global $registry;

$haveNullUser = false;
if ($user === null) {
$user = $registry->getAuth();
$haveNullUser = true;
}

if (!(Horde_Cli::runningFromCLI() && $registry->isAdmin()) &&
$this->private && $this->creator != $user) {
return true;
}

if (($registry->isAdmin() && $haveNullUser) ||
if ($registry->isAdmin() ||
$this->hasPermission(Horde_Perms::READ, $user)) {
return false;
}

return true;
}

Expand Down

0 comments on commit 847e6bc

Please sign in to comment.