From 194fbe263e2a862d3bb341ccbadd724f8d8b79e4 Mon Sep 17 00:00:00 2001 From: Timo Litzbarski Date: Fri, 11 Mar 2016 11:59:23 +0000 Subject: user and data for metadata + settings user and date for metadata #1853 #1861 --- app/Model/Setting.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/Model/Setting.php') diff --git a/app/Model/Setting.php b/app/Model/Setting.php index 6d29c6ec..4e1c1b0b 100644 --- a/app/Model/Setting.php +++ b/app/Model/Setting.php @@ -81,14 +81,16 @@ abstract class Setting extends Base { $results = array(); $values = $this->prepare($values); + $user_id = $this->userSession->getId(); + $timestamp = time(); $this->db->startTransaction(); foreach ($values as $option => $value) { if ($this->exists($option)) { - $results[] = $this->db->table(self::TABLE)->eq('option', $option)->update(array('value' => $value)); + $results[] = $this->db->table(self::TABLE)->eq('option', $option)->update(array('value' => $value, 'changed_on' => $timestamp, 'changed_by' => $user_id)); } else { - $results[] = $this->db->table(self::TABLE)->insert(array('option' => $option, 'value' => $value)); + $results[] = $this->db->table(self::TABLE)->insert(array('option' => $option, 'value' => $value, 'changed_on' => $timestamp, 'changed_by' => $user_id)); } } -- cgit v1.2.3