public function testCleartextPasswordsAreHashedWithDefaultAlgo()
 {
     $loader = new MemberCsvBulkLoader();
     $results = $loader->load($this->getCurrentRelativePath() . '/MemberCsvBulkLoaderTest_cleartextpws.csv');
     $member = $results->Created()->First();
     $memberID = $member->ID;
     DataObject::flush_and_destroy_cache();
     $member = DataObject::get_by_id('SilverStripe\\Security\\Member', $memberID);
     // TODO Direct getter doesn't work, wtf!
     $this->assertEquals(Security::config()->password_encryption_algorithm, $member->getField('PasswordEncryption'));
     $result = $member->checkPassword('mypassword');
     $this->assertTrue($result->valid());
 }
 public function doImport($data, $form)
 {
     $loader = new MemberCsvBulkLoader();
     // optionally set group relation
     if ($this->group) {
         $loader->setGroups(array($this->group));
     }
     // load file
     $result = $loader->load($data['CsvFile']['tmp_name']);
     // result message
     $msgArr = array();
     if ($result->CreatedCount()) {
         $msgArr[] = _t('MemberImportForm.ResultCreated', 'Created {count} members', array('count' => $result->CreatedCount()));
     }
     if ($result->UpdatedCount()) {
         $msgArr[] = _t('MemberImportForm.ResultUpdated', 'Updated {count} members', array('count' => $result->UpdatedCount()));
     }
     if ($result->DeletedCount()) {
         $msgArr[] = _t('MemberImportForm.ResultDeleted', 'Deleted %d members', array('count' => $result->DeletedCount()));
     }
     $msg = $msgArr ? implode(',', $msgArr) : _t('MemberImportForm.ResultNone', 'No changes');
     $this->sessionMessage($msg, 'good');
     $this->controller->redirectBack();
 }