diff --git a/www/mantis/Makefile b/www/mantis/Makefile
index d6f22426243..59637d605c9 100644
--- a/www/mantis/Makefile
+++ b/www/mantis/Makefile
@@ -1,10 +1,10 @@
-# $OpenBSD: Makefile,v 1.9 2008/12/07 16:03:09 mbalmer Exp $
+# $OpenBSD: Makefile,v 1.10 2008/12/23 10:51:02 mbalmer Exp $
 
 COMMENT=	web based bug tracking
 
-V=		1.1.5
+V=		1.1.6
 DISTNAME=	mantisbt-${V}
-PKGNAME=	mantis-${V}p2
+PKGNAME=	mantis-${V}p1
 CATEGORIES=	www
 HOMEPAGE=	http://www.mantisbt.org/
 
diff --git a/www/mantis/distinfo b/www/mantis/distinfo
index 35c451d2a69..0d8527aaade 100644
--- a/www/mantis/distinfo
+++ b/www/mantis/distinfo
@@ -1,5 +1,5 @@
-MD5 (mantisbt-1.1.5.tar.gz) = 8aA5AvxZir2T7a06CznH+Q==
-RMD160 (mantisbt-1.1.5.tar.gz) = keds0dF67iE7h9Ml194W123MODU=
-SHA1 (mantisbt-1.1.5.tar.gz) = jN9QwNfG4Tjv6aWeYu/82UsqAag=
-SHA256 (mantisbt-1.1.5.tar.gz) = jKRIm9HXDd3Zww3+oMWYeQ9f6X/fEIdCDPQEhEjHvBo=
-SIZE (mantisbt-1.1.5.tar.gz) = 2411502
+MD5 (mantisbt-1.1.6.tar.gz) = LgxtPdnKfRYlj8LYY2OmdQ==
+RMD160 (mantisbt-1.1.6.tar.gz) = An9kCA0amJJRFoOi9A5GbxaM+1c=
+SHA1 (mantisbt-1.1.6.tar.gz) = OORXx+qQ+gSfn7S1RLqv8jMluMk=
+SHA256 (mantisbt-1.1.6.tar.gz) = G6abI5DfLkL3rH6Sr4NnrJwJ3i8OdvJwLy6Hkz++yuE=
+SIZE (mantisbt-1.1.6.tar.gz) = 2475290
diff --git a/www/mantis/patches/patch-core_database_api_php b/www/mantis/patches/patch-core_database_api_php
new file mode 100644
index 00000000000..d0da2830747
--- /dev/null
+++ b/www/mantis/patches/patch-core_database_api_php
@@ -0,0 +1,17 @@
+$OpenBSD: patch-core_database_api_php,v 1.1 2008/12/23 10:51:02 mbalmer Exp $
+--- core/database_api.php.orig	Tue Dec 23 11:40:48 2008
++++ core/database_api.php	Tue Dec 23 11:41:35 2008
+@@ -248,11 +248,12 @@
+ 
+ 	# --------------------
+ 	# return the last inserted id
+-	function db_insert_id($p_table = null) {
++	function db_insert_id($p_table = null,$p_column = "id") {
+ 		global $g_db;
+ 
+ 		if ( isset($p_table) && db_is_pgsql() ) {
+ 			$query = "SELECT currval('".$p_table."_id_seq')";
++			$query = "SELECT currval('" . $p_table . "_" . $p_column . "_seq')"; 
+ 			$result = db_query( $query );
+ 			return db_result($result);
+ 		}
diff --git a/www/mantis/patches/patch-core_email_queue_api_php b/www/mantis/patches/patch-core_email_queue_api_php
new file mode 100644
index 00000000000..80ae741dc37
--- /dev/null
+++ b/www/mantis/patches/patch-core_email_queue_api_php
@@ -0,0 +1,19 @@
+$OpenBSD: patch-core_email_queue_api_php,v 1.1 2008/12/23 10:51:02 mbalmer Exp $
+--- core/email_queue_api.php.orig	Tue Dec 23 11:42:11 2008
++++ core/email_queue_api.php	Tue Dec 23 11:42:21 2008
+@@ -104,7 +104,7 @@
+ 					)";
+ 		db_query( $query );
+ 
+-		return db_insert_id( $t_email_table );
++		return db_insert_id( $t_email_table, "email_id" );
+ 	}
+ 
+ 	# --------------------
+@@ -176,4 +176,4 @@
+ 
+ 		return $t_ids;
+ 	}
+-?>
+\ No newline at end of file
++?>
diff --git a/www/mantis/pkg/PLIST b/www/mantis/pkg/PLIST
index cfbdca275b6..9e9c7001058 100644
--- a/www/mantis/pkg/PLIST
+++ b/www/mantis/pkg/PLIST
@@ -1,6 +1,5 @@
-@comment $OpenBSD: PLIST,v 1.5 2008/12/07 16:03:09 mbalmer Exp $
+@comment $OpenBSD: PLIST,v 1.6 2008/12/23 10:51:02 mbalmer Exp $
 @group daemon
-@mode 644
 mantis/
 @comment mantis/.gitignore
 mantis/account_delete.php
@@ -320,6 +319,7 @@ mantis/core/bug_group_action_api.php
 mantis/core/bugnote_api.php
 mantis/core/category_api.php
 mantis/core/checkin.php
+mantis/core/checkincurl.php
 mantis/core/class.RSSBuilder.inc.php
 mantis/core/class.period.php
 mantis/core/class.urlmatch.php