]> dev.renevier.net Git - syp.git/blobdiff - logout.php
bump to version 0.4
[syp.git] / logout.php
index 9285e6a7ccb57ee9d7e97df673d4b2f740a63930..037252c4aee89bc43dd386dc4ba9bae79eebaa1b 100644 (file)
@@ -2,10 +2,16 @@
 /* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
    license. */
 
-require_once ("./inc/settings.php");
+if (!@include_once ("./inc/settings.php")) {
+    header ('Location: index.php');
+}
 
-$cookie_name = sprintf ("%sauth", DBPREFIX);
-setcookie ($cookie_name, "", time () - 3600, "" , "",false, true);
+if (version_compare (PHP_VERSION, '5.2.0', '>=')) {
+    setcookie (sprintf ("%sauth", DBPREFIX), "", time () - 3600, "" , "",false, true);
+    setcookie (sprintf ("%suser", DBPREFIX), "", time () - 3600, "" , "",false, true);
+} else {
+    setcookie (sprintf ("%sauth", DBPREFIX), "", time () - 3600, "" , "",false);
+    setcookie (sprintf ("%suser", DBPREFIX), "", time () - 3600, "" , "",false);
+}
 header ('Location: index.php');
-
 ?>