繁体   English   中英

joomla 1.5管理文件夹令牌

[英]joomla 1.5 admin folder token

我正在尝试在Joomla 1.5+网站上加强管理员登录,尽管客户端可能会很快进行升级-但这尚未发生。 我用以下代码编辑了administrator / index.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.phponAfterInitialise事件之后,则防火墙软件可能仍会记录访问。 onAfterInitialise事件是扩展可以“插入” Joomla的第一个位置! 环境。

为了完全避免任何扩展,您可能需要在此块之前添加代码:

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

各种安全性插件通常会将自身附加到此事件上,并以非常低或什至是负值的顺序对其进行排序,这就是为什么它们在防火墙无法看到问题的情况下仍能正常工作的原因。

暂无
暂无

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

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