changeset 609:b75ec194de52

Use transactions when updating settings table.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 31 Oct 2014 23:13:59 +0200
parents 7d676c77e3f8
children 167ca3827c31
files admajax.php
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/admajax.php	Fri Oct 31 23:13:44 2014 +0200
+++ b/admajax.php	Fri Oct 31 23:13:59 2014 +0200
@@ -1435,12 +1435,14 @@
     //
     if ($type == "settings")
     {
+      stDBBeginTransaction();
       foreach (stExecSQL("SELECT * FROM settings") as $item)
       if (($val = stGetRequestItem($item["key"], FALSE)) !== FALSE)
       {
         $sql = "UPDATE settings SET ".stGetSettingSQL($item, $val)." WHERE key=".$db->quote($item["key"]);
         stExecSQLCond($sql, "OK, setting updated.");
       }
+      stDBCommitTransaction();
     }
     else
     if (stChkRequestItem("id", $id, array(CHK_TYPE, VT_INT, "Invalid data.")))