summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2006-09-08 15:16:47 +0000
committerthomascube <thomas@roundcube.net>2006-09-08 15:16:47 +0000
commit7139e33e6c7dcd206e166416e7b5742bc3849cb9 (patch)
treee48e620ea095afa82804908736e8ce5a69bc5d35 /program/include
parent8acab006085216223111baccc19bc834807b62fc (diff)
Updated MDB2 with MSSQL support + some cosmetics
Diffstat (limited to 'program/include')
-rw-r--r--program/include/main.inc2
-rwxr-xr-xprogram/include/rcube_mdb2.inc22
2 files changed, 23 insertions, 1 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index c084588cf..02f5b5713 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -185,7 +185,7 @@ function rcmail_authenticate_session()
// renew auth cookie every 5 minutes (only for GET requests)
if (!$valid || ($_SERVER['REQUEST_METHOD']!='POST' && $now-$_SESSION['auth_time'] > 300))
{
- $_SESSION['last_auth'] = $_SESSION['auth_time'];
+ $_SESSION['last_auth'] = $_SESSION['auth_time'];
$_SESSION['auth_time'] = $now;
setcookie('sessauth', rcmail_auth_hash(session_id(), $now));
}
diff --git a/program/include/rcube_mdb2.inc b/program/include/rcube_mdb2.inc
index eec975c69..d37230268 100755
--- a/program/include/rcube_mdb2.inc
+++ b/program/include/rcube_mdb2.inc
@@ -411,6 +411,25 @@ class rcube_db
/**
+ * Return SQL function for current time and date
+ *
+ * @return string SQL function to use in query
+ * @access public
+ */
+ function now()
+ {
+ switch($this->db_provider)
+ {
+ case 'mssql':
+ return "getdate()";
+
+ default:
+ return "now()";
+ }
+ }
+
+
+ /**
* Return SQL statement to convert a field value into a unix timestamp
*
* @param string Field name
@@ -425,6 +444,9 @@ class rcube_db
return "EXTRACT (EPOCH FROM $field)";
break;
+ case 'mssql':
+ return "datediff(s, '1970-01-01 00:00:00', $field)";
+
default:
return "UNIX_TIMESTAMP($field)";
}