如何限制门户网站中的单次登录 [英] how to restrict single login with in portal
本文介绍了如何限制门户网站中的单次登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
朋友,
我的要求是我有一个用户名和密码..在该用户名中登录,然后每次登录时都需要显示一些类似此用户名的消息.总之,其中.
我不想授予登录不同位置的权限....
如何做到这一点的任何想法,请与我分享...
感谢
Hi Friends,
my requirement is i have one username and password ..in that username logedin then same time where ever login i need to display some message like this username already login..in sum where.
i dont want to give parmission to login different locations....
how to do this any idea please share with me...
thanks
推荐答案
在用户表中添加了两个字段,分别为状态和IP地址
每当用户登录时,我的意思是会话同时将更改状态创建为联机",并跟踪ipaddress
以进行功能响应.
同时用户注销后将状态更改为Offline
因此,这里您得到了逻辑,就像status=Offline
授予登录权限
否则if status==Online
,您可以限制登录不同位置的权限.
in User table add two more field as a Status and IPAddress
when ever user login i mean session create change status to Online at the same time trackipaddress
for feature response.
at the same time when ever user logout change status toOffline
so, here u got logic as ifstatus=Offline
give permission to login
elseif status==Online
you can restrict the permission to login different locations.
尝试
^ ]
http://msdn.microsoft.com/en-us/library/dd577079.aspx [
try
Single Sign-on in ASP.NET and Other Platforms[^]
http://msdn.microsoft.com/en-us/library/dd577079.aspx[^]
inherit ICallbackEventHandler this eventhandler it ca automatically create two methods one is return results another one is store the values and close the i mean kill the sessions.
public partial class
//
this event handler is catch the browser information whn browser naviage or close it can handle.
public partial class sample : System.Web.UI.Page, ICallbackEventHandler
{
protected void Page_Load(object sender, EventArgs e)
{
ClientScriptManager cm = Page.ClientScript;
String cbReference = cm.GetCallbackEventReference(this, "arg", "ReceiveServerData", "");
String callbackScript = "function CallServer(arg, context) {" + cbReference + "; }";
cm.RegisterClientScriptBlock(this.GetType(), "CallServer", callbackScript, true);
}
public string GetCallbackResult()
{
return "Success";
}
public void RaiseCallbackEvent(string eventArgument)
{
//here kill the sessions
}
}
before writing this you can take .js file
write like this and refere all .aspx pages
function confirmExit() {
//do something
}
function ReceiveServerData(arg, context) {
}
这篇关于如何限制门户网站中的单次登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文