protected function addEncryptedPass(Am_Record $user, $lineParsed, $format) { $user_id = $user->pk(); if ($format == SavedPassTable::PASSWORD_PHPASS) { /* Special Case for Native aMember Hash Format */ $field = $this->getImportField('pass', self::FIELD_TYPE_ENCRYPTED_PASS); $user->updateQuick('pass', $field->getValue($lineParsed)); } else { $savedPass = $this->getDi()->savedPassTable->findFirstBy(array('user_id' => $user_id, 'format' => $format)); if (!$savedPass) { $savedPass = $this->getDi()->savedPassRecord; $savedPass->format = $format; $savedPass->user_id = $user_id; } foreach ($this->getImportFields(self::FIELD_TYPE_ENCRYPTED_PASS) as $field) { $field->setValueForRecord($savedPass, $lineParsed); } $savedPass->save(); } $user->data()->set(Am_Protect_Databased::USER_NEED_SETPASS, 1); $user->save(); }