具有三个访问级别的登录系统 [英] A login system with three access levels

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

问题描述

嗨...

我正在尝试为具有(3)访问级别的招聘系统创建一个登录页面.如果访问级别为1(超级管理员),则他们会收到管理员主页;如果访问级别是2(子管理员),则他们会收到(子管理员页面);如果访问级别是3(求职者),则他们会得到(求职者)主页)
同样取决于用户的访问级别,如果用户对该页面没有适当的访问级别,则一些链接将从用户中隐藏.

1.用于验证用户名和密码的存储过程是什么?

2-如何操作:
登录按钮上的Login方法根据数据库中的凭据验证用户名和密码,当用户单击按钮并且try Login变量返回true时,访问级别来自数据库,其中数据库中的用户名与用户名文本字段匹配. .

我是ASP.NET编程的初学者 plz ,请帮助

Hi ...

I am attempting to create a login page for Recruitment-system that has (3) access levels. If the access level is 1 (super Admin)they receive the Admin home page,if the level is 2(sub admin) they receive the (sub admin page) and If th access level is 3 (job seeker)they receive the (jobseeker home page)
also depending on access level of the user , some links will be hidden from the user if he is not have the appropriate access level to that page .

1 . what is the stored procedure to validates the username and password?

2-how to do this:
Login method on login button validates the username and password against the credentials in the database, when the user clicks the button and the try Login variable is returns true the access level is taken from the database where the username in the database matches the username text field. .

I''m a beginner in ASP.NET programming plz please help

推荐答案

Hello

看看这些:

http://msdn.microsoft.com/en-us/library/dd338930.aspx [ ^ ]

http://blogs.msdn. com/b/lcris/archive/2005/06/15/sql-server-2005-procedure-signing-demo.aspx [ http://stackoverflow.com/questions/2190140/stored-procedure-in-sqlserver-用户登录 [ ^ ]

SQL Server存储过程概述 [ http://www.csharp-station.com/Tutorial/AdoDotNet/lesson07 [ ^ ]


验证后,您可以将用户重定向到他/她的特定页面.
看看这些:
ASP.NET身份验证和授权
ASP.NET身份验证

而且我认为您可以通过搜索Google找到答案.
请查看以下内容:代码项目快速解答常见问题解答
Hello

Look at these:

http://msdn.microsoft.com/en-us/library/dd338930.aspx[^]

http://blogs.msdn.com/b/lcris/archive/2005/06/15/sql-server-2005-procedure-signing-demo.aspx[^]

http://stackoverflow.com/questions/2190140/stored-procedure-in-sqlserver-user-login[^]

Overview of SQL Server Stored Procedure[^]

http://www.csharp-station.com/Tutorial/AdoDotNet/lesson07[^]


You can Redirect the user to his/her specific page after authentication.
Look at these:
ASP.NET authentication and authorization
ASP.NET Authentication

And I think you could find your answer by searching google.
Please look at this: Code Project Quick Answers FAQ


这是一个非常简单的解决方案:
首先,您需要一个存储过程.将用户名和密码发送到数据库,
考虑到您有一个像users这样的表,它必须有一个像usertype这样的列!
像这样的东西:
Hi,This is a very simple solution:
first you need a store proc. to send username and password to data base,
Considering that you have a table like users.it must have a column like usertype!
something like this:
CREATE PROCEDURE [dbo].[Users_login]
	
	(
	 @Password nvarchar (16) ,
     @Username nvarchar (32)
	)
	
AS
	   SELECT Usertype,Password,Username FROM Users u  
    
    where Username=@Username and 
    u.Password=@Password

    ; 
	RETURN


根据用户的类型(由第一个存储过程返回),您可以将每个用户重定向到特定页面,也可以配置一个页面来处理所有用户(不推荐),例如:


Depending on the type of the user(returned by the first store proc) you can redirect each user to specific page or you can configure a single page to handle all users(not recommended) like:

<%= if(_isSuperAdmin) { %>
<div>
some data that only admin is allowed to see
</div>
<% } %>


这篇关于具有三个访问级别的登录系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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