]> dev.renevier.net Git - syp.git/blobdiff - logout.php
bump to version 0.4
[syp.git] / logout.php
index 02b4b0795ffa54fbb27795342e184cd5d605c650..037252c4aee89bc43dd386dc4ba9bae79eebaa1b 100644 (file)
@@ -2,10 +2,16 @@
 /* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
    license. */
 
 /* 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');
+}
 
 
-setcookie (sprintf ("%sauth", DBPREFIX), "", time () - 3600, "" , "",false, true);
-setcookie (sprintf ("%suser", DBPREFIX), "", 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');
 header ('Location: index.php');
-
 ?>
 ?>