diff msite.inc.php @ 66:230aacc22cb4

Move some functions to site lib.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 05 Oct 2013 17:59:24 +0300
parents 72b22729ae7e
children 30a4420e85ab
line wrap: on
line diff
--- a/msite.inc.php	Sat Oct 05 12:51:31 2013 +0300
+++ b/msite.inc.php	Sat Oct 05 17:59:24 2013 +0300
@@ -504,4 +504,33 @@
     }
   }
 }
+
+
+function stSetStatus($val, $msg)
+{
+  global $statusSet;
+  if (!$statusSet)
+  {
+    header("Status: ".$val." ".$msg);
+  }
+  $statusSet = TRUE;
+}
+
+
+function stExecSQLCond($sql, $okmsg)
+{
+  if (($res = stExecSQL($sql)) !== FALSE)
+  {
+    if ($okmsg != "")
+      stSetStatus(200, $okmsg);
+    return $res;
+  }
+  else
+  {
+    stSetStatus(900, "Error in SQL execution.");
+    return FALSE;
+  }
+}
+
+
 ?>
\ No newline at end of file