public_html/js/login.js
/**
     * login() is used for sending the user to the admin part of this front page webapp
     * @param username
     * @param JSONResult
     * @param output
     * @returns {boolean}
     */
login() is used for sending the user to the admin part of this front page webapp
@param username
@param JSONResult
@param output
@returns {boolean}
login () is used for sending the user to the admin part of this front page webapp @param username @param JSONResult @param output @returns { boolean }
function login(username, JSONResult, output) {
        const token = JSONResult.token;
        const status = JSONResult.status;
        if(!status) {
            output("Forkert brugernavn eller kodeord", false);
            return false;
        }
        if(token === "" && token === null && token === undefined) {
            output("Forkert brugernavn eller kodeord", false);
            return false;
        }
        document.cookie = "token=" + token;
        document.cookie = "login_status=true";
        document.cookie = "username=" + username;
        setTimeout(function () {
            window.location = webURL() + "/news";
        }, 2000);
        output("Du er ved at blive logged ind", true);
        return true;
    }
function login ( username , JSONResult , output ) { const token = JSONResult . token ; const status = JSONResult . status ; if ( ! status ) { output ( "Forkert brugernavn eller kodeord" , false ) ; return false ; } if ( token === "" && token === null && token === undefined ) { output ( "Forkert brugernavn eller kodeord" , false ) ; return false ; } document . cookie = "token=" + token ; document . cookie = "login_status=true" ; document . cookie = "username=" + username ; setTimeout ( function ( ) { window . location = webURL ( ) + "/news" ; } , 2000 ) ; output ( "Du er ved at blive logged ind" , true ) ; return true ; }
login() is used for sending the user to the admin part of this front page webapp
 @param username
 @param JSONResult
 @param output
 @returns {boolean}
login () is used for sending the user to the admin part of this front page webapp @param username @param JSONResult @param output @returns { boolean }
//window.location = webURL + "/";