简体   繁体   English

Joomla用户和管理员的统一登录表单

[英]Unified login form for Joomla user and administrator

My client is insistent that there be a single page where both Joomla administrators and users can log in, as opposed to the default Joomla setup where these two groups log in in separate locations (/administrator for the admin). 我的客户坚持认为,只有Joomla管理员和用户都可以在一个页面上登录,而不是默认的Joomla设置,这两个组分别在不同的位置登录(/ admin为管理员)。 While the reasons for the client's insistence are besides the point, essentially it's a small group where only some users can do CMS type management of articles etc., but they don't want to have to go to separate pages, go figure. 尽管坚持客户的理由并不重要,但实际上这是一个很小的小组,只有一些用户可以对文章等进行CMS类型管理,但是他们不想去单独的页面,走了。

Anyway, is there some sort of extension for this, or would I have to write an authentication plugin to handle? 无论如何,对此是否有某种扩展,还是我必须编写身份验证插件来处理? Could the controller for one type of login call the other login and pass through the same credentials, and if so how would that be put into code? 一种登录类型的控制器可以调用另一种登录名并通过相同的凭据吗?如果是的话,如何将其放入代码中?

Actually admin users + normal users can log in in the front end (the normal page). 实际上,管理员用户+普通用户可以登录前端(普通页面)。 Admin users can edit articles their, whereas normal users can't. 管理员用户可以编辑文章,而普通用户则不能。

All other things (like creating categories etc.) needs to be done in the backend (/administrator/). 所有其他事情(例如创建类别等)都需要在后端(/ administrator /)中完成。 I suppose you want the following scenario: 我想您想要以下情形:
1) You log in at your.site.com 1)您登录your.site.com
2) you click at a link to your.site.com/administrator/ 2)您单击指向your.site.com/administrator/的链接
3) and without retyping the password you are logged in into back-end. 3)并且无需重新输入密码即可登录到后端。

As far as I know, a such extension (authentification plugin) does not yet exist. 据我所知,这样的扩展名(身份验证插件)尚不存在。 But it should be feasible. 但这应该是可行的。 At both locations (frontend and backend) the same plugin will be used. 在两个位置(前端和后端),将使用相同的插件。 So for passing the information that a user is logged in, you could try: 因此,为了传递用户登录的信息,您可以尝试:
- whether the $_SESSION is the same -$ _SESSION是否相同
- if not, set a cookie with an random id, store this id in the database (together with username), and ask for such a cookie when checking login. -如果不是,请设置一个具有随机ID的Cookie,将此ID与用户名一起存储在数据库中,并在检查登录名时要求提供此类Cookie。

I wouldn't modify the existing login plugin, instead, write a new one with only this alternative login method. 我不会修改现有的登录插件,而是仅使用此替代登录方法编写一个新的插件。 All published Authentification Plugins are ORed, ie as long as one of them allow to log in, everything is ok. 所有已发布的身份验证插件都经过“或”运算,即,只要其中一个允许登录,一切正常。

Tutorial: http://docs.joomla.org/Tutorial:Creating_an_Authentication_Plugin_for_Joomla_1.5 教程: http//docs.joomla.org/教程: Creating_an_Authentication_Plugin_for_Joomla_1.5

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM