From 2d323f19cc3495568485cee8fef60cd928c63676 Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Wed, 2 Jun 2010 23:56:24 -0400 Subject: [PATCH] Fix query generation (missing commas) --- framework/Auth/lib/Horde/Auth/Sql.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/framework/Auth/lib/Horde/Auth/Sql.php b/framework/Auth/lib/Horde/Auth/Sql.php index 12f551cb4..0dde20eba 100644 --- a/framework/Auth/lib/Horde/Auth/Sql.php +++ b/framework/Auth/lib/Horde/Auth/Sql.php @@ -180,15 +180,15 @@ class Horde_Auth_Sql extends Horde_Auth_Base $values = array(); /* Build the SQL query. */ - $query .= $this->_params['username_field'] . ' = ? '; + $query .= $this->_params['username_field'] . ' = ?'; $values[] = $newID; - $query .= $this->_params['password_field'] . ' = ? '; + $query .= ', ' . $this->_params['password_field'] . ' = ?'; $values[] = Horde_Auth::getCryptedPassword($credentials['password'], '', $this->_params['encryption'], $this->_params['show_encryption']); if (empty($this->_params['soft_expiration_window'])) { if (!empty($this->_params['soft_expiration_field'])) { - $query .= $this->_params['soft_expiration_field'] . ' = ? '; + $query .= ', ' . $this->_params['soft_expiration_field'] . ' = ?'; $values[] = null; } } else { @@ -198,27 +198,27 @@ class Horde_Auth_Sql extends Horde_Auth_Base $datea['tm_mday'] + $this->_params['soft_expiration_window'], $datea['tm_year']); - $query .= $this->_params['soft_expiration_field'] . ' = ? '; + $query .= ', ' . $this->_params['soft_expiration_field'] . ' = ?'; $values[] = $date; if ($this->_params['notify_expire']) { call_user_func($this->_params['notify_expire'], $date); } - $query .= $this->_params['soft_expiration_field'] . ' = ? '; + $query .= ', ' . $this->_params['soft_expiration_field'] . ' = ?'; if (empty($this->_params['hard_expiration_window'])) { $values[] = null; } else { $datea = localtime($date, true); - $values[]= mktime($datea['tm_hour'], $datea['tm_min'], - $datea['tm_sec'], $datea['tm_mon'] + 1, - $datea['tm_mday'] + $this->_params['soft_expiration_window'], - $datea['tm_year']); - } + $values[] = mktime($datea['tm_hour'], $datea['tm_min'], + $datea['tm_sec'], $datea['tm_mon'] + 1, + $datea['tm_mday'] + $this->_params['soft_expiration_window'], + $datea['tm_year']); + } } - $query .= sprintf('WHERE %s = ?', $this->_params['username_field']); + $query .= sprintf(' WHERE %s = ?', $this->_params['username_field']); $values[] = $oldID; try { -- 2.11.0