From 60c78eb54d962d1f16baab25a4ca736b79fd6627 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Tue, 19 Oct 2010 00:37:43 +0000 Subject: [PATCH] ENHANCEMENT New Member records are populated with the currently set default through i18n::set_locale() (from r108499) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112753 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/i18n.php | 3 ++- security/Member.php | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/i18n.php b/core/i18n.php index db65eaa7c..2538bccf0 100755 --- a/core/i18n.php +++ b/core/i18n.php @@ -1726,7 +1726,8 @@ class i18n extends Object { } /** - * Get the current locale + * Get the current locale. + * Used by {@link Member::populateDefaults()} * * @return string Current locale in the system */ diff --git a/security/Member.php b/security/Member.php index 10b5abd43..ca93044ea 100755 --- a/security/Member.php +++ b/security/Member.php @@ -110,13 +110,12 @@ class Member extends DataObject { */ protected static $login_marker_cookie = null; - /** * Ensure the locale is set to something sensible by default. */ public function populateDefaults() { parent::populateDefaults(); - $this->Locale = i18n::default_locale(); + $this->Locale = i18n::get_locale(); } function requireDefaultRecords() { @@ -646,7 +645,7 @@ class Member extends DataObject { ); // Overwrite the Password property with the hashed value -; $this->Password = $encryption_details['password']; + $this->Password = $encryption_details['password']; $this->Salt = $encryption_details['salt']; $this->PasswordEncryption = $encryption_details['algorithm']; @@ -665,7 +664,7 @@ class Member extends DataObject { if(!$this->Locale) { $this->Locale = i18n::get_locale(); } - + parent::onBeforeWrite(); }