From 8c42270a9ee96852cacb7d4a87560a0f73ffe9bf Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Sun, 1 May 2016 15:19:38 -0500 Subject: [PATCH] Issue 156: SSH keys added are not getting proper added date set --- indefero/src/IDF/Key.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/indefero/src/IDF/Key.php b/indefero/src/IDF/Key.php index 6fa4f99..8c01a80 100644 --- a/indefero/src/IDF/Key.php +++ b/indefero/src/IDF/Key.php @@ -154,6 +154,14 @@ class IDF_Key extends Pluf_Model return sha1($keyName.":".$keyData); } + function preSave($create = false) + { + if ($create) { + $this->creation_dtime = gmdate('Y-m-d H:i:s'); + } + parent::preSave($create); + } + function postSave($create=false) { /** @@ -179,10 +187,6 @@ class IDF_Key extends Pluf_Model $params = array('key' => $this, 'created' => $create); Pluf_Signal::send('IDF_Key::postSave', 'IDF_Key', $params); - - if ($create) { - $this->creation_dtime = gmdate('Y-m-d H:i:s'); - } } function preDelete()