简体   繁体   English

如何将joomla自定义登录表单应用于整个网站?

[英]How to apply joomla custom login form to entire site?

I am developing custom component in joomla . 我在joomla中开发自定义组件。 My component has it's own login form.The requirement is when I logged in custom component login form it is applied to entire site (All the login forms are logged in).It is like Kunena Forum . 我的组件具有自己的登录表单。要求是,当我登录自定义组件登录表单时,它将应用于整个站点(所有登录表单均已登录)。就像Kunena论坛

This is the Joomla's default login form: 这是Joomla的默认登录表单:

在此处输入图片说明

And this is the Kunena forum login form: 这是Kunena论坛的登录表单:

在此处输入图片说明

When I logged here it shows like: 当我在这里登录时,它显示为:

在此处输入图片说明

Now Joomla default login form also shows as logged in 现在,Joomla默认登录表单也显示为已登录

在此处输入图片说明

How to implement like this to my component.Please help me anyone. 如何在我的组件中实现这种方法。请任何人帮助我。

Thanks in advance 提前致谢

You should not create your own login system, you should use the core one, otherwise Bad Thing Could Happen™. 您不应该创建自己的登录系统,而应该使用核心系统,否则,Bad Thing可能发生。
This leads to the question: Why you should need another login form? 这导致了一个问题: 为什么您需要另一个登录表单? Which kind of checks you have to perform? 您必须执行哪种检查?

Anyway, you could create a plugin that hooks at the onUserAuthorisation event. 无论如何,您都可以创建一个挂接onUserAuthorisation事件的插件。
If the user could login, you should return JAuthentication::STATUS_DENIED , otherwise block him returning JAuthentication::STATUS_DENIED 如果用户可以登录,则应该返回JAuthentication::STATUS_DENIED ,否则阻止他返回JAuthentication::STATUS_DENIED

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

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