| Server IP : 172.67.216.113 / Your IP : 104.23.243.33 [ Web Server : Apache System : Linux cpanel01wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.59.el6.x86_64 #1 SMP Thu Dec 6 05:11:00 EST 2018 x86_64 User : cp648411 ( 1354) PHP Version : 7.2.34 Disable Function : NONE Domains : 0 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/2388322/cwd/sharedjs/ |
Upload File : |
(function() {
/* -----------------------------------------------*/
/* Explicit JSHINT RULES */
/* -----------------------------------------------*/
/* jshint sub:true */
/* global CPANEL:true, YAHOO:true, window:true, document: true */
/* -----------------------------------------------*/
"use strict";
// Shortcuts
var VALIDATION = CPANEL.validate;
var DOM = YAHOO.util.Dom;
// Generate the needed namespaces
var APPLICATIONS = CPANEL.namespace("CPANEL.Applications");
/**
* This module contains the common code for the ssl applications in cPanel.
* @module CPANEL.Applications.SSL
*/
APPLICATIONS.SSL = {
/**
* Check if the given string is a valid SSL domain;
* i.e., it's either a valid domain, or *.<valid domain>.
*
* @method isValidSSLDomain
* @param {HTMLElement} el The Dom element to validate contains a domain
* @return {Boolean} Whether the given string is a valid SSL domain.
*/
isValidSSLDomain: function(el) {
var domain = el.value.trim();
return VALIDATION.host(domain.replace(/^\*\./, ""));
},
/**
* Check if the given string is a valid SSL domain;
* i.e., it"s either a valid domain, or *.<valid domain>.
*
* @method isValidSSLDomain
* @param {HTMLElement} el The Dom element to validate contains a domain
* @return {Boolean} Whether the given string is a valid SSL domain.
*/
areValidSSLDomains: function(el) {
var domains = el.value.trim().split(/[,;\s]+/);
return domains.every( function(d) {
return VALIDATION.host(d.replace(/^\*\./, ""));
} );
},
/**
* Returns true if the value is defined, false otherwise, allowing
* validation rules to be defined for optional fields.
* @method isOptionalIfUndefined
* @param {HTMLElement} el Element to check.
* @return {Boolean} Returns true if the element has a value, false otherwise.
*/
isOptionalIfUndefined: function(el) {
if (el && el.value !== "") {
return true;
}
return false;
},
/**
* Test the element to see if it contains only ASCII alpha,
* and spaces and dashes.
* @method isAlphaOrWhitespace
* @param {[type]} el [description]
* @return {Boolean} [description]
*/
isAlphaOrWhitespace: function(el) {
if (el && el.value !== "") {
return (/^[\-A-Za-z ]+$/).test(el.value);
}
return false;
}
};
})();