]> source.dussan.org Git - nextcloud-server.git/commitdiff
Added hooks for postCreateUser to add default address book and calendar. Fixes oc...
authorThomas Tanghus <thomas@tanghus.net>
Tue, 17 Jul 2012 08:45:15 +0000 (10:45 +0200)
committerThomas Tanghus <thomas@tanghus.net>
Tue, 17 Jul 2012 08:45:15 +0000 (10:45 +0200)
apps/contacts/appinfo/app.php
apps/contacts/lib/hooks.php

index 20d97697bf43975798281f4e362c3241f8c18a93..a298857d605a2666b5178c51b7329501bdec6df2 100644 (file)
@@ -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');
index e3d5df3d51fd227c8ce65a3256367f651df0bffb..3afad1ef7d332e2e841f2a882c261484ffa9f89c 100644 (file)
  * 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