one more identity action to process
[squirrelmail.git] / functions / identity.php
index e4fc93255db4acb20b878039f0ce3868f2fec8f1..17215555da88ccf1dfafa2d6fb5bbc5a98a0f0f2 100644 (file)
@@ -142,6 +142,10 @@ function sqfixidentities( $identities, $id, $action ) {
 
                 if ($key == $id) {
                     $fixed[0] = $ident;
+
+                    // inform plugins about renumbering of ids
+                    do_hook('options_identities_renumber', $id, 'default');
+
                     continue 2;
                 } else {
                     $fixed[$i+1] = $ident;
@@ -152,6 +156,10 @@ function sqfixidentities( $identities, $id, $action ) {
 
                 if ($key == ($id - 1)) {
                     $tmp_hold = $ident;
+
+                    // inform plugins about renumbering of ids
+                    do_hook('options_identities_renumber', $id , $id - 1);
+
                     continue 2;
                 } else {
                     $fixed[$i] = $ident;
@@ -166,14 +174,25 @@ function sqfixidentities( $identities, $id, $action ) {
             case 'delete':
 
                 if ($key == $id) {
+                    // inform plugins about deleted id
+                    do_hook('options_identities_process', $action, $id);
+
                     continue 2;
                 } else {
                     $fixed[$i] = $ident;
                 }
                 break;
 
-            // we should never hit this but just in case //
+            // Process actions from plugins and save/update action //
             default:
+                /**
+                 * send action and id information. number of hook arguments 
+                 * differs from 1.4.4 or older and 1.5.0. count($args) can 
+                 * be used to detect modified hook. Older hook does not 
+                 * provide information that can be useful for plugins.
+                 */
+                do_hook('options_identities_process', $action, $id);
+
                 $fixed[$i] = $ident;
 
         }