mirror of
https://github.com/owncloudarchive/contacts.git
synced 2025-01-18 07:52:21 +01:00
Added hooks for postCreateUser to add default address book and calendar. Fixes oc-1265.
This commit is contained in:
parent
daeac9395c
commit
ae670c222b
@ -5,6 +5,7 @@ OC::$CLASSPATH['OC_Contacts_VCard'] = 'apps/contacts/lib/vcard.php';
|
||||
OC::$CLASSPATH['OC_Contacts_Hooks'] = 'apps/contacts/lib/hooks.php';
|
||||
OC::$CLASSPATH['OC_Connector_Sabre_CardDAV'] = 'apps/contacts/lib/connector_sabre.php';
|
||||
OC::$CLASSPATH['OC_Search_Provider_Contacts'] = 'apps/contacts/lib/search.php';
|
||||
OCP\Util::connectHook('OC_User', 'post_createUser', 'OC_Contacts_Hooks', 'createUser');
|
||||
OCP\Util::connectHook('OC_User', 'post_deleteUser', 'OC_Contacts_Hooks', 'deleteUser');
|
||||
OCP\Util::connectHook('OC_Calendar', 'getEvents', 'OC_Contacts_Hooks', 'getBirthdayEvents');
|
||||
OCP\Util::connectHook('OC_Calendar', 'getSources', 'OC_Contacts_Hooks', 'getCalenderSources');
|
||||
|
@ -24,6 +24,16 @@
|
||||
* This class contains all hooks.
|
||||
*/
|
||||
class OC_Contacts_Hooks{
|
||||
/**
|
||||
* @brief Add default Addressbook for a certain user
|
||||
* @param paramters parameters from postCreateUser-Hook
|
||||
* @return array
|
||||
*/
|
||||
static public function createUser($parameters) {
|
||||
OC_Contacts_Addressbook::add($parameters['uid'],'default','Default Address Book');
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Deletes all Addressbooks of a certain user
|
||||
* @param paramters parameters from postDeleteUser-Hook
|
||||
|
Loading…
x
Reference in New Issue
Block a user