Joomla 1.5 管理员文件夹令牌


joomla 1.5 admin folder token

我正在尝试在Joomla 1.5 +站点上强化管理员登录,尽管客户端可能很快就会进行升级 - 但这还没有发生。 我使用以下代码编辑了管理员/索引.php:

/* Block access to administrator
--------------------------------------------- */
$user =& JFactory::getUser();
$secretkey = 'mytoken';
$redirectto = 'location: http://www.myurl.com';
$usertype = 'Registered';
//Check if the user is not logged in or if is not a super user:
if ($user->guest) { //|| (!$user->guest && $user->usertype == $usertype) ) {
//Check if the secret key is present on the url:
if (@$_GET['access'] != $secretkey) { header($redirectto); }
}
/* --------------------------------------------- */

这是基于我在网上找到的某人的代码。目前,键入 www.myurl.com/administrator/或 www.myurl.com/administrator/index.php 会重定向到主页。www.myurl.com/administrator/index.php?access=mytoken 显示登录名。登录尝试次数已经下降,但RSFirewall!组件仍然每天报告几个。

在我评论第一个if语句的后半部分之前,代码总是重定向没有什么..

他们如何仍然访问登录页面? 我还能做得更好吗?

与其破解核心,为什么不使用提供此功能的众多插件之一?

在当前的Joomla扩展目录(JED)上,"登录保护"中列出的许多产品都有Joomla 1.5版本,或者尝试存档的JED(对于Joomla 1.5扩展),您可以尝试登录保护部分。

如果您的代码在 /administrator/index.php 中的 onAfterInitialise 事件之后,则防火墙软件可能仍会记录访问。onAfterInitialise事件是扩展可以"插入"到Joomla的第一个地方!环境。

为了避免任何扩展,您可能需要在此块之前编写代码:

// trigger the onAfterInitialise events
JDEBUG ? $_PROFILER->mark('afterInitialise') : null;
$mainframe->triggerEvent('onAfterInitialise');

各种安全插件通常将自己附加到此事件中,并首先以非常低甚至负值对自己进行排序,这就是为什么它们在没有防火墙看到问题的情况下工作的原因。