getValue(); if (!empty($value) && ($decrypted = Mage::helper('core')->decrypt($value))) { $this->setValue($decrypted); } } /** * Encrypt value before saving * */ protected function _beforeSave() { $value = (string)$this->getValue(); // don't change value, if an obscured value came if (preg_match('/^\*+$/', $this->getValue())) { $value = $this->getOldValue(); } if (!empty($value) && ($encrypted = Mage::helper('core')->encrypt($value))) { $this->setValue($encrypted); } } /** * Get & decrypt old value from configuration * * @return string */ public function getOldValue() { return Mage::helper('core')->decrypt(parent::getOldValue()); } }