[feladat @ 297]
Bugfix: removed the multirow insert syntax, which is only supported in PostgreSQL 8.2 and higher. Reported and patch by grin.
This closes ticket:79.
--- a/inc/users.inc.php Sat Jul 12 13:44:34 2008 +0000
+++ b/inc/users.inc.php Mon Jul 14 16:19:30 2008 +0000
@@ -610,11 +610,10 @@
$perm_templ_id = $db->lastInsertId('perm_templ', 'id');
foreach ($details['perm_id'] AS $perm_id) {
- $r_insert_values[] = "(" . $db->quote($perm_templ_id) . "," . $db->quote($perm_id) . ")";
+ $query = "INSERT INTO perm_templ_items (templ_id, perm_id) VALUES (" . $db->quote($perm_templ_id) . "," . $db->quote($perm_id) . ")";
+ $result = $db->query($query);
+ if (pear::iserror($response)) { error($response->getmessage()); return false; }
}
- $query = "INSERT INTO perm_templ_items (templ_id, perm_id) VALUES " . implode(',', $r_insert_values) ;
- $result = $db->query($query);
- if (pear::iserror($response)) { error($response->getmessage()); return false; }
return true;
}
@@ -646,11 +645,10 @@
if (pear::iserror($response)) { error($response->getmessage()); return false; }
foreach ($details['perm_id'] AS $perm_id) {
- $r_insert_values[] = "(" . $db->quote($details['templ_id']) . "," . $db->quote($perm_id) . ")";
+ $query = "INSERT INTO perm_templ_items (templ_id, perm_id) VALUES (" . $db->quote($details['templ_id']) . "," . $db->quote($perm_id) . ")";
+ $result = $db->query($query);
+ if (pear::iserror($response)) { error($response->getmessage()); return false; }
}
- $query = "INSERT INTO perm_templ_items (templ_id, perm_id) VALUES " . implode(',', $r_insert_values) ;
- $result = $db->query($query);
- if (pear::iserror($response)) { error($response->getmessage()); return false; }
return true;
}