2011-08-11 09:22:07 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2011-09-23 20:59:24 +00:00
|
|
|
* Copyright (c) 2011 Jakob Sack <mail@jakobsack.de>
|
|
|
|
* This file is licensed under the Affero General Public License version 3 or
|
|
|
|
* later.
|
|
|
|
* See the COPYING-README file.
|
2011-08-11 09:22:07 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This class contains all hooks.
|
|
|
|
*/
|
|
|
|
class OC_Calendar_Hooks{
|
|
|
|
/**
|
|
|
|
* @brief Deletes all Addressbooks of a certain user
|
|
|
|
* @param paramters parameters from postDeleteUser-Hook
|
|
|
|
* @return array
|
|
|
|
*/
|
2011-09-18 14:34:41 +00:00
|
|
|
public static function deleteUser($parameters) {
|
2011-08-11 09:22:07 +00:00
|
|
|
$calendars = OC_Calendar_Calendar::allCalendars($parameters['uid']);
|
2012-03-02 19:25:20 +00:00
|
|
|
|
2011-08-11 09:22:07 +00:00
|
|
|
foreach($calendars as $calendar) {
|
2011-08-22 14:59:16 +00:00
|
|
|
OC_Calendar_Calendar::deleteCalendar($calendar['id']);
|
2011-08-11 09:22:07 +00:00
|
|
|
}
|
|
|
|
|
2012-05-13 18:03:27 +00:00
|
|
|
OC_Calendar_Share::post_userdelete($parameters['uid']);
|
|
|
|
|
2011-08-11 09:22:07 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|