]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix reset to default for mysql
authorAndrew Dolgov <fox@madoka.spb.ru>
Fri, 18 Nov 2005 09:21:41 +0000 (10:21 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Fri, 18 Nov 2005 09:21:41 +0000 (10:21 +0100)
backend.php

index 4d0753b860bff0fb5b64116bb63dfcd2cc54ac26..1cfab2ab1b8cd410ebd82070b84a8ff6f29d312d 100644 (file)
 
                        if (WEB_DEMO_MODE) return;
 
-                       db_query($link,"UPDATE ttrss_user_prefs 
-                               SET value = ttrss_prefs.def_value 
-                               WHERE owner_uid = '".$_SESSION["uid"]."' AND
-                               ttrss_prefs.pref_name = ttrss_user_prefs.pref_name");
+                       if (DB_TYPE == "pgsql") {
+                               db_query($link,"UPDATE ttrss_user_prefs 
+                                       SET value = ttrss_prefs.def_value 
+                                       WHERE owner_uid = '".$_SESSION["uid"]."' AND
+                                       ttrss_prefs.pref_name = ttrss_user_prefs.pref_name");
+                       } else {
+                               db_query($link, "DELETE FROM ttrss_user_prefs 
+                                       WHERE owner_uid = ".$_SESSION["uid"]);
+                               initialize_user_prefs($link, $_SESSION["uid"]);
+                       }
 
                        header("Location: prefs.php");