mango r173 - in trunk: . www



Author: ovitters
Date: Sat May 31 22:50:00 2008
New Revision: 173
URL: http://svn.gnome.org/viewvc/mango?rev=173&view=rev

Log:
	* www/update_user.php: Ensure all attributes of a user are updated;
	meaning: if there are changes in the general section, the SSH keys
	should still receive updates as well.



Modified:
   trunk/ChangeLog
   trunk/www/update_user.php

Modified: trunk/www/update_user.php
==============================================================================
--- trunk/www/update_user.php	(original)
+++ trunk/www/update_user.php	Sat May 31 22:50:00 2008
@@ -124,26 +124,27 @@
 
         $changes = false;
         if (!empty($_POST['updateuser'])) {
-            $changes = $this->process_general_tab($dom, $formnode);
-            $changes = $changes or $this->process_sshkeys_tab($dom, $formnode);
-            $changes = $changes or $this->process_groups_tab($dom, $formnode);
-        }
-        $changes = $changes or $this->process_actions_tab($dom, $formnode);
-
-        if ($changes) {
-            $formerrors = $this->user->validate();
-
-            if(count($formerrors) > 0) {
-                foreach($formerrors as $error) {
-                    $node = $formnode->appendChild($dom->createElement("formerror"));
-                    $node->setAttribute("type", $error);
+            $changes = ($this->process_general_tab($dom, $formnode)) or $changes; // NOTE: Make sure or $changes is last!
+            $changes = ($this->process_sshkeys_tab($dom, $formnode)) or $changes;
+            $changes = ($this->process_groups_tab($dom, $formnode)) or $changes;
+
+            if ($changes) {
+                $formerrors = $this->user->validate();
+
+                if(count($formerrors) > 0) {
+                    foreach($formerrors as $error) {
+                        $node = $formnode->appendChild($dom->createElement("formerror"));
+                        $node->setAttribute("type", $error);
+                    }
+                } else {
+                    // Attempt LDAP update
+                    $result = $this->user->update();
+                    if(!PEAR::isError($result))
+                        $formnode->appendChild($dom->createElement("updated")); // Mark success
                 }
-            } else {
-                // Attempt LDAP update
-                $result = $this->user->update();
-                if(!PEAR::isError($result))
-                    $formnode->appendChild($dom->createElement("updated")); // Mark success
             }
+        } else {
+            $result = $this->process_actions_tab($dom, $formnode);
         }
 
         // Report an exception



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]