Merge branch '2013.10' into 2014.11
[tine20] / tine20 / Admin / Controller / User.php
index e467cf3..031ecc8 100644 (file)
@@ -133,6 +133,11 @@ class Admin_Controller_User extends Tinebase_Controller_Abstract
         
         $result = $this->_userBackend->setStatus($_accountId, $_status);
         
+        if ($_status === Tinebase_Model_FullUser::ACCOUNT_STATUS_DISABLED) {
+            // TODO send this for blocked/expired, too? allow to configure this?
+            Tinebase_User::getInstance()->sendDeactivationNotification($_accountId);
+        }
+        
         return $result;
     }
     
@@ -195,8 +200,10 @@ class Admin_Controller_User extends Tinebase_Controller_Abstract
                 $_user->contact_id = $contact->getId();
             }
             
+            Tinebase_Timemachine_ModificationLog::setRecordMetaData($_user, 'update', $oldUser);
+            
             $user = $this->_userBackend->updateUser($_user);
-    
+            
             // make sure primary groups is in the list of groupmemberships
             $groups = array_unique(array_merge(array($user->accountPrimaryGroup), (array) $_user->groups));
             Admin_Controller_Group::getInstance()->setGroupMemberships($user, $groups);
@@ -265,6 +272,8 @@ class Admin_Controller_User extends Tinebase_Controller_Abstract
                 $_user->contact_id = $contact->getId();
             }
             
+            Tinebase_Timemachine_ModificationLog::setRecordMetaData($_user, 'create');
+            
             $user = $this->_userBackend->addUser($_user);
             
             // make sure primary groups is in the list of groupmemberships