Skip to content
Snippets Groups Projects
Commit 9326f4f5 authored by Thomas Tanghus's avatar Thomas Tanghus
Browse files

Added hooks for postCreateUser to add default address book and calendar. Fixes oc-1265.

parent f4a8c233
Branches
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment