You are here

function hosting_ssl_nodeapi_site_presave in Hosting 6.2

Same name and namespace in other branches
  1. 7.4 web_server/ssl/hosting_ssl.nodeapi.inc \hosting_ssl_nodeapi_site_presave()
  2. 7.3 web_server/ssl/hosting_ssl.nodeapi.inc \hosting_ssl_nodeapi_site_presave()

File

web_server/ssl/hosting_ssl.nodeapi.inc, line 193

Code

function hosting_ssl_nodeapi_site_presave(&$node) {
  if (!isset($node->ssl_key)) {
    $node->ssl_key = HOSTING_SSL_CUSTOM_KEY;
  }
  if (!isset($node->ssl_enabled)) {
    $node->ssl_enabled = HOSTING_SSL_DISABLED;
  }

  // If the user has specified a new SSL key to use, sanitise the name.
  if ($node->ssl_key == HOSTING_SSL_CUSTOM_KEY && isset($node->ssl_key_new)) {
    $node->ssl_key = hosting_ssl_filter_key($node->ssl_key_new);
  }

  // this creates the SSL key for the site, if required
  $node->ssl_key = hosting_ssl_save_key($node);
}