[Svn] r2447 - trunk/roundcubemail/program/steps/mail

trac at roundcube.net trac at roundcube.net
Sat May 2 20:47:15 CEST 2009


Author: alec
Date: 2009-05-02 13:47:14 -0500 (Sat, 02 May 2009)
New Revision: 2447

Modified:
   trunk/roundcubemail/program/steps/mail/addcontact.inc
Log:
- added create_contact hook in mail/addcontact action (#1485828)


Modified: trunk/roundcubemail/program/steps/mail/addcontact.inc
===================================================================
--- trunk/roundcubemail/program/steps/mail/addcontact.inc	2009-05-02 14:19:24 UTC (rev 2446)
+++ trunk/roundcubemail/program/steps/mail/addcontact.inc	2009-05-02 18:47:14 UTC (rev 2447)
@@ -41,8 +41,14 @@
     $existing = $CONTACTS->search('email', $contact['email'], true, false);
     if ($done = $existing->count)
       $OUTPUT->show_message('contactexists', 'warning');
-    else if ($done = $CONTACTS->insert($contact))
-      $OUTPUT->show_message('addedsuccessfully', 'confirmation');
+    else
+    {
+      $plugin = $RCMAIL->plugins->exec_hook('create_contact', array('record' => $contact, 'source' => get_input_value('_source', RCUBE_INPUT_GPC)));
+      $contact = $plugin['record'];
+
+      if (!$plugin['abort'] && ($done = $CONTACTS->insert($contact)))
+        $OUTPUT->show_message('addedsuccessfully', 'confirmation');
+    }
   }
 }
 

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list