Login sowie Logout funktioniert
This commit is contained in:
@@ -1,35 +1,32 @@
|
|||||||
<%@ Page Language="VB" Debug="true" AutoEventWireup="false" CodeFile="Loggedin.aspx.vb" Inherits="login_login_TEST" %>
|
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Loggedin.aspx.vb" Inherits="login_Logged_IN" %>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head runat="server">
|
||||||
<%@ import Namespace="MySql.Data.MySqlClient" %>
|
<!-- Bootstrap -->
|
||||||
|
<html lang="en"></html>
|
||||||
|
<!-- Required meta tags -->
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
|
||||||
<title>VERAG Spedition AG Login</title>
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" title="VERAG LoggedIn"/>
|
||||||
<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="SHORTCUT ICON" HREF="../images/Icons/favicon/favicon.ico" />
|
|
||||||
<!-- <link rel="stylesheet" type="text/css" href="css/edit_main.css"> -->
|
<!-- <link rel="stylesheet" type="text/css" href="css/edit_main.css"> -->
|
||||||
<script src="js/netzwerk.js" type="text/javascript"></script>
|
<script src="js/netzwerk.js" type="text/javascript"></script>
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="../../stylesheets/style.css"/>
|
<!-- Bootstrap CSS -->
|
||||||
<link rel="stylesheet" type="text/css" href="../../stylesheets/example.css"/>
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"/>
|
||||||
<style>
|
<link rel="stylesheet" type="text/css" href="../css/main.css"/>
|
||||||
body {
|
<link rel="stylesheet" type="text/css" href="../css/style.css"/>
|
||||||
background-color: #fff;
|
<link rel="stylesheet" href="https://unpkg.com/bootstrap-table@1.18.3/dist/bootstrap-table.min.css"/>
|
||||||
background-image: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#Login1_LoginButton {
|
<!-- <link rel="stylesheet" type="text/css" href="css/edit_main.css"> -->
|
||||||
color: #fff;
|
<script src="js/netzwerk.js" type="text/javascript"></script>
|
||||||
background-color: #003680;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: 768px) {
|
<link rel="stylesheet" type="text/css" href="../css/style.css"/>
|
||||||
}
|
<link rel="stylesheet" type="text/css" href="../css/example.css"/>
|
||||||
</style>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
// Vergebe den Event-Handler
|
// Vergebe den Event-Handler
|
||||||
@@ -45,100 +42,32 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<!-- <script type="text/javascript" src="../js/toptions/top_up-min.js"></script> -->
|
<style>
|
||||||
<!--[if IE]>
|
body{
|
||||||
<link rel="stylesheet" type="text/css" href="../css/main.css">
|
background-image:none;
|
||||||
<![endif]-->
|
}
|
||||||
|
</style>
|
||||||
<!--[if IE 6]>
|
|
||||||
<link rel="stylesheet" type="text/css" href="../css/main.css">
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
<!--[if lt IE 7]>
|
|
||||||
<link rel="stylesheet" type="text/css" href="../css/main.css">
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
<!--[if lte IE 5.5999]>
|
|
||||||
<link rel="stylesheet" type="text/css" href="../css/main.css">
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
<!--[if gte IE 5.5]>
|
|
||||||
<link rel="stylesheet" type="text/css" href="../css/main.css">
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="../css/login/LoggedIn.css"/>
|
|
||||||
</head>
|
</head>
|
||||||
|
<body>
|
||||||
<body onload="FocusOnInput()">
|
<div class="d-flex flex-row bd-highlight mb-3">
|
||||||
<!-- #include file="../navigation.aspx" -->
|
<div class="p-2 bd-highlight" style="width:252px;height:216px;align-content:flex-start;">
|
||||||
<div class="container-fluid" style="width:252px;height:216px;">
|
|
||||||
<form id="form1" runat="server">
|
<form id="form1" runat="server">
|
||||||
<asp:Login ID = "Login1" runat = "server" OnAuthenticate= "ValidateUser">
|
|
||||||
<LayoutTemplate>
|
|
||||||
<table cellpadding="0" style="font-family:Arial;font-size:11px;border:1px solid gray">
|
|
||||||
|
|
||||||
<div>
|
<div style="height:32px;background-image: linear-gradient(to right, #003680 , #0055cc);color:#fff;">
|
||||||
<tr style=" background-image: linear-gradient(to right, #003680 , #0055cc);color:#fff;height:30px;font-size:12px">
|
<center><asp:Label ID="lbl_Loggedin" runat="server" Text="Logged In!" Style="font-weight:900"></asp:Label></center>
|
||||||
<td align="center" colspan="2" style="color:#fff;font-kerning:auto;font-weight:700;">Erfolgreich eingeloggt!</td>
|
</div>
|
||||||
</tr>
|
<h2> Willkommen zurück!</h2> <asp:LoginName ID="LoginName1" runat="server" />
|
||||||
|
<div class="row" id="BTN_World">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" style="display: none; font-size:/*25px;*/ 1.990327332242226vh">
|
<div class="col-3">
|
||||||
<symbol id="check-circle-fill" fill="currentColor" viewBox="0 0 16 16">
|
<asp:LinkButton ID="LogoutButton" target="_top" href="../login/Logout.aspx" runat="server" CssClass="btn btn-primary" Text="Logout" />
|
||||||
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"/>
|
</div>
|
||||||
</symbol>
|
<div style="height:/*15px*/1.17096018735363vh;"></div>
|
||||||
</svg>
|
<div class="col-3">
|
||||||
<asp:LoginStatus ID="LoginStatus1" runat="server" LogoutAction="Redirect" ValidateRequestMode="Enabled"/>
|
</div>
|
||||||
<tr>
|
</div>
|
||||||
<td align="right">
|
|
||||||
<td>
|
|
||||||
<div class="alert alert-success align-items-center" role="alert" style="width:98%;">
|
|
||||||
<svg class="bi shrink-0 me-2" width="3.125vw" height="1.875vh" role="img" aria-label="Success:"><use xlink:href="#check-circle-fill"/></svg>
|
|
||||||
</td>
|
|
||||||
<tr> <td>
|
|
||||||
<asp:Label ID="LBL2" runat="server">Willkommen zurück: <%=Login1.UserName %> </asp:Label>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<div style="height:10px;"></div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td align="left" colspan="2">
|
|
||||||
<br/> <asp:Button id="LogoutButton" runat="server"/>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</LayoutTemplate>
|
|
||||||
</asp:Login>
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<script type = "text/javascript">
|
|
||||||
function goBack() {
|
|
||||||
window.history.back()
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<script>
|
|
||||||
function bust1() {
|
|
||||||
if (top != self)
|
|
||||||
setInterval("top.location.replace('../Kundenseite.aspx')", 1);
|
|
||||||
}
|
|
||||||
function bust2() {
|
|
||||||
if (top != self)
|
|
||||||
setInterval("top.location.replace('../admin/admin.aspx')", 1);
|
|
||||||
}
|
|
||||||
function bust3() {
|
|
||||||
if (top != self)
|
|
||||||
setInterval("top.location.replace('../newpageJulius_Sidebar.aspx')", 1);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|||||||
@@ -1,60 +1,26 @@
|
|||||||
Imports System.Data.SqlClient
|
|
||||||
Imports System.Data
|
Partial Class login_Logged_IN
|
||||||
|
|
||||||
Partial Class login_login_TEST
|
|
||||||
Inherits System.Web.UI.Page
|
Inherits System.Web.UI.Page
|
||||||
|
Protected Sub Page_Load(sender As Object, e As EventArgs)
|
||||||
Protected Sub ValidateUser(sender As Object, e As EventArgs)
|
lbl_Loggedin.ForeColor = Drawing.Color.White
|
||||||
Dim userId As Integer = 0
|
lbl_Loggedin.Style.Add("font-weight", "800")
|
||||||
' cDBFunctions.GetNewOpenConnection()
|
|
||||||
Dim ConnectionString = ""
|
|
||||||
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
|
||||||
'ConnectionString = "Server=DEVELOPER\DEVSQL;Database=VERAG_HOMEPAGE;Uid=sa;Pwd=BmWr501956"
|
|
||||||
ConnectionString = "Server=DEVELOPER\DEVSQL;Database=VERAG_HOMEPAGE;Uid=AppUser;Pwd=yp/THDd?xM+pZ$;"
|
|
||||||
Else
|
|
||||||
ConnectionString = "Server=DEVELOPER.verag.ost.dmn\DEVSQL;Database=VERAG_HOMEPAGE;Uid=AppUser;Pwd=yp/THDd?xM+pZ$;"
|
|
||||||
'ConnectionString = "Server=db593295684.db.1and1.com;Database=db593295684;Uid=dbo593295684;Pwd=atilla#2;"
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
' Dim constr As String = ConfigurationManager.ConnectionStrings("constr").ConnectionString
|
|
||||||
Using con As New SqlConnection(ConnectionString)
|
|
||||||
' Using cmd As New SqlCommand("Validate_User")
|
|
||||||
Using cmd As New SqlCommand("SELECT COUNT(*) FROM [VERAG_HOMEPAGE].[dbo].[Users] WHERE Username=@Username AND Password=@Password")
|
|
||||||
' cmd.CommandType = CommandType.StoredProcedure
|
|
||||||
cmd.Parameters.AddWithValue("@Username", Login1.UserName)
|
|
||||||
cmd.Parameters.AddWithValue("@Password", Login1.Password)
|
|
||||||
cmd.Connection = con
|
|
||||||
con.Open()
|
|
||||||
' userId = Convert.ToInt32(cmd.ExecuteScalar())
|
|
||||||
Dim dr As SqlDataReader = cmd.ExecuteReader()
|
|
||||||
If dr.HasRows Then
|
|
||||||
dr.Read()
|
|
||||||
'MsgBox(dr.Item(0).ToString())
|
|
||||||
Select Case dr.Item(0)
|
|
||||||
Case 0
|
|
||||||
Login1.FailureText = "Username and/or password is incorrect."
|
|
||||||
Exit Select
|
|
||||||
Case -2
|
|
||||||
Login1.FailureText = "Account has not been activated."
|
|
||||||
Exit Select
|
|
||||||
Case Else
|
|
||||||
FormsAuthentication.RedirectFromLoginPage(Login1.UserName, Login1.RememberMeSet)
|
|
||||||
'FormsAuthentication.SetAuthCookie(Login1.UserName, True)
|
|
||||||
'Response.Redirect("mypage.aspx")
|
|
||||||
Exit Select
|
|
||||||
End Select
|
|
||||||
End If
|
|
||||||
dr.Close()
|
|
||||||
con.Close()
|
|
||||||
End Using
|
|
||||||
End Using
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Protected Sub LogoutButton_Click(sender As Object, e As EventArgs)
|
Protected Sub LogoutButton_Click(sender As Object, e As EventArgs)
|
||||||
FormsAuthentication.SignOut()
|
FormsAuthentication.SignOut()
|
||||||
Response.Redirect("../login/Logout.aspx")
|
Session.Clear()
|
||||||
|
|
||||||
|
'clear authentication cookie
|
||||||
|
'Dim cookie1 As HttpCookie = New HttpCookie(FormsAuthentication.FormsCookieName, "")
|
||||||
|
'cookie1.Expires = DateTime.Now.AddYears(-1)
|
||||||
|
'Response.Cookies.Add(cookie1)
|
||||||
|
|
||||||
|
'clear session cookie
|
||||||
|
'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 Sub
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -68,6 +68,7 @@
|
|||||||
body {
|
body {
|
||||||
background-color:#fff;
|
background-color:#fff;
|
||||||
background-image:none;
|
background-image:none;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#Login1_LoginButton {
|
#Login1_LoginButton {
|
||||||
@@ -81,11 +82,11 @@
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body onload="FocusOnInput()">
|
<body onload="FocusOnInput()" style="overflow-x:hidden;border:0px;margin:0px" >
|
||||||
<!-- #include file="../navigation.aspx" -->
|
<!-- #include file="../navigation.aspx" -->
|
||||||
<div class="container-fluid" style="width:252px;height:216px;">
|
<div class="container-fluid" style="width:252px;height:216px;">
|
||||||
<form id="form1" runat="server">
|
<form id="form1" runat="server">
|
||||||
<asp:Login ID = "Login1" runat = "server" OnAuthenticate= "ValidateUser">
|
<asp:Login ID = "Login1" runat = "server" OnAuthenticate= "ValidateUser" ClientIDMode="AutoID">
|
||||||
<LayoutTemplate>
|
<LayoutTemplate>
|
||||||
<table cellpadding="0" style="font-family:Arial;font-size:11px;border:1px solid gray">
|
<table cellpadding="0" style="font-family:Arial;font-size:11px;border:1px solid gray">
|
||||||
<tr style=" background-image: linear-gradient(to right, #003680 , #0055cc);color:#fff;height:30px;font-size:12px">
|
<tr style=" background-image: linear-gradient(to right, #003680 , #0055cc);color:#fff;height:30px;font-size:12px">
|
||||||
@@ -130,10 +131,10 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left" colspan="2">
|
<td align="left" colspan="2">
|
||||||
<br/> <asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Anmelden" ValidationGroup="Login1" target="_top" OnClientClick="bust1()"/>
|
<br/> <asp:LinkButton ID="LoginButton" runat="server" CommandName="Login" Text="Anmelden" ValidationGroup="Login1" PostBackUrl="~/newpageJulius_Sidebar.aspx"/>
|
||||||
</td>
|
</td>
|
||||||
<td align="middle" colspan="2">
|
<td align="middle" colspan="2">
|
||||||
<asp:LinkButton ID="LinkButton1" href="../login/login_TEST.aspx" runat="server" target="_top" OnClientClick="bust1()">Admin-Login</asp:LinkButton>
|
<asp:LinkButton ID="LinkButton1" runat="server" target="_top" OnClientClick="bust2">Admin-Login</asp:LinkButton>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -142,38 +143,14 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script type="text/javascript">
|
||||||
function bust1() {
|
|
||||||
if (window.top.location != window.location) {
|
|
||||||
var zipphone1_1 = getElementById("#CustomerID").val();
|
|
||||||
var zipphone1_2 = getElementById("#UserName").val();
|
|
||||||
var zipphone1_3 = getElementById("#Password").val();
|
|
||||||
alert("send:"+zipphone1_1)
|
|
||||||
alert("send:"+zipphone1_2)
|
|
||||||
alert("send:"+zipphone1_3)
|
|
||||||
postMessage(zipphone1_1,'*')
|
|
||||||
po
|
|
||||||
/*window.top.postMessage(getElementById("#CustomerID").val(),'*')
|
|
||||||
window.top.postMessage(getElementById("#UserName").val(), '*')
|
|
||||||
window.top.postMessage(getElementById("#Password").val(), '*')*/
|
|
||||||
//parent.location.replace('../Customers/Welcome.aspx');
|
|
||||||
top.location.replace('../Customers/Welcome.aspx');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function bust2() {
|
function bust2() {
|
||||||
if (top.location != self) {
|
alert("Funktion2");
|
||||||
var zipphone2_1 = getElementById("#CustomerID").val();
|
if (top != self) {
|
||||||
var zipphone2_2 = getElementById("#UserName").val();
|
top.onbeforeunload = function () { };
|
||||||
var zipphone2_3 = getElementById("#Password").val();
|
top.location = '../admin/admin.aspx';
|
||||||
alert("send:" + zipphone2_1)
|
|
||||||
alert("send:" + zipphone2_2)
|
|
||||||
alert("send:" + zipphone2_3)
|
|
||||||
//parent.location.replace('../Customers/Welcome.aspx');
|
|
||||||
top.location.replace('../Customers/Welcome.aspx');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|||||||
@@ -61,5 +61,6 @@ Partial Class login_login_TEST
|
|||||||
|
|
||||||
|
|
||||||
Protected Sub LoginButton_Click(sender As Object, e As EventArgs)
|
Protected Sub LoginButton_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -19,6 +19,5 @@ Partial Class _Default
|
|||||||
'cookie2.Expires = DateTime.Now.AddYears(-1)
|
'cookie2.Expires = DateTime.Now.AddYears(-1)
|
||||||
'Response.Cookies.Add(cookie2)
|
'Response.Cookies.Add(cookie2)
|
||||||
|
|
||||||
Response.Redirect("login/Logout.aspx")
|
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
Reference in New Issue
Block a user