Logout Button wurde gefixed

This commit is contained in:
ja
2021-09-16 14:45:29 +02:00
parent 773c15e9e6
commit 64c3227b33
6 changed files with 86 additions and 43 deletions

View File

@@ -29,9 +29,7 @@
<%@ import Namespace="MySql.Data.MySqlClient" %>
<script runat="server">
Sub Page_Load() Handles Me.Load
'Login-Validierung
If Not Me.Page.User.Identity.IsAuthenticated Then
FormsAuthentication.RedirectToLoginPage()
@@ -66,7 +64,6 @@
' Response.Redirect("~{login/login.aspx")'
'End If '
End Sub
' Public ReadOnly Property CurrentCity() As String
' Get
' Return "asd"
@@ -156,18 +153,15 @@
navParent = "admin.aspx"
imgPath = "../"
End If
Dim curentMenuId As String = "1"
If Not Request.QueryString("menuID") Is Nothing Then
curentMenuId = Request.QueryString("menuID")
End If
If Not Request.QueryString("lan") Is Nothing Then
laenderkuerzel = Request.QueryString("lan")
End If
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
Dim LT As New VERAG_PROG_ALLGEMEIN.cLanguageText_LIST("HOMEPAGE", "LOGIN", "STATUS", "")
Dim V_LST As New VERAG_PROG_ALLGEMEIN.cVermerkeCodes_LIST
Dim lan = "DE"
@@ -190,6 +184,7 @@
ElseIf laenderkuerzel = "TR" And lan3 = "0" Then
flagpath = "images/flags/flagge_TR.gif"
End If
%>
<li class="wrapper">
<!-- Sidebar -->
@@ -275,7 +270,7 @@
<ul style="list-style: none;"class="collapse list-unstyled" id="UserSubmenu1">
<span class="navbar-toggler-icon"></span>
<li><button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal" style="text-decoration: none;background-color:#fff;color:#043381;text-align:left;border:none;font-size:16px;white-space: nowrap; height:20px"><img src="../images/Icons/main/gear_blue.png"; style="width:15px; height:15px;color:#043381;background-color:#fff;margin-right:6px;" />Profil bearbeiten</button> </li>
<li><button type="button" class="btn btn-primary" id="LogoutButton1" href="../login/Logout.aspx" style="text-decoration: none;background-color:#fff;color:#043381;text-align:left;border:none;font-size:16px;width:200px;z-index:1032;margin-left:-16px"><img src="../images/Icons/main/Logout.svg.png"; style="font-size:14px;width:20px; height:20px;color:#043381;background-color:#fff; margin-right:6px;"/>Logout</button></li>
<li><a type="button" class="btn btn-primary" href="../login/Logout.aspx" style="text-decoration: none;background-color:#fff;color:#043381;text-align:left;border:none;font-size:16px;width:200px;z-index:1032;margin-left:-16px"><img src="../images/Icons/main/Logout.svg.png"; style="font-size:14px;width:20px; height:20px;color:#043381;background-color:#fff; margin-right:6px;"/>Logout</a></li>
</ul>
</li>
</ul>
@@ -461,7 +456,7 @@
</button>
<ul class="dropdown-content" id="dropdownmenuecont" style="width:210px;right:-198px;top:45px;z-index:1032;margin-right:-2px;">
<li><button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal" style="text-decoration: none;background-color:#fff;color:#043381;z-index:1032;text-align:left;margin-left:-16px;border:none;font-size:16px;white-space: nowrap; width:200px"><img src="../images/Icons/main/gear_blue.png"; style="font-size:14px;width:15px; height:15px;color:#043381;background-color:#fff;margin-right:6px;" />Profil bearbeiten</button></li>
<li><button type="button" class="btn btn-primary" id="LogoutButton1" style="text-decoration: none;background-color:#fff;color:#043381;text-align:left;border:none;font-size:16px;width:200px;z-index:1032;margin-left:-16px;width:200px"><img src="../images/Icons/main/Logout.svg.png"; style="font-size:14px;width:20px; height:20px;color:#043381;background-color:#fff; margin-right:6px;"/>Logout</button></li>
<li><a type="button" class="btn btn-primary" href="../login/Logout.aspx" style="text-decoration: none;background-color:#fff;color:#043381;text-align:left;border:none;font-size:16px;width:200px;z-index:1032;margin-left:-16px;width:200px"><img src="../images/Icons/main/Logout.svg.png"; style="font-size:14px;width:20px; height:20px;color:#043381;background-color:#fff; margin-right:6px;"/>Logout</a></li>
<!-- <div class="dropdown-divider"></div>-->
</ul></div>

View File

@@ -41,6 +41,7 @@
<h3>Hier finden Sie Informationen zu den aktuellen Aufträgen.</h3>
</div>
<%Try
VERAG_PROG_ALLGEMEIN.cAllgemein.ERR_OP_GLOBAL = VERAG_PROG_ALLGEMEIN.ERROR_OP.SHOW
'Dim AD As New VERAG_PROG_ALLGEMEIN.cAdressen(799124)
Dim VERAGSQL = New VERAG_PROG_ALLGEMEIN.SQL
@@ -132,7 +133,6 @@
</div>
</div>
</div>
</div>
</div>
<div style="height:/*24px*/1.873536299765808vh"></div>
@@ -165,7 +165,6 @@
</div>
</div></div></div>
</div>
<br /><br /><br />
<% End If
End If
@@ -173,9 +172,6 @@
Catch ex As Exception
Response.Write(ex.Message & ex.StackTrace)
End Try %>
<div></div></div>
<%-- <div class="footer_menu">
<div class="footer_menu_content">
@@ -200,7 +196,6 @@
<script type='text/javascript'>
$(document).ready(function () {
$("#container2").hide();
$('#<%=RadioButtonList1.ClientID %> input[type="radio"]').change(function () {
if ($(this).val() == "Freigabe") {
$("#container2").show();

View File

@@ -5,13 +5,40 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" title="VERAG Logout"/>
<link rel="stylesheet" type="text/css" href="/css/navbarsidebar.css"/>
<link rel="stylesheet" type="text/css" href="css/main.css"/>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
<link rel="shortcut icon" href="images/Icons/favicon/favicon.ico" />
<!-- <link rel="stylesheet" type="text/css" href="css/edit_main.css"> -->
<script src="js/netzwerk.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css"/>
<link rel="stylesheet" type="text/css" href="../stylesheets/example.css"/>
</head>
<body>
<form id="form1" runat="server">
<div>
<%If Me.Page.User.Identity.IsAuthenticated = False Then %>
<h1>Du wurdest erfolgreich ausgeloggt.</h1>
<button type="button" id="btn_backtostart" class="btn btn-primary">Zurück zur Startseite!</button>
<%Else %>
<h1>Du bist noch eingeloggt <%=Me.User.Identity.Name %>.</h1>
<%End If %>
</div>
</form>
<script type="text/javascript" src="../js/toptions/top_up-min.js"></script>
<script type="text/javascript" src="../js/scrollscript.js"></script>
<!-- JQUERY Script fuer Modal-->
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!-- jQuery CDN - Slim version (=without AJAX) -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<!-- Popper.JS -->
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.min.js" integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous"></script>
</body>
</html>

View File

@@ -1,14 +1,33 @@

Imports System.Web.Configuration
Partial Class login_Logout
Inherits System.Web.UI.Page
Protected Sub Page_Load(sender As Object, e As EventArgs)
Dim sessionname
Sub Page_Load() Handles Me.Load
FormsAuthentication.SignOut()
Dim sessionname = Session.Item("lastpage").ToString
Session.Clear() 'clear session
Session.Abandon() 'Abandon session
Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1))
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetNoStore()
Response.Redirect(sessionname)
Session.Abandon()
'clear authentication cookie
Dim cookie1 As HttpCookie = New HttpCookie(FormsAuthentication.FormsCookieName, "")
cookie1.Expires = DateTime.Now.AddYears(-1)
Response.Cookies.Add(cookie1)
'clear session cookie (Not necessary for your current problem but i would recommend you do it anyway)
Dim sessionStateSection As New SessionStateSection
sessionStateSection = WebConfigurationManager.GetSection("system.web/sessionState")
Dim cookie2 As HttpCookie = New HttpCookie(sessionStateSection.CookieName, "")
cookie2.Expires = DateTime.Now.AddYears(-1)
Response.Cookies.Add(cookie2)
Response.Redirect("../newpageJulius_Sidebar.aspx")
End Sub
Protected Sub btn_backtostart_Click(sender As Object, e As EventArgs)
Response.Redirect("../newpageJulius_Sidebar.aspx")
End Sub
End Class

View File

@@ -370,7 +370,6 @@
navParent = "admin.aspx"
imgPath = "../"
End If
Dim curentMenuId As String = "1"
If Not Request.QueryString("menuID") Is Nothing Then
curentMenuId = Request.QueryString("menuID")
@@ -431,8 +430,7 @@
If cells >= 3 Then
%></tr><tr>
<% cells = 0
End If
%>
End If %>
<div class="dropdown-divider"></div>
<!--<td><a href="<%'= navParent%>?menuID=<%'= nav3.id%>&lan=<%'= laenderkuerzel %>"><%'= nav3.bezeichnung %></a></td> -->
<a class="dropdown-item" href="<%= navParent%>?menuID=<%= nav3.id%>&lan=<%= laenderkuerzel %>"><%= nav3.bezeichnung %></a>

View File

@@ -1,15 +1,24 @@

Imports System.Web.Configuration
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub LogoutButton_Click(sender As Object, e As EventArgs)
FormsAuthentication.SignOut()
Session.Abandon()
Session.Clear() 'clear session
Session.Abandon() 'Abandon session
Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1))
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetNoStore()
Session.Add("lastpage", "../newpageJulius_Sidebar.aspx")
'clear authentication cookie
Dim cookie1 As HttpCookie = New HttpCookie(FormsAuthentication.FormsCookieName, "")
cookie1.Expires = DateTime.Now.AddYears(-1)
Response.Cookies.Add(cookie1)
'clear session cookie (Not necessary for your current problem but i would recommend you do it anyway)
Dim sessionStateSection As New SessionStateSection
sessionStateSection = WebConfigurationManager.GetSection("system.web/sessionState")
Dim cookie2 As HttpCookie = New HttpCookie(sessionStateSection.CookieName, "")
cookie2.Expires = DateTime.Now.AddYears(-1)
Response.Cookies.Add(cookie2)
Response.Redirect("login/Logout.aspx")
End Sub
End Class