File "functions.php"

Full path: /home/kosmetik/public_html/wp-content/plugins/really-simple-ssl/lets-encrypt/integrations/directadmin/functions.php
File size: 1.33 B
MIME-type: text/x-php
Charset: utf-8

Download   Open   Edit   Advanced Editor   Back

<?php

defined('ABSPATH') or die;
function rsssl_install_directadmin()
{
    if (rsssl_is_ready_for('installation')) {
        $directadmin = new rsssl_directadmin();
        $domains = RSSSL_LE()->letsencrypt_handler->get_subjects();
        $response = $directadmin->installSSL($domains);
        if ($response->status === 'success') {
            update_option('rsssl_le_certificate_installed_by_rsssl', 'directadmin');
        }
        return $response;
    } else {
        $status = 'error';
        $action = 'stop';
        $message = __("The system is not ready for the installation yet. Please run the wizard again.", "really-simple-ssl");
        return new RSSSL_RESPONSE($status, $action, $message);
    }
}
function rsssl_directadmin_add_condition_actions($steps)
{
    $directadmin = new rsssl_directadmin();
    if ($directadmin->credentials_available()) {
        $index = array_search('installation', array_column($steps['lets-encrypt'], 'id'));
        $index++;
        $steps['lets-encrypt'][$index]['actions'] = array();
        $steps['lets-encrypt'][$index]['actions'][] = array('description' => __("Attempting to install certificate...", "really-simple-ssl"), 'action' => 'rsssl_install_directadmin', 'attempts' => 1, 'speed' => 'normal');
    }
    return $steps;
}
add_filter('rsssl_steps', 'rsssl_directadmin_add_condition_actions');