登录维护 [英] Login Maintanance

查看:52
本文介绍了登录维护的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我是基于Intranet的图书馆管理系统

在主页上我已要求用户输入他们的登录ID

并从中选择一个选项按钮天气他是管理员或

成员。根据他的身份和选择的选项,他被重定向到他的相应账户

。如果他是会员,那么他的帐户页面打开

如果他是管理员,他将被带到管理页面,在那里他可以与wid数据库进行交互。

我希望每当管理员从任何计算机登录时在网络上

没有其他人可以作为管理员登录,因为管理员只能是一个人。

所以提供安全性我想这样做。

所以要做的事情是,一次只能有一个人可以作为管理员从整个网络进入


我该怎么办?

我可以使用应用程序或会话对象和global.asa文件吗?

如果是,那么

Hi
I m makin Intranet based Library Management System
On Homepage i have asked user to enter their login id
and select from one option button weather he is a administrator or
member.So as per his id and selected option he is been redirected to
his corresponding account.If he is member then his account page is opened
and if he is admin the he is taken to admin page where he can interact wid database.
I want that whenever Administrator has logged in from any computer on network
no other person can login as administrator as admin is to be only one person.
So to provide security I want to do this.
So the thing to be done is only one person at a time can enter as administrator
from the whole network.
How can i do this ???
Can I use application or session objects and global.asa file ?
If yes then how

推荐答案




一种方法可以是:

你可以在数据库中创建一个表来存储登录的详细信息管理员。此表大致包含以下字段:


1)AdministratorId -

描述:整数

2)LoginDateTime -

描述:datetime值

3)LoginStatus -

描述:

将包含布尔值

每次用户登录时,使LoginStatus = 1

每次用户注销时,使LoginStatus = 0



现在,在管理员登录时的页面,检查管理员的LoginStatus。如果是1,则不允许他访问管理员页面。


Hi,

One method can be that :
You can create a table in the database which will store the login details of the administrator.This table will roughly contain following fields :

1) AdministratorId -
Description:integer
2) LoginDateTime -
Description :datetime value
3) LoginStatus -
Description :
Will contain Boolean value
Eachtime when user logs in ,make LoginStatus =1
Eachtime when user logs out, make LoginStatus =0


Now,in your page when the Administrator logs in , check the LoginStatus of the the admistrator. If it is 1 do not allow him access to the administrator page.



您好

我是基于Intranet的图书馆管理系统

开主页我已要求用户输入他们的登录ID

并从一个选项按钮中选择天气他是管理员或

member.So根据他的身份和选择的选项他是被重定向到他的相应帐户。如果他是会员,那么他的帐户页面就会被打开

如果他是管理员,他将被带到管理页面,在那里他可以互动wid数据库。

我希望每当管理员从网络上的任何计算机登录时

没有其他人可以作为管理员登录,因为管理员只能是一个人。

所以提供安全性我想这样做。

所以要做的事情是一次只有一个人可以作为管理员进入

来自整个网络。

我该怎么做?

我可以使用应用程序或会话对象和global.asa文件吗? br />
如果是,那么
Hi
I m makin Intranet based Library Management System
On Homepage i have asked user to enter their login id
and select from one option button weather he is a administrator or
member.So as per his id and selected option he is been redirected to
his corresponding account.If he is member then his account page is opened
and if he is admin the he is taken to admin page where he can interact wid database.
I want that whenever Administrator has logged in from any computer on network
no other person can login as administrator as admin is to be only one person.
So to provide security I want to do this.
So the thing to be done is only one person at a time can enter as administrator
from the whole network.
How can i do this ???
Can I use application or session objects and global.asa file ?
If yes then how


我做了同样的事情,但问题是当他用注销按钮退出时当它点击注销时,它将运行良好,数据库中的值再次重置为0,这样运行良好。

但是当他使用标题栏上的关闭按钮关闭网站时,我无法更改数据库中的值并将其设置为0,因此当他再次尝试登录时

他不会允许,因为价值将是1

现在要做什么?

所以我想在Global.asa文件中尝试会话或应用程序事件

但是如何使用会话或应用程序变量?

和wat使用会话或应用程序
I have done the same thing but the problem is that when he log out with the log off button it will run well as when he clicks on log off the value in database is again reset to 0 so this will run well.
but when he will close the site using close button on title bar then i cant change the value in database and set it to 0 so when he tries to login in again
he will not allowed as the value will be 1
now wat to do ??
So m thinkin of trying session or application events in Global.asa file
but how to use session or application variable ?
and wat to use session or application





如果你想使用应用程序和会话变量执行以下操作,请执行以下步骤:


1)当用户登录到应用程序时设置会话和应用程序变量。


Login.asp

<%

昏暗的用户名

Dim userRights

''设置用户名及其权限的会话变量

会话(LoginName)=用户名

会话(权利 ;)= userRig hts


''设置应用程序变量


''检查用户是否拥有管理员权限

如果(会话(权限)=管理员)

if(应用程序(AdminLogin)= false)或(应用程序(AdminLogin)="")

Application.Lock()

''使管理员登录= true

应用程序(AdminLogin)= true

Application.Unlock()

else

Response.write(不允许登录)

结束如果

结束如果

%>


2)现在在Global.asa上写下以下代码:

以下代码将处理如果用户通过单击标题栏的十字按钮关闭表单的情况。


Sub Application_OnEnd()

Application.Lock ()

''使管理员Lo gin = false

应用程序(AdminLogin)= false

Application.UnLock()

End Sub


Sub Session_OnEnd()

''清除会话变量

会话(" LoginName")=""

会话(权利)=""

结束子

Hi,

If you want to do it using Application and session variable following are the steps for doing this:

1) When the user Logs in into the application set the session and application variables.

Login.asp
<%
Dim username
Dim userRights

''Set the session variables for username and his rights
Session("LoginName") = username
Session("Rights") = userRights

''Set the application variable

''Check if user is having Administrator rights
If(Session("Rights") = "Administrator")
if (Application("AdminLogin") = false) OR (Application("AdminLogin") = "")
Application.Lock()
''Make the adminstrative Login = true
Application("AdminLogin")= true
Application.Unlock()
else
Response.write("Login is not allowed")
end if
End if
%>

2) Now on Global.asa write the following code :
The following code will take care of the situation that if user closes the form by clicking on cross button of title bar.

Sub Application_OnEnd()
Application.Lock()
''Make the adminstrative Login = false
Application("AdminLogin")= false
Application.UnLock()
End Sub


Sub Session_OnEnd()
''Clear session variables
Session("LoginName") = ""
Session("Rights") = ""
End sub



我做了同样的事情,但问题是,当他用注销按钮注销时,它会运行良好,因为当他点击注销时,数据库中的值再次重置为0,这样运行良好。

但是当他使用标题栏上的关闭按钮关闭网站时,我无法更改数据库中的值并将其设置为0,因此当他再次尝试登录时

他不会允许,因为价值将是1

现在要做什么?

所以我想在Global.asa文件中尝试会话或应用程序事件

但是如何使用会话或应用程序变量?

和wat使用会话或应用程序
I have done the same thing but the problem is that when he log out with the log off button it will run well as when he clicks on log off the value in database is again reset to 0 so this will run well.
but when he will close the site using close button on title bar then i cant change the value in database and set it to 0 so when he tries to login in again
he will not allowed as the value will be 1
now wat to do ??
So m thinkin of trying session or application events in Global.asa file
but how to use session or application variable ?
and wat to use session or application


这篇关于登录维护的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆