brkwsky/contao-encryption

This package is abandoned and no longer maintained. The author suggests using the plenta/contao-encryption package instead.

A replacement service for the removed Contao encryption class.

1.1.0 2022-03-02 08:42 UTC

This package is auto-updated.

Last update: 2022-03-02 08:56:55 UTC


README

Abandoned

This package is abandoned. Please use plenta/contao-encryption.

Contao Encryption

A replacement service for the deprecated Contao encryption class (Contao\Encryption).

Install using Contao Manager

Search for encryption and you will find this extension.

Install using Composer

composer require brkwsky/contao-encryption

Example > DCA

// tl_member
$GLOBALS['TL_DCA']['tl_member']['fields']['bank_iban'] = [
    'label' => &$GLOBALS['TL_LANG']['tl_member']['bank_iban'],
    'exclude' => true,
    'inputType' => 'text',
    'eval' => [
        'mandatory' => false,
        'maxlength' => 32,
        'tl_class' => 'w50',
        'feEditable' => true,
        'feGroup' => 'bank'
    ],
    'load_callback' => [
        ['brkwsky.encryption', 'decrypt']
    ],
    'save_callback' => [
        ['brkwsky.encryption', 'encrypt']
    ],
    'sql' => "varchar(32) NOT NULL default ''"
];

Example > Url parameter

$encryptionService = \Contao\System::getContainer()->get('brkwsky.encryption');
$urlParameter = $encryptionService->encryptUrlSafe('value');

$urlGetParameter = \Contao\Input::get('parameter');
$encryptionService->decryptUrlSafe($urlGetParameter);