Only check for missing attributes if the entry does not exist yet.
authorGunnar Wrobel <p@rdus.de>
Mon, 13 Apr 2009 20:55:57 +0000 (22:55 +0200)
committerGunnar Wrobel <p@rdus.de>
Mon, 13 Apr 2009 20:55:57 +0000 (22:55 +0200)
framework/Kolab_Server/lib/Horde/Kolab/Server/Object/Kolab/User.php

index ae816d6..f4afe71 100644 (file)
@@ -275,11 +275,13 @@ class Horde_Kolab_Server_Object_Kolab_User extends Horde_Kolab_Server_Object_Kol
      */
     public function save($info)
     {
-        if (!isset($info['cn'])) {
-            if (!isset($info['sn']) || !isset($info['givenName'])) {
-                throw new Horde_Kolab_Server_Exception(_("Either the last name or the given name is missing!"));
-            } else {
-                $info['cn'] = $this->generateId($info);
+        if (!$this->exists()) {
+            if (!isset($info['cn'])) {
+                if (!isset($info['sn']) || !isset($info['givenName'])) {
+                    throw new Horde_Kolab_Server_Exception(_("Either the last name or the given name is missing!"));
+                } else {
+                    $info['cn'] = $this->generateId($info);
+                }
             }
         }