Mercurial > hg > fapweb
comparison msitegen.inc.php @ 1104:0a2117349f46
s/true/TRUE/g; s/false/FALSE/g;
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 14 May 2019 14:45:36 +0300 |
parents | 1fe7df7c77fb |
children | 0b0094db56da c7093ad17858 |
comparison
equal
deleted
inserted
replaced
1103:1fe7df7c77fb | 1104:0a2117349f46 |
---|---|
110 function stGetSQLSettingData($item) | 110 function stGetSQLSettingData($item) |
111 { | 111 { |
112 switch ($item["vtype"]) | 112 switch ($item["vtype"]) |
113 { | 113 { |
114 case VT_INT: return intval($item["vint"]); | 114 case VT_INT: return intval($item["vint"]); |
115 case VT_BOOL: return intval($item["vint"]) ? true : false; | 115 case VT_BOOL: return intval($item["vint"]) ? TRUE : FALSE; |
116 case VT_STR: return $item["vstr"]; | 116 case VT_STR: return $item["vstr"]; |
117 case VT_TEXT: return $item["vtext"]; | 117 case VT_TEXT: return $item["vtext"]; |
118 } | 118 } |
119 } | 119 } |
120 | 120 |
573 catch (PDOException $e) { | 573 catch (PDOException $e) { |
574 stLogError("Could not connect to SQL database: ".$e->getMessage()."."); | 574 stLogError("Could not connect to SQL database: ".$e->getMessage()."."); |
575 return FALSE; | 575 return FALSE; |
576 } | 576 } |
577 $db = stConnectSQLDBSpec(stGetSetting("sqlDB")); | 577 $db = stConnectSQLDBSpec(stGetSetting("sqlDB")); |
578 return ($db !== false); | 578 return ($db !== FALSE); |
579 } | 579 } |
580 | 580 |
581 | 581 |
582 function stDBPrepareSQLUpdate($dbh, $table, $cond, $pairs) | 582 function stDBPrepareSQLUpdate($dbh, $table, $cond, $pairs) |
583 { | 583 { |
656 function stDBExecSQLInsert($dbh, $sql) | 656 function stDBExecSQLInsert($dbh, $sql) |
657 { | 657 { |
658 switch ($dbh->getAttribute(PDO::ATTR_DRIVER_NAME)) | 658 switch ($dbh->getAttribute(PDO::ATTR_DRIVER_NAME)) |
659 { | 659 { |
660 case "pgsql": | 660 case "pgsql": |
661 if (($res = stDBFetchSQLColumn($dbh, $sql." RETURNING id")) !== false) | 661 if (($res = stDBFetchSQLColumn($dbh, $sql." RETURNING id")) !== FALSE) |
662 return $res; | 662 return $res; |
663 else | 663 else |
664 return FALSE; | 664 return FALSE; |
665 | 665 |
666 default: | 666 default: |
667 if (stDBExecSQL($dbh, $sql) !== false) | 667 if (stDBExecSQL($dbh, $sql) !== FALSE) |
668 return $dbh->lastInsertId(); | 668 return $dbh->lastInsertId(); |
669 else | 669 else |
670 return FALSE; | 670 return FALSE; |
671 } | 671 } |
672 } | 672 } |
967 echo " params += \"&csrfID=".$csrfID."\";\n"; | 967 echo " params += \"&csrfID=".$csrfID."\";\n"; |
968 else | 968 else |
969 echo "// No CSRF?\n"; | 969 echo "// No CSRF?\n"; |
970 ?> | 970 ?> |
971 var req = jsCreateXMLRequest(); | 971 var req = jsCreateXMLRequest(); |
972 req.open("POST", "<?php echo $backend ?>", true); | 972 req.open("POST", "<?php echo $backend ?>", TRUE); |
973 req.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); | 973 req.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); |
974 req.setRequestHeader("Content-length", params.length); | 974 req.setRequestHeader("Content-length", params.length); |
975 req.setRequestHeader("Connection", "close"); | 975 req.setRequestHeader("Connection", "close"); |
976 | 976 |
977 req.onreadystatechange = function() | 977 req.onreadystatechange = function() |