Jump to content

The SSL Store module Improuvement


Blesta Addons

Recommended Posts

the new ssl store module is wonderful . but we have some observation in it that is really important to improve .

1 - the service name_key is always "new" as it defined in the confg.json .it must show the domain tht the ssl was activated for .

2 - there are no option for admins to edit the services_fields, is important if we want to add a license manually then attach it to a active order in the thesslstore website .

3 - the reminder email should include the domain name for the ssl .

3 - a good welcome email template sample :)

as we have a lot of ssl for client we can't locate wich ssl we should go in it, we need to enter to every ssl to see the domain of the certificate .

Link to comment
Share on other sites

i have made a look at the module code,  i found that the domain is set in the service fields but after the client is completing the ssl generation process successfully, but in the live mod is not set , maybe it's a bug , some client has completed the ssl process feneration and is active now , but the thesslstore_fqdn is empty .

the module has a email template in his code, but i cant see it in the package !!! not sure why .

note i use the module in v 3.6 .

Link to comment
Share on other sites

i have added the fucntion to allow local edit, it can be added to the module for next release .

 

    /**
     * Returns all fields to display to an admin attempting to edit a service with the module
     *
     * @param stdClass $package A stdClass object representing the selected package
     * @param $vars stdClass A stdClass object representing a set of post fields
     * @return ModuleFields A ModuleFields object, containg the fields to render as
     *  well as any additional HTML markup to include
     */
    public function getAdminEditFields($package, $vars = null)
    {
        Loader::loadHelpers($this, ['Html']);

        $fields = new ModuleFields();

        // Create domain label
        $thesslstore_fqdn = $fields->label(Language::_('ThesslstoreModule.tab_client_cert_details.domains', true), 'thesslstore_fqdn');
        // Create domain field and attach to domain label
        $thesslstore_fqdn->attach(
            $fields->fieldText('thesslstore_fqdn', $this->Html->ifSet($vars->thesslstore_fqdn), ['id'=>'thesslstore_fqdn'])
        );
        // Set the label as a field
        $fields->setField($thesslstore_fqdn);

        // Create order id label
        $thesslstore_order_id = $fields->label(Language::_('ThesslstoreModule.tab_client_cert_details.store_order_id', true), 'thesslstore_order_id');
        // Create order id field and attach to order id label
        $thesslstore_order_id->attach(
            $fields->fieldText('thesslstore_order_id', $this->Html->ifSet($vars->thesslstore_order_id), ['id'=>'thesslstore_order_id'])
        );
        // Set the label as a field
        $fields->setField($thesslstore_order_id);

        // Create token label
        $thesslstore_token = $fields->label(Language::_('ThesslstoreModule.tab_client_cert_details.token', true), 'thesslstore_token');
        // Create token field and attach to token label
        $thesslstore_token->attach(
            $fields->fieldText('thesslstore_token', $this->Html->ifSet($vars->thesslstore_token), ['id'=>'thesslstore_token'])
        );
        // Set the label as a field
        $fields->setField($thesslstore_token);

        return $fields;
    }
	
    /**
     * Edits the service on the remote server. Sets Input errors on failure,
     * preventing the service from being edited.
     *
     * @param stdClass $package A stdClass object representing the current package
     * @param stdClass $service A stdClass object representing the current service
     * @param array $vars An array of user supplied info to satisfy the request
     * @param stdClass $parent_package A stdClass object representing the parent
     *  service's selected package (if the current service is an addon service)
     * @param stdClass $parent_service A stdClass object representing the parent
     *  service of the service being edited (if the current service is an addon service)
     * @return array A numerically indexed array of meta fields to be stored for this service containing:
     *  - key The key for this meta field
     *  - value The value for this key
     *  - encrypted Whether or not this field should be encrypted (default 0, not encrypted)
     * @see Module::getModule()
     * @see Module::getModuleRow()
     */
    public function editService($package, $service, array $vars = null, $parent_package = null, $parent_service = null)
    {
        // Set fields to update locally
        $service_fields = ['thesslstore_token', 'thesslstore_order_id', 'thesslstore_fqdn'];
        foreach ($service_fields as $field) {			
			// check if the field is set and is not empty
			if (isset($vars[$field]) && $vars[$field] != '') {
				$service_fields[$field] = trim($vars[$field]);
			}
        }
		
		$fields = []; 
        foreach ($service_fields as $key => $value) {
            $fields[] = ['key' => $key, 'value' => $value];
        }

        return $fields;
    }

 

Link to comment
Share on other sites

33 minutes ago, Paul said:

We are planning to maintain it for v4 forward. Keeping that in mind, feel free to submit pull requests on Github, the extension is open source.

i have sent the request pull for the local edit .

now i found that the response from placeFullOrder() is not returning the domain to add it in the service field .

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...