]> dev.renevier.net Git - syp.git/blobdiff - logout.php
bump to version 0.4
[syp.git] / logout.php
index c2cd62c38e1972e1413469480c3be7a7634e6f09..037252c4aee89bc43dd386dc4ba9bae79eebaa1b 100644 (file)
@@ -1,9 +1,17 @@
 <?php
+/* 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');
-
 ?>