<?php


class SettingsAuthenticationImporter extends BaseDataImporter
{
    public function isOnlyForAdmin(): bool
    {
        return true;
    }

    public function import($data)
    {
        if (isset($data) && !empty($data) && isset($this->phar[$data])) {
            $ldapConfigPath = FCPATH . '/ldap/config/settings.ldap.php';
            $content = $this->phar[$data]->getContent();
            $content = $this->ci->cf_encrypt->decryptByKey($content, $this->encryptionKey);
            if ($content) {
                file_put_contents($ldapConfigPath, $content);
            }
        }
    }
}
