# HG changeset patch # User peter # Date 1206813713 0 # Node ID 34b2d49f52c6e1ff73655e2d953ed1cad94b4817 # Parent b1015b3055affd3122aed51960ccd3df2aaa8d6f [feladat @ 209] Modified some of the INSERT queries to make them compatible with pgSQL diff -r b1015b3055af -r 34b2d49f52c6 inc/users.inc.php --- a/inc/users.inc.php Sat Mar 29 07:34:57 2008 +0000 +++ b/inc/users.inc.php Sat Mar 29 18:01:53 2008 +0000 @@ -596,9 +596,8 @@ // Fix permission template name and description first. - $query = "INSERT INTO perm_templ - VALUES ( - '', " + $query = "INSERT INTO perm_templ (name, descr) + VALUES (" . $db->quote($details['templ_name']) . ", " . $db->quote($details['templ_descr']) . ")"; @@ -608,9 +607,9 @@ $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) . ")"; + $r_insert_values[] = "(" . $db->quote($perm_templ_id) . "," . $db->quote($perm_id) . ")"; } - $query = "INSERT INTO perm_templ_items VALUES " . implode(',', $r_insert_values) ; + $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; } @@ -644,9 +643,9 @@ 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) . ")"; + $r_insert_values[] = "(" . $db->quote($details['templ_id']) . "," . $db->quote($perm_id) . ")"; } - $query = "INSERT INTO perm_templ_items VALUES " . implode(',', $r_insert_values) ; + $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; } @@ -751,8 +750,7 @@ $active = 0; } - $query = "INSERT INTO users VALUES ( " - . "'', " + $query = "INSERT INTO users (username, password, fullname, email, description, perm_templ, active) VALUES (" . $db->quote($details['username']) . ", " . $db->quote(md5($details['password'])) . ", " . $db->quote($details['fullname']) . ", "