Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Vanilla password security
This discussion has been closed.
Comments
// extensions/Md5authenticator/default.php <?php /* Extension Name: Md5Authenticator Extension Url: http://lussumo.com/community/?CommentID=90404 Description: Replace Vanilla Authenticator to only use md5 hash Version: 0.1.1 Author: Damien Lebrun Author Url: N/A */ global $Context; // Check for Vanilla 1.1.5 and that we didn't already installed our authenticator if (array_key_exists('AUTHENTICATION_CLASS', $Context->Configuration) && $Context->Configuration['AUTHENTICATION_MODULE'] !== 'Md5Autehnticator' ) { AddConfigurationSetting($Context, 'AUTHENTICATION_MODULE', '../extensions/Md5authenticator/Authenticator.php'); AddConfigurationSetting($Context, 'AUTHENTICATION_CLASS', 'Md5Authenticator'); } // extensions/Md5authenticator/Authenticator.php <?php if (!defined('IN_VANILLA')) exit(); global $Configuration; include_once $Configuration['LIBRARY_PATH'] . '/People/People.Class.Authenticator.php'; class Md5Authenticator extends Authenticator { function Md5Authenticator(&$Context) { $this->Context = &$Context; $this->PasswordHash = new Md5Hash($Context); } } class Md5Hash { var $Context; function CheckPassword($User, $Password, $RegenerateHash=1) { if ($Password && $User->Password !== '*') { if (md5($Password) === $User->Password) { return true; } else if ($Password === $User->Password ) { if ($RegenerateHash) { $this->SetNewPassword($User, $Password); } return true; } } return false; } function HashPassword($Password) { return md5($Password); } function Md5Hash(&$Context) { $this->Context =& $Context; } function SetNewPassword($User, $Password) { $UserManager = $this->Context->ObjectFactory->NewContextObject( $this->Context, 'UserManager'); $User->Password = $this->HashPassword($Password); return $UserManager->SaveUserCredentials($User); } }