* Check for $delete_# properly
authorfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 11 May 2001 12:49:29 +0000 (12:49 +0000)
committerfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 11 May 2001 12:49:29 +0000 (12:49 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1357 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/options_identities.php

index ececa25..5b900cf 100644 (file)
    if (CheckAndDoDefault() || CheckAndDoPromote()) {
       SaveUpdateFunction();
    }
-   if (isset($update) || isset($delete_0) || isset($delete_1) || 
-       isset($delete_2) || isset($delete_3) || isset($delete_4) || 
-          isset($delete_5) || isset($delete_6) || isset($delete_7) || 
-          isset($delete_8))
+   if (isset($update) || CheckForDelete())
       SaveUpdateFunction();
 
    LoadInfo($full_name, $email_address, $reply_to, '');
@@ -179,6 +176,28 @@ function CheckAndDoDefault()
    return false;
 }
 
+function CheckForDelete()
+{
+   global $username, $data_dir, $full_name, $email_address, $reply_to;
+    
+   $i = 1;
+   $name = 'form_for_' . $i;
+   global $$name;
+   while (isset($$name))
+   {
+      $name = 'delete_' . $i;
+      global $$name;
+      if (isset($$name)) {
+          return true;
+      }
+      
+      $i ++;
+      $name = 'form_for_' . $i;
+      global $$name;
+   }
+   return false;
+}
+
 function CheckAndDoPromote()
 {
    global $username, $data_dir, $full_name, $email_address, $reply_to;