Viewing File: /usr/local/cpanel/whostmgr/docroot/templates/autossl/index.cmb.min.js

define("app/directives/starRating",["angular","cjt/core"],(function(e,t){"use strict";var r=e.module("whostmgr.autossl.starRating",[]);r.directive("starRating",(function(){return{templateUrl:"directives/starRating.phtml",restrict:"EA",replace:!0,transclude:!0,scope:{max:"=",rating:"="},controller:["$scope",function(e){function t(){for(e.stars=[];e.stars.length<e.max;)e.stars.push(e.rating>e.stars.length?1:0)}e.$watch("max",t),e.$watch("rating",t),t()}]}}))})),define("app/services/manageService",["lodash","angular","cjt/util/parse","cjt/util/query","cjt/io/api","cjt/io/whm-v1-request","cjt/io/whm-v1"],(function(e,t,r,a,s,n){"use strict";var o=t.module("App"),i=[];function u(e,t,r){this.label=e,this.desc=t,this.isScorePart=!!r,this.starRating=r||0,this.getLabel=function(){return this.label},this.getDescription=function(){if(!this.desc)return"";var e="";return e+=this.desc,this.starRating&&(e+="<br />",e+="<em>",e+=this._starDescription(),e+="</em>"),e},this._starDescription=function(){return LOCALE.maketext("A maximum of [quant,_1,star,stars] is possible.",this.starRating)}}function c(t,o,u){function c(e){var r=t.defer();return s.promise(e.getRunArguments()).done((function(e){e=e.parsedResponse,r[e.status?"resolve":"reject"](e)})),r.promise}function l(e){var t=new n.Class;if(t.initialize("",e.func),e.data)for(var r in e.data)t.addArgument(r,e.data[r]);return c(t)}function _(e,t){for(var r=0;r<e.length;r++)e[r][t]&&(e[r][t+"_epoch"]=Date.parse(e[r][t])/1e3)}var d=["AVERAGE_DELIVERY_TIME","MAX_DOMAINS_PER_CERTIFICATE","HTTP_DCV_MAX_REDIRECTS"],f={};var m,g={AVERAGE_DELIVERY_TIME:1e6,RATE_LIMIT_CERTIFICATES_PER_REGISTERED_DOMAIN_PER_WEEK:-1,MAX_DOMAINS_PER_CERTIFICATE:-1};var p=u.currentAccountID;u.provider_info.forEach((function(e){r.parsePerlBoolean(e.enabled)&&(m=e.module_name)}));["clobber_externally_signed","notify_autossl_expiry","notify_autossl_expiry_coverage","notify_autossl_renewal_coverage","notify_autossl_renewal_coverage_reduced","notify_autossl_renewal_uncovered_domains","notify_autossl_renewal"].forEach((function(e){u.metadata[e]=r.parseInteger(u.metadata[e]),"clobber_externally_signed"!==e&&(u.metadata[e+"_user"]=r.parseInteger(u.metadata[e+"_user"]))})),u.constants.MIN_VALIDITY_DAYS_LEFT_BEFORE_CONSIDERED_ALMOST_EXPIRED=r.parseInteger(u.constants.MIN_VALIDITY_DAYS_LEFT_BEFORE_CONSIDERED_ALMOST_EXPIRED);var h,v,S,b=e.sortBy(u.logs_catalog,"start_time").reverse(),E={},w=u.provider_info;function x(){return l({func:"get_autossl_check_schedule"}).then((function(e){return h=new Date(e.data.next_time),v&&(v(h),v=null),h}))}function A(){(!h||h<=new Date)&&x().then((function(){S||(S=o(A,6e4))}))}function y(e,t){return(r=[{func:e,data:t},{func:"get_autossl_check_schedule"},{func:"get_autossl_providers"}],s=new n.Class,s.initialize("","batch"),r.forEach((function(e,t){s.addArgument("command-"+t,e.func+"?"+a.make_query_string(e.data))})),c(s)).then((function(e){var r=e.data[1].parsedResponse.next_time;h=new Date(r),m=t.provider,e.data[2].parsedResponse.data.forEach((function(e){"1"===e.enabled.toString()&&(p=e.x_account_id)})),A()}));var r,s}function L(e){_(e,"start_time");for(var t=0;t<e.length;t++)e[t].in_progress=r.parsePerlBoolean(e[t].in_progress)}return d.forEach((function(t){!function(t,r){if(f[r])return f[r];var a=!1;-1!==["AVERAGE_DELIVERY_TIME"].indexOf(r)&&(a=!0),t.forEach((function(t){var s=e.isNil(t.specs[r])&&g[r]?g[r]:t.specs[r];if(e.isUndefined(f[r]))f[r]=s;else if("RATE_LIMIT_CERTIFICATES_PER_REGISTERED_DOMAIN_PER_WEEK"===r){if(0===f[r])return;"0"===s.toString()?f[r]=0:s>f[r]&&(f[r]=s)}else(a&&s<f[r]||!a&&s>f[r])&&(f[r]=s)})),f[r]}(w,t)})),w.forEach((function(e){var t,r;e.specSpecifics={},e.x_terms_of_service_accepted||(e.x_terms_of_service_accepted=""),e.saved_x_terms_of_service_accepted=e.x_terms_of_service_accepted,e.usabilityScore=(r=0,r+=(t=e).specs.DCV_METHODS.length,"1"===t.specs.SUPPORTS_ANCESTOR_DCV.toString()&&(t.specSpecifics.SUPPORTS_ANCESTOR_DCV=1,r*=2),t.specs.SUPPORTS_WILDCARD&&"1"===t.specs.SUPPORTS_WILDCARD.toString()&&(t.specSpecifics.SUPPORTS_WILDCARD=1,r+=1),d.forEach((function(e){t.specs[e]===f[e]&&(t.specSpecifics[e]=1,r++)})),r),e.maxUsabilityScore=8})),w.sort((function(e,t){return t.usabilityScore-e.usabilityScore})),m&&A(),{groom_logs_catalog:L,get_next_autossl_check_time:function(){return h},refresh_next_autossl_check_time:x,after_next_check_refresh:function(e){if("function"!=typeof e)throw"Needs a function!";v=e},getTableColumns:function(){return i},get_providers:function(){return w},get_provider_display_name:function(e){for(var t=0;t<w.length;t++)if(w[t].module_name===e)return w[t].display_name;return e},get_saved_provider_module_name:function(){return m},getSavedProviderAccountID:function(){return p},restore_and_save_scope:function(e,t,r){E[e]&&r.forEach((function(r){t[r]=E[e][r]})),E[e]=t},get_logs_catalog:function(){return b},refresh_logs_catalog:function(){return l({func:"get_autossl_logs_catalog",data:{"api.sort.enable":1,"api.sort.a.field":"start_time","api.sort.a.reverse":1}}).then((function(e){return L(e=e.data),b=e,e}))},get_log:function(e){return l({func:"get_autossl_log",data:e}).then((function(e){return _(e=e.data,"timestamp"),e}))},get_autossl_pending_queue:function(){return l({func:"get_autossl_pending_queue"}).then((function(e){return e.data}))},start_autossl_for_all_users:function(){return l({func:"start_autossl_check_for_all_users"})},reset_provider_data:function(e){return y("reset_autossl_provider",e)},save_provider_data:function(e){return e.provider?y("set_autossl_provider",e):l({func:"disable_autossl"}).then((function(){m=null,o.cancel(S),h=null}))},metadata:u.metadata,save_metadata:function(){return l({func:"set_autossl_metadata",data:{metadata_json:JSON.stringify(u.metadata)}})}}}return i[i.length]=new u(LOCALE.maketext("Provider")),i[i.length]=new function(e,t,r){u.call(this,e,t,r),this.isScorePart=!1}(LOCALE.maketext("Usability Score"),LOCALE.maketext("The capabilities of a provider determine the provider’s rank."),8),i[i.length]=new function(e,t,r){u.call(this,e,t,r),this._starDescription=function(){var e="";return e+=LOCALE.maketext("A maximum of 2 stars per method if the provider supports Ancestor DCV."),e+=" ",e+=LOCALE.maketext("Otherwise, a maximum of 1 star per method.")}}(LOCALE.maketext("DCV Methods"),LOCALE.maketext("The Domain Control Validation methods that the provider offers."),4),i[i.length]=new u(LOCALE.maketext("Ancestor DCV Support"),LOCALE.maketext("Whether the successful Domain Control Validation of a parent domain implies the success of a subdomain. For example, if “example.com” succeeds, “store.example.com” would succeed.")),i[i.length]=new u(LOCALE.maketext("Domains per Certificate"),LOCALE.maketext("The number of unique domains each certificate can contain."),1),i[i.length]=new u(LOCALE.maketext("Delivery Method"),LOCALE.maketext("The method that the provider uses to issue the certificate.")),i[i.length]=new u(LOCALE.maketext("Average Delivery Time"),LOCALE.maketext("The amount of time that the provider requires to issue a certificate."),1),i[i.length]=new u(LOCALE.maketext("Validity Period"),LOCALE.maketext("The amount of time before the certificate expires.")),i[i.length]=new u(LOCALE.maketext("Maximum Number of Redirects"),LOCALE.maketext("The maximum number of redirections a domain can use and still pass an HTTP-based Domain Control Validation."),1),i[i.length]=new u(LOCALE.maketext("Wildcard Support"),LOCALE.maketext("The provider supports wildcard domains."),1),c.$inject=["$q","$interval","PAGE"],o.factory("manageService",c)})),define("app/views/select_provider_controller",["lodash","angular","cjt/util/locale","cjt/util/parse","uiBootstrap","cjt/directives/formWaiting"],(function(e,t,r,a){"use strict";var s;try{s=t.module("App")}catch(e){s=t.module("App",[])}return s.controller("select_provider_controller",["$scope","manageService","growl",function(s,n,o){function i(t){t.data&&t.data.forEach((function(t){t.parsedResponse.messages.forEach((function(t){o[t.level](e.escape(t.content))}))}))}function u(e,t){if(!e)return t;var a,s,n,o,i,u,c,l=(a=1e3*e,i=Math.floor(a/1e3),o=Math.floor(i/60),i%=60,n=Math.floor(o/60),o%=60,s=Math.floor(n/24),n%=24,{y:Math.floor(s/365),d:s%=365,h:n,m:o,s:i});return c=[],(u=l).y&&(c[c.length]=r.maketext("[quant,_1,year,years]",u.y)),u.d&&(c[c.length]=r.maketext("[quant,_1,day,days]",u.d)),u.h&&(c[c.length]=r.maketext("[quant,_1,hour,hours]",u.h)),u.m&&(c[c.length]=r.maketext("[quant,_1,minute,minutes]",u.m)),u.s&&(c[c.length]=r.maketext("[quant,_1,second,seconds]",u.s)),c.join("/")}t.extend(s,{providers:n.get_providers(),showScoreDetails:!1,provider_by_module_name:{},provider_submit_type:{},current_provider_module_name:"",getFormattedSpec:function(t,a){var s=(t=e.isNil(t)?"":t).toString();switch(a){case"list_and_quoted":s=r.list_and_quoted(t);break;case"numf":s=r.numf(t);break;case"time_string":s=u(t,r.maketext("[output,em,Unspecified]"));break;case"rate_limit":s="0"===t.toString()?r.maketext("unlimited"):t}return""===s.toString()?r.maketext("[output,em,Unspecified]"):s.toString()},toggleShowScoreDetails:function(){s.showScoreDetails=!s.showScoreDetails},get_current_provider:function(){return s.current_provider_module_name?s.provider_by_module_name[s.current_provider_module_name]:null},getTableColumns:n.getTableColumns.bind(n),getDetailsExplaination:function(){var e=n.getTableColumns();return e=e.filter((function(e){return e.isScorePart})).map((function(e){return e.getLabel()})),r.maketext("This interface uses the following parameters to calculate the usability score: [list_and,_1].",e)},get_saved_provider_module_name:n.get_saved_provider_module_name,do_submit:function(){var t=function(){var e=s.current_provider_module_name,t=s.get_current_provider(),r=t?t.x_terms_of_service_accepted:"",a={provider:e};return t&&t.x_terms_of_service&&(a.x_terms_of_service_accepted=r),a}(),a=s.get_current_provider(),u="reset"===s.provider_submit_type[s.current_provider_module_name];return n[u?"reset_provider_data":"save_provider_data"](t).then((function(){var n=s.provider_by_module_name[t.provider];u?o.success(r.maketext("You have created a new registration for this system with “[_1]” and configured [asis,AutoSSL] to use that provider.",e.escape(n.display_name))):n?o.success(r.maketext("You have configured [asis,AutoSSL] to use the “[_1]” provider.",e.escape(n.display_name))):o.success(r.maketext("You have disabled [asis,AutoSSL]. Any users with [asis,SSL] certificates from [asis,AutoSSL] will continue to use them, but the system will not automatically renew these certificates.")),a&&(a.saved_x_terms_of_service_accepted=a.x_terms_of_service_accepted),s.provider_submit_type[s.current_provider_module_name]=""}),i).finally((function(){s.$emit("provider-module-updated")}))}}),s.providers.forEach((function(e){a.parsePerlBoolean(e.enabled)&&(s.current_provider_module_name=e.module_name),s.provider_by_module_name[e.module_name]=e})),n.restore_and_save_scope("select_provider",s,["current_provider_module_name"])}])})),define("app/views/view_logs_controller",["lodash","angular","cjt/util/locale","cjt/core","cjt/util/parse","uiBootstrap","cjt/directives/formWaiting"],(function(e,t,r,a,s){"use strict";return t.module("App").controller("view_logs_controller",["$scope","$timeout","manageService","growl","PAGE",function(a,s,n,o,i){function u(t){return o.error(e.escape(t.error))}n.groom_logs_catalog(i.logs_catalog);var c={};i.provider_info.forEach((function(e){c[e.module_name]=e.display_name}));var l=window.LOCALE,_={warn:"exclamation-triangle",error:"minus-square",out:"info-circle",success:"check"},d={success:r.maketext("SUCCESS"),warn:r.maketext("WARN"),error:r.maketext("ERROR")},f=r.maketext("Unparsable log data ([_1]):","__ERR__");t.extend(a,{log_level_localized:d,log_level_fontawesome:_,logs_catalog:n.get_logs_catalog(),chosen_log:n.get_logs_catalog()[0],datetime:l.local_datetime.bind(l),get_provider_display_name:n.get_provider_display_name,fetch_logs_catalog:function(){return n.refresh_logs_catalog().then((function(e){a.logs_catalog=e;var t=a.chosen_log;if(a.chosen_log=null,t)for(var r=0;r<e.length;r++)if(t.provider===e[r].provider&&t.start_time===e[r].start_time){a.chosen_log=e[r];break}a.chosen_log||(a.chosen_log=e[0])}),u)},_log_data_to_html:function(t){var a,s=[],n={};for(var o in d)n[o]=e.escape(d[o]);for(var i=0;i<t.length;i++){var u=t[i],c="logentry-"+u.type;""+u.indent!="0"&&(c+=" indent"+u.indent);var l="<div class='"+c+"'>";_[u.type]&&(l+=" <span class='fas fa-"+_[u.type]+"'></span>");var m=[u.indent,u.timestamp_epoch].join();m!==a&&u.timestamp_epoch&&(a=m,l+=" <span>"+r.local_datetime(u.timestamp_epoch,"time_format_medium")+"</span>"),d[u.type]&&(l+=" <span>"+n[u.type]+"</span>"),l+="contents"in u?" "+e.escape(u.contents):" <span class='log-unparsed'>??? "+f.replace(/__ERR__/,e.escape(u.parse_error))+" "+e.escape(u.raw)+"</span>",l+="</div>",s.push(l)}return s.join("")},log_submit:function(){var e=Object.create(a.chosen_log);return a.log_load_in_progress=!0,n.get_log(e).then((function(t){a.current_loaded_log=t,s((function(){document.getElementById("current_loaded_log_html").innerHTML=a._log_data_to_html(t)})),e.start_time_epoch=a.chosen_log.start_time_epoch,a.last_load_data=e}),u).then((function(){a.log_load_in_progress=!1}))}}),n.restore_and_save_scope("view_logs",a,["chosen_log","last_load_data","current_loaded_log"])}])})),define("app/services/AutoSSLConfigureService",["angular","lodash","cjt/io/api","cjt/io/whm-v1-request","cjt/io/whm-v1"],(function(e,t,r,a){var s=e.module("App");function n(t,s){var n={},o=[],i={},u=null;function c(s,n,o,i){var u=t.defer(),c=new a.Class;return c.initialize(s,n),e.forEach(o,(function(e,t){c.addArgument(t,e)})),i&&e.forEach(i,(function(e){c.addFilter(e.key,e.operator,e.value)})),r.promise(c.getRunArguments()).done((function(e){(e=e.parsedResponse).status?u.resolve(e):u.reject(e.error)})),u.promise}function l(t,r){var a=t;if(r){var s=[];e.forEach(r,(function(e,t){s.push(t+"="+encodeURIComponent(e))})),a+="?"+s.join("&")}return a}return n._set_auto_ssl_for_users=function(t,r){var a=JSON.stringify({autossl:r?"1":"0"}),s={command:[]};return e.forEach(t,(function(e){e.updating=!0,s.command.push(l("add_override_features_for_user",{user:e.user,features:a}))})),c(u,"batch",s).then((function(){e.forEach(t,(function(e){e.auto_ssl_enabled=r?"enabled":"disabled"}))})).finally((function(){e.forEach(t,(function(e){e.updating=!1}))}))},n.enable_auto_ssl_for_users=function(e){return n._set_auto_ssl_for_users(e,!0)},n.disable_auto_ssl_for_users=function(e){return n._set_auto_ssl_for_users(e,!1)},n.reset_auto_ssl_for_users=function(t){var r=JSON.stringify(["autossl"]),a={command:[]};return e.forEach(t,(function(e){e.updating=!0,a.command.push(l("remove_override_features_for_user",{user:e.user,features:r}))})),c(u,"batch",a).then((function(){e.forEach(t,(function(e){e.auto_ssl_enabled="inherit"}))})).finally((function(){e.forEach(t,(function(e){e.updating=!1}))}))},n.get_user_by_username=function(e){var t=i[e];return o[t]},n.get_users=function(){return o},n.fetch_users=function(){if(s.users)return t=s.users,o=[],i={},e.forEach(t,(function(e){i[e.user]=o.length,o.push({user:e.user,rowSelected:0,updating:!0,auto_ssl_settings:{}})})),n.get_users();var t;s.users=[]},n.fetch_users_features_settings=function(r){return r.length?c(u,"get_users_features_settings",{user:r.map((function(e){return e.user})),feature:"autossl"}).then((function(t){var r;r=t.data,e.forEach(r,(function(e){var t=n.get_user_by_username(e.user);t.feature_list=e.feature_list,t.auto_ssl_settings=e,t.auto_ssl_enabled="inherit","0"!==e.cpuser_setting&&"1"!==e.cpuser_setting||(t.auto_ssl_enabled="1"===e.cpuser_setting?"enabled":"disabled")})),n.get_users()})).finally((function(){e.forEach(r,(function(e){e.updating=!1}))})):t.reject()},n.start_autossl_for_user=function(e){return c(u,"start_autossl_check_for_one_user",{username:e})},n}return n.$inject=["$q","PAGE"],s.factory("AutoSSLConfigureService",n)})),define("app/views/ManageUsersController",["angular","cjt/util/locale","lodash","uiBootstrap","cjt/directives/toggleSortDirective","cjt/directives/searchDirective","cjt/directives/pageSizeDirective","cjt/directives/toggleSwitchDirective","cjt/filters/startFromFilter","cjt/decorators/paginationDecorator","ngSanitize"],(function(e,t,r){return e.module("App").controller("ManageUsersController",["$scope","$filter","AutoSSLConfigureService","ssl_users","growl",function(a,s,n,o,i){function u(e){if(e)return i.error(r.escape(e))}a.users=o,a.items=a.users,a.selected_items=[],a.filteredList=[],a.showPager=!0,a.all_rows_selected=!1,a.meta={sortReverse:!1,sortBy:"user",sortDirection:"asc",maxPages:0,totalItems:a.items.length,currentPage:1,pageSize:10,pageSizes:[10,20,50,100],start:0,limit:10,filterValue:""},a.fetch=function(){var e=[];if(e=""!==a.meta.filterValue?s("filter")(a.items,a.meta.filterValue,!1):a.items,""!==a.meta.sortDirection&&""!==a.meta.sortBy&&(e=s("orderBy")(e,a.meta.sortBy,"asc"!==a.meta.sortDirection)),a.meta.totalItems=e.length,a.meta.totalItems>r.min(a.meta.pageSizes)){var t=(a.meta.currentPage-1)*a.meta.pageSize,n=a.meta.pageSize;e=s("limitTo")(s("startFrom")(e,t),n),a.showPager=!0,a.meta.start=t+1,a.meta.limit=t+e.length}else a.showPager=!1,0===e.length?a.meta.start=0:a.meta.start=1,a.meta.limit=e.length;var o=s("filter")(e,(function(e){return!e.rowSelected})).length;return a.filteredList=e,a.all_rows_selected=e.length>0&&0===o,e},a.can_run_check=function(e){if("enabled"===e.auto_ssl_enabled||"inherit"===e.auto_ssl_enabled&&"1"===e.auto_ssl_settings.feature_list_setting.toString())return!0},a.filter_table=function(){a.fetch(),a.get_settings_for_current_users()},a.sort_table=function(){a.fetch(),a.get_settings_for_current_users()},a.set_page=function(){a.fetch(),a.get_settings_for_current_users()},a.set_page_size=function(){a.fetch(),a.get_settings_for_current_users()},a.get_settings_for_current_users=function(){n.fetch_users_features_settings(a.filteredList).then(a.fetch,u)},a.showing_text=function(){var e=(a.meta.currentPage-1)*a.meta.pageSize;e+=1;var r=a.meta.currentPage*a.meta.pageSize;return r=Math.min(r,a.items.length),t.maketext("[output,strong,Showing] [numf,_1] - [numf,_2] of [quant,_3,item,items]",e,r,a.items.length)},a.enable_auto_ssl=function(e){var r=s("filter")(e,(function(e){return"enabled"!==e.auto_ssl_enabled}));if(0!==r.length)return n.enable_auto_ssl_for_users(r).then((function(){a.items=a.users=n.get_users();var e=r.map((function(e){return e.user}));e.length>5?i.success(t.maketext("[quant,_1,user has had its,users have had their] feature list “[asis,autossl]” setting overridden and [numerate,_1,is,are] now set to “[_2]”",e.length,t.maketext("enabled"))):i.success(t.maketext("You forcibly enabled the [asis,autossl] feature for the following [numerate,_1,user,users]: [list_and_quoted,_2]",e.length,e))}),u);i.info(t.maketext("No users needed to be updated."))},a.disable_auto_ssl=function(e){var r=s("filter")(e,(function(e){return"disabled"!==e.auto_ssl_enabled}));if(0!==r.length)return n.disable_auto_ssl_for_users(r).then((function(){a.items=a.users=n.get_users();var e=r.map((function(e){return e.user}));e.length>5?i.success(t.maketext("[quant,_1,user has had its,users have had their] feature list “[asis,autossl]” setting overridden and [numerate,_1,is,are] now set to “[_2]”",e.length,t.maketext("disabled"))):i.success(t.maketext("You forcibly disabled the [asis,autossl] feature for the following [numerate,_1,user,users]: [list_and_quoted,_2]",e.length,e))}),u);i.info(t.maketext("No users needed to be updated."))},a.reset_auto_ssl=function(e){if(0!==(e=s("filter")(e,(function(e){return"inherit"!==e.auto_ssl_enabled}))).length)return n.reset_auto_ssl_for_users(e).then((function(){a.items=a.users=n.get_users();var r=e.map((function(e){return e.user}));r.length>5?i.success(t.maketext("[quant,_1,user has had its,users have had their] feature list “[asis,autossl]” setting reset to use the setting established by [numerate,_1,its,their] feature [numerate,_1,list,lists]",r.length)):i.success(t.maketext("You reset the [asis,autossl] feature to the feature list setting for the following [numerate,_1,user,users]: [list_and_quoted,_2]",r.length,r))}),u);i.info(t.maketext("No users needed to be updated."))},a.update_auto_ssl_setting=function(e,t){e.auto_ssl_enabled!==t&&("inherit"===t?a.reset_auto_ssl([e]):"enabled"===t?a.enable_auto_ssl([e]):"disabled"===t&&a.disable_auto_ssl([e]))},a.start_autossl_for_user=function(e){return n.start_autossl_for_user(e).then((function(a){i.success(t.maketext("The system is checking the “[_1]” account’s domains (process [asis,ID] “[_2]”).",r.escape(e),a.data.pid))}),u)},a.select_all_items=function(t,r){r&&(a.all_rows_selected=!0),e.forEach(t,(function(e){e.rowSelected=a.all_rows_selected})),a.selected_items=a.get_selected_items(),a.fetch(),a.get_settings_for_current_users()},a.clear_all_selections=function(){e.forEach(a.items,(function(e){e.rowSelected=0})),a.selected_items=a.get_selected_items(),a.fetch(),a.get_settings_for_current_users()},a.select_item=function(){a.selected_items=a.get_selected_items(),a.fetch(),a.get_settings_for_current_users()},a.get_selected_items=function(){return s("filter")(a.items,(function(e){if(e.rowSelected)return!0}))},a.auto_ssl_items=function(e){return s("filter")(e,(function(e){return"enabled"===e.auto_ssl_enabled}))},a.get_reset_string=function(e){return e.auto_ssl_settings.feature_list_setting?t.maketext("Use setting established by the feature list “[_1]” which is currently set to “[_2]”.",e.feature_list,"1"===e.auto_ssl_settings.feature_list_setting?t.maketext("enabled"):t.maketext("disabled")):""},a.get_enable_button_label=function(){return t.maketext("Enable [asis,AutoSSL] on selected [quant,_1,user,users]",a.selected_items.length)},a.get_disable_button_label=function(){return t.maketext("Disable [asis,AutoSSL] on selected [quant,_1,user,users]",a.selected_items.length)},a.get_reset_button_label=function(){return t.maketext("Reset [asis,AutoSSL] on selected [quant,_1,user,users]",a.selected_items.length)},a.fetch(),a.get_settings_for_current_users()}])})),define("app/views/OptionsController",["lodash","angular","cjt/util/locale","cjt/core","cjt/util/parse","uiBootstrap","cjt/directives/formWaiting"],(function(e,t,r,a,s){"use strict";var n=t.module("App"),o={disable:[],certFailures:["notify_autossl_expiry","notify_autossl_expiry_coverage","notify_autossl_renewal_coverage_reduced","notify_autossl_renewal_coverage"]};return o.failWarnDefer=e.concat(o.certFailures,"notify_autossl_renewal_uncovered_domains"),o.all=e.concat(o.failWarnDefer,"notify_autossl_renewal"),n.controller("OptionsController",["$scope","manageService","growl","PAGE",function(a,s,n,i){function u(t){return n.error(e.escape(t.error))}t.extend(a,{metadata:s.metadata,clobber_externally_signed_string:function(){return r.maketext("This option will allow [asis,AutoSSL] to replace certificates that the [asis,AutoSSL] system did not issue. When you enable this option, [asis,AutoSSL] will install certificates that replace users’ [output,abbr,CA,Certificate Authority]-issued certificates if they are invalid or expire within [quant,_1,day,days].",i.constants.MIN_VALIDITY_DAYS_LEFT_BEFORE_CONSIDERED_ALMOST_EXPIRED)},do_submit:function(){return e.each(o.all,(function(e){s.metadata[e]=0,s.metadata[e+"_user"]=0})),e.each(o[a.adminNotifications],(function(e){s.metadata[e]=1})),e.each(o[a.userNotifications],(function(e){s.metadata[e+"_user"]=1})),s.save_metadata().then((function(){n.success(r.maketext("Success!"))}),u)}}),s.metadata.notify_autossl_renewal?a.adminNotifications="all":s.metadata.notify_autossl_renewal_uncovered_domains?a.adminNotifications="failWarnDefer":e.find(o.certFailures,(function(e){return s.metadata[e]}))?a.adminNotifications="certFailures":a.adminNotifications="disable",s.metadata.notify_autossl_renewal_user?a.userNotifications="all":s.metadata.notify_autossl_renewal_uncovered_domains_user?a.userNotifications="failWarnDefer":e.find(o.certFailures,(function(e){return s.metadata[e+"_user"]}))?a.userNotifications="certFailures":a.userNotifications="disable"}])})),define("app/index",["lodash","angular","cjt/util/locale","cjt/core","cjt/util/parse","cjt/modules","uiBootstrap","cjt/directives/actionButtonDirective","app/directives/starRating"],(function(e,t,r,a){"use strict";return a.config.html5Mode=!1,function(){return t.module("App",["cjt2.config.whm.configProvider","ngRoute","ui.bootstrap","angular-growl","cjt2.whm","whostmgr.autossl.starRating"]),require(["cjt/bootstrap","uiBootstrap","app/services/manageService","app/views/select_provider_controller","app/views/view_logs_controller","app/services/AutoSSLConfigureService","app/views/ManageUsersController","app/views/OptionsController"],(function(s){var n=[{path:"/providers/",label:r.maketext("Providers"),controller:"select_provider_controller",templateUrl:a.buildFullPath("autossl/views/select_provider.ptt")},{path:"/options/",label:r.maketext("Options"),controller:"OptionsController",templateUrl:a.buildFullPath("autossl/views/options.ptt")},{path:"/view-logs/",label:r.maketext("Logs"),controller:"view_logs_controller",templateUrl:a.buildFullPath("autossl/views/view_logs.ptt")},{path:"/manage-users/",label:r.maketext("Manage Users"),controller:"ManageUsersController",templateUrl:a.buildFullPath("autossl/views/manage-users.ptt"),resolve:{ssl_users:["AutoSSLConfigureService",function(e){return e.fetch_users()}]}}],o=n[0].path,i=t.module("App");i.value("PAGE",PAGE),i.controller("BaseController",["$rootScope","$scope","$route","$location","manageService","AutoSSLConfigureService","growl",function(a,s,o,i,u,c,l){function _(t){return l.error(e.escape(t.error))}s.loading=!1,s.activeTabs=[],a.$on("$routeChangeStart",(function(e,t){s.onLoadTab(t.path),s.active_path=t.path,s.loading=!0})),a.$on("$routeChangeSuccess",(function(){s.loading=!1})),a.$on("$routeChangeError",(function(){s.loading=!1,s.go("providers")})),s.current_route_matches=function(e){return i.path().match(e)},s.onLoadTab=function(e){s.activeTabs.forEach((function(t,r){t.path===e&&(s.currentTab=r)}))},s.updated_current_module=function(){s.current_provider_module=u.get_saved_provider_module_name()},s.$on("provider-module-updated",(function(){s.updated_current_module()})),s.go=function(e){i.path(e)},s.activeTabs=n,s.updated_current_module(),t.extend(s,{next_check_time_string:function(){var e=u.get_next_autossl_check_time();if(e){var t=e;return t-=6e4*e.getTimezoneOffset(),t/=1e3,r.maketext("This system’s next regular [asis,AutoSSL] check will occur at [datetime,_1,time_format_short].",Math.round(t))}},getSavedProviderAccountID:u.getSavedProviderAccountID.bind(u),getCurrentProviderDisplayName:function(){return u.get_provider_display_name(u.get_saved_provider_module_name())},get_saved_provider_module_name:u.get_saved_provider_module_name,start_autossl_for_all_users:function(){return u.start_autossl_for_all_users().then((function(e){l.success(r.maketext("[asis,AutoSSL] is now checking all users. The process has [asis,ID] “[_1]”.",e.data.pid))}),_)}})}]),i.config(["$routeProvider",function(e){n.forEach((function(t){e.when(t.path,t)})),e.otherwise({redirectTo:o})}]),s()}))}}));
Back to Directory File Manager