Revision: 351
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=351&view=rev
Author: GingerDog
Date: 2008-04-26 14:55:16 -0700 (Sat, 26 Apr 2008)
Log Message:
-----------
fetchmail.php: PostgreSQL does not need the next autoincrement value to be asigned fo rit
Modified Paths:
--------------
trunk/fetchmail.php
Modified: trunk/fetchmail.php
===================================================================
--- trunk/fetchmail.php 2008-04-26 21:01:13 UTC (rev 350)
+++ trunk/fetchmail.php 2008-04-26 21:55:16 UTC (rev 351)
@@ -153,6 +153,10 @@
}
}
$formvars['id'] = $edit; # results in 0 on $new
+ if($CONF['database_type'] == 'pgsql' && $new) {
+ // skip - shouldn't need to specify this as it will default to the next available value anyway.
+ unset($formvars['id']);
+ }
if (!in_array($formvars['mailbox'], $fm_defaults['mailbox'])) {
flash_error($PALANG['pFetchmail_invalid_mailbox']);
@@ -173,8 +177,8 @@
}
if ($save) {
- if ($new) {
- $sql="INSERT fetchmail (".implode(",",escape_string(array_keys($formvars))).") VALUES ('".implode("','",escape_string($formvars))."')";
+ if ($new) {
+ $sql="INSERT INTO fetchmail (".implode(",",escape_string(array_keys($formvars))).") VALUES ('".implode("','",escape_string($formvars))."')";
} else { # $edit
foreach(array_keys($formvars) as $key) {
$formvars[$key] = escape_string($key) . "='" . escape_string($formvars[$key]) . "'";
@@ -221,7 +225,7 @@
}
function _inp_bool($val){
- return $val?db_get_boolean(true):db_get_boolean(false);
+ return $val ? db_get_boolean(true): db_get_boolean(false);
}
function _inp_password($val){
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|