diff --git a/security/Member.php b/security/Member.php index 4133aad8e..f8cbcad48 100644 --- a/security/Member.php +++ b/security/Member.php @@ -325,8 +325,8 @@ class Member extends DataObject { * @return string Returns a random password. */ static function createNewPassword() { - if(file_exists('/usr/share/silverstripe/wordlist.txt')) { - $words = file('/usr/share/silverstripe/wordlist.txt'); + if(file_exists(Security::get_word_list())) { + $words = file(Security::get_word_list()); list($usec, $sec) = explode(' ', microtime()); srand($sec + ((float) $usec * 100000)); diff --git a/security/Security.php b/security/Security.php index ad772b56a..997fade87 100644 --- a/security/Security.php +++ b/security/Security.php @@ -50,6 +50,29 @@ class Security extends Controller { * @var bool */ protected static $useSalt = true; + + /** + * Location of word list to use for generating passwords + * + * @var string + */ + protected static $wordlist = '/usr/share/silverstripe/wordlist.txt'; + + /** + * Get location of word list file + */ + static function get_word_list() { + return Security::$wordlist; + } + + /** + * Set location of word list file + * + * @param string $wordListFile Location of word list file + */ + static function set_word_list($wordListFile) { + Security::$wordlist = $wordListFile; + } /**