From cad8f7538eb1f558bd3e8ff220fcb80bd89b854d Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 4 Nov 2014 12:42:39 +0100 Subject: [PATCH] Leave it up to the database to decide what is the current time --- library/Icinga/Authentication/Backend/DbUserBackend.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/library/Icinga/Authentication/Backend/DbUserBackend.php b/library/Icinga/Authentication/Backend/DbUserBackend.php index 0d79ca028f..876f1ff070 100644 --- a/library/Icinga/Authentication/Backend/DbUserBackend.php +++ b/library/Icinga/Authentication/Backend/DbUserBackend.php @@ -67,13 +67,12 @@ public function hasUser(User $user) public function addUser($username, $password, $active = true) { $stmt = $this->conn->getDbAdapter()->prepare( - 'INSERT INTO icingaweb_user VALUES (:name, :active, :password_hash, :ctime);' + 'INSERT INTO icingaweb_user VALUES (:name, :active, :password_hash, now(), DEFAULT);' ); $stmt->execute(array( ':name' => $username, ':active' => (int) $active, - ':password_hash' => $this->hashPassword($password), - ':ctime' => time() + ':password_hash' => $this->hashPassword($password) )); }