function login(){
    let data = {};
    data.mail = $("#mail").val();
    data.password = $("#password").val();

    $.ajax({
        type: "POST",
        url: "/intern/anmelden/einloggen",
        data: data,
        dataType: "json",
        success: function(d){
            switch(d.messageStatus){
                case "success":
                    setzeFehlermeldung("success", i18n.login.login_success);
                    location.reload();
                    break;
                case "failure":
                    setzeFehlermeldung("failure", i18n.common.error_occurred + d.errorMessage);
                    break;
                case "not permitted":
                    setzeFehlermeldung("failure", i18n.common.not_permitted);
                    break;
            }
        },
        error: function(d, status, errorThrown) {
            setzeFehlermeldung("failure", i18n.common.error_occurred + errorThrown);
        }
    });

}
