duanlang1196 2008-12-01 18:23
浏览 12
已采纳

joomla中密码提醒的好组件

I would like to change the default behavior of Joomla's password reminding mechanism. I would like to be provided with checking of the strength of a password and (optionally) with captcha capabilities. I was wondering if there's a free component for Joomla which I could install and use out-of-the-box.

  • 写回答

1条回答 默认 最新

  • douli6605 2008-12-02 05:22
    关注

    If you don't mind hacking around in the core code, then you can look in the components\com_user\controller.php file. In the save() function, around line 82, it retrieves the user's password. At that point you could insert whatever code you like to check the password strength:

    $passOK = true;
    if($post['password'] != $post['password2']) {
        $msg = JText::_('PASSWORDS_DO_NOT_MATCH');
        $passOK = false;
    } else if (strlen($post['password']) < 6 || !preg_match("/[0-9]/", $post['password'])) {
        $msg = "The password is too short, or it doesn't contain any numbers.";
        $passOK = false;
    }
    if (!$passOK) {
        $return = @$_SERVER['HTTP_REFERER'];
        if (empty($return) || !JURI::isInternal($return)) {
            $return = JURI::base();
        }
        $this->setRedirect($return, $msg, 'error');
        return false;
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于用pyqt6的项目开发该怎么把前段后端和业务层分离
  • ¥30 线性代数的问题,我真的忘了线代的知识了
  • ¥15 有谁能够把华为matebook e 高通骁龙850刷成安卓系统,或者安装安卓系统
  • ¥188 需要修改一个工具,懂得汇编的人来。
  • ¥15 livecharts wpf piechart 属性
  • ¥20 数学建模,尽量用matlab回答,论文格式
  • ¥15 昨天挂载了一下u盘,然后拔了
  • ¥30 win from 窗口最大最小化,控件放大缩小,闪烁问题
  • ¥20 易康econgnition精度验证
  • ¥15 msix packaging tool打包问题