empty SessionID sends the user to login page

If the session is empty, it now sends you to the login page with a safed url so it can revert you back to the right page after login
This commit is contained in:
Lars van Hijfte
2017-02-02 17:43:32 +01:00
parent b1941f0191
commit f8c9454b85
11 changed files with 44 additions and 30 deletions

View File

@@ -3,8 +3,7 @@ var months = ["januari", "februari", "maart", "april", "mei", "juni", "juli", "a
function fancyText(text) {
// Add links, images, gifs and (youtube) video's.
var regex = /(https?:\/\/.[^ <>"]*)/ig;
text = text.replace(regex, function(link) {
text = text.replace(/(https?:\/\/.[^ \n<>"]*)/ig, function(link) {
// Add images
if (link.match(/(https?:\/\/.[^ ]*\.(?:png|jpg|jpeg|gif))/ig)) {
return "<img alt='" + link + "' src='" + link + "' />";
@@ -39,7 +38,7 @@ function fancyText(text) {
}
// This function gets the value of a cookie when given a key.
// If didn´t find any compatible cookie, it returns false.
// If it didn´t find any compatible cookie, it returns false.
function getCookie(key) {
cookies = document.cookie.split("; ");
for (var i in cookies) {