Automatically redirect to logout page if session seems to be expired
authorJoey Schulze <joey@infodrom.org>
Sat, 21 Dec 2013 20:22:15 +0000 (21:22 +0100)
committerJoey Schulze <joey@infodrom.org>
Sat, 21 Dec 2013 20:22:15 +0000 (21:22 +0100)
lib/functions.js

index bcdbd88..062171a 100644 (file)
@@ -12,6 +12,8 @@ function ajax_request_callback(req)
            else
                error(data.error);
            alert(data.error);
+           if (typeof data.logout != 'undefined' && data.logout == true)
+               window.location.href = 'index.php?logout=true';
        } else if (req.oncomplete)
            req.oncomplete(data);
     }