summaryrefslogtreecommitdiff
path: root/modules/trigger
diff options
context:
space:
mode:
Diffstat (limited to 'modules/trigger')
-rw-r--r--modules/trigger/tests/trigger_test.module1
-rw-r--r--modules/trigger/trigger.module14
2 files changed, 13 insertions, 2 deletions
diff --git a/modules/trigger/tests/trigger_test.module b/modules/trigger/tests/trigger_test.module
index 4793ad05f..028f64b7d 100644
--- a/modules/trigger/tests/trigger_test.module
+++ b/modules/trigger/tests/trigger_test.module
@@ -35,6 +35,7 @@ function trigger_test_action_info() {
'comment_insert',
'comment_update',
'comment_delete',
+ 'user_presave',
'user_insert',
'user_update',
'user_delete',
diff --git a/modules/trigger/trigger.module b/modules/trigger/trigger.module
index 7c831ebe4..9742509bb 100644
--- a/modules/trigger/trigger.module
+++ b/modules/trigger/trigger.module
@@ -136,11 +136,14 @@ function trigger_trigger_info() {
),
),
'user' => array(
+ 'user_presave' => array(
+ 'label' => t('When either creating a new user account or updating an existing'),
+ ),
'user_insert' => array(
- 'label' => t('After a user account has been created'),
+ 'label' => t('After creating a new user account'),
),
'user_update' => array(
- 'label' => t("After a user's profile has been updated"),
+ 'label' => t('After updating a user account'),
),
'user_delete' => array(
'label' => t('After a user has been deleted'),
@@ -470,6 +473,13 @@ function trigger_user_logout($account) {
}
/**
+ * Implement hook_user_presave().
+ */
+function trigger_user_presave(&$edit, $account, $category) {
+ _trigger_user('user_presave', $edit, $account, $category);
+}
+
+/**
* Implement hook_user_insert().
*/
function trigger_user_insert(&$edit, $account, $category) {