在管理员批准后启用新用户注册.

编程入门 行业动态 更新时间:2024-10-10 10:28:18
本文介绍了在管理员批准后启用新用户注册.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有用户帐户注册页面..用户在其中输入诸如用户名,密码,电子邮件,姓名等信息.以及点击注册时.用户注册成功.我希望每当用户注册到网络时..他的注册将一直待处理,直到得到管理员的批准为止.在管理员启用受限于Web的用户后,他可以登录,然后可以登录,否则他不能....我该怎么做?

i have users account registration page.. where user put information such as username, password ,email, name, e.t.c. and when the click register. user registration is sucessful. i want that when ever user register to the web.. his registration wil remain pending until it is approved by the admin. after admin enable the user rigestered to web, he can login then he can login otherwise he can''t.... how can i doo that??

推荐答案

如果将用户信息保留在数据库中,则可以有一个类似UserStatus的列.在代码中,它应该类似于枚举集: If you keep user information in database, you can have a column like UserStatus. In the code, it should be something like enumeration a bit set: [System.Flags] enum UserStatus { None = 0, ApprovalPending = 1, //approved if this bit it clear Logged = 2, //... powers of 2 Initial = ApprovalPending, // used only internally } //usage: UserStatus userStatus = UserStatus.Initial; //same as UserStatus.ApprovalPending; //initial status immediately the user account is created //to check a set element: bool approvalPending == (userStatus & UserStatus.ApprovalPending) > 0; //to include: userStatus |= UserStatus.ApprovalPending; //to exclude (approve): userStatus ^= UserStatus.ApprovalPending;

您的数据库可以在此列中存储一个数值,它是UserStatus枚举值的按位组合,您可以将其从数值类型强制转换为UserStatus并返回. 要进行批准和其他管理操作,您可以拥有一个特殊的管理网页,例如受密码保护,或设计一个特殊的数据库访问应用程序,该应用程序只能在本地网络中访问.

—SA

Your database can store one numeric value in this column, a bitwise combination of UserStatus enumeration values, you can cast it from numeric type to UserStatus and back. For approvals and other administrative actions, you can have a special administration Web page, say, password protected, or devise a special database access application accessible only within the local network.

—SA

更多推荐

在管理员批准后启用新用户注册.

本文发布于:2023-11-28 18:02:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1643410.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:新用户注册   管理员   批准后

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!