Remove all events owned by the specified user in all calendars.
public static removeUserEvents ( string $user ) | ||
$user | string | The user name to delete events for. |
/** */ public function removeUserData($user) { $error = false; // Remove all events owned by the user in all calendars. Kronolith::removeUserEvents($user); // Get the shares owned by the user being deleted. try { $kronolith_shares = $GLOBALS['injector']->getInstance('Kronolith_Shares'); $shares = $kronolith_shares->listShares($user, array('attributes' => $user)); foreach ($shares as $share) { $kronolith_shares->removeShare($share); } } catch (Exception $e) { Horde::log($e, 'NOTICE'); $error = true; } /* Get a list of all shares this user has perms to and remove the * perms */ try { $shares = $kronolith_shares->listShares($user); foreach ($shares as $share) { $share->removeUser($user); } } catch (Horde_Share_Exception $e) { Horde::log($e, 'NOTICE'); $error = true; } if ($error) { throw new Kronolith_Exception(sprintf(_("There was an error removing calendars for %s. Details have been logged."), $user)); } }