Example #1
0
 public function afterLoad()
 {
     UserFieldEncryptionProvider::decryptProperties($this);
 }
Example #2
0
 /**
  * Activates encryption. Loads configurations and gives them to encryption provider.
  * Needs to be called before using UmgtUser-Objects or loading data from umgt,
  * when encryption should be used.
  */
 public function activateEncryption()
 {
     if (UserFieldEncryptionProvider::$encryptedFieldNames === null) {
         $config = $this->getConfigurationSection();
         $sectionName = 'FieldEncryption';
         if (!$config->hasSection($sectionName)) {
             return;
         }
         $section = $config->getSection($sectionName);
         $fieldNamesString = $section->getValue('FieldNames', '');
         if (strlen($fieldNamesString) !== 0) {
             UserFieldEncryptionProvider::$encryptedFieldNames = explode('|', $fieldNamesString);
             UserFieldEncryptionProvider::$encryptionConfigKey = $section->getValue('Key', '');
         }
     }
 }