summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-06-26 17:35:58 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-06-26 18:15:24 +0200
commitdb115429f7d0968b415a0abba51fe61a4ead94a4 (patch)
tree50beee53098c59bf698b40e9f0f433c4cb82d284 /apps
parentde4a540ce6349e7f901be412fb24899b188b3414 (diff)
downloadnextcloud-server-db115429f7d0968b415a0abba51fe61a4ead94a4.tar.gz
nextcloud-server-db115429f7d0968b415a0abba51fe61a4ead94a4.zip
Added createUser hook.
Diffstat (limited to 'apps')
-rw-r--r--apps/contacts/appinfo/app.php1
-rw-r--r--apps/contacts/lib/hooks.php10
2 files changed, 11 insertions, 0 deletions
diff --git a/apps/contacts/appinfo/app.php b/apps/contacts/appinfo/app.php
index 7a04ec7ff5e..64fe00eef10 100644
--- a/apps/contacts/appinfo/app.php
+++ b/apps/contacts/appinfo/app.php
@@ -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');
diff --git a/apps/contacts/lib/hooks.php b/apps/contacts/lib/hooks.php
index 0a920fc519d..9794a9c9b94 100644
--- a/apps/contacts/lib/hooks.php
+++ b/apps/contacts/lib/hooks.php
@@ -34,6 +34,16 @@
*/
class OC_Contacts_Hooks{
/**
+ * @brief Add default Addressbooks of a certain user
+ * @param paramters parameters from postDeleteUser-Hook
+ * @return array
+ */
+ static public function createUser($parameters) {
+ OC_Contacts_Addressbook::addDefault($parameters['uid'],'default','Default Address Book');
+ return true;
+ }
+
+ /**
* @brief Deletes all Addressbooks of a certain user
* @param paramters parameters from postDeleteUser-Hook
* @return array