File manager - Edit - /usr/local/cpanel/whostmgr/docroot/templates/license_purchase/views/checkoutController.min.js
Back
define(["lodash","angular","cjt/util/locale","cjt/util/query","cjt/modules","cjt/decorators/growlDecorator"],(function(_,angular,LOCALE,QUERY){"use strict";var app=angular.module("App");var controller=app.controller("checkoutController",["$scope","$location","$routeParams","$window","$timeout","growl","storeService",function($scope,$location,$routeParams,$window,$timeout,growl,storeService){var steps=["login","generateOrder","checkout","installLicense","licenseActivated"];var currentStepIndex=steps.indexOf($routeParams.nextStep)===-1?0:steps.indexOf($routeParams.nextStep);var isUpgrade=false;isUpgrade=$routeParams["everythingelse"]==="upgrade"||QUERY.parse_query_string(location.search.replace(/^\?/,""))["upgrade"]==="1";var getReturnURL=function(stepID){var pageURL=PAGE.pageURL?PAGE.pageURL:$location.absUrl();var returnURL=PAGE.baseURL+pageURL+"/"+stepID;if(isUpgrade){returnURL+="/upgrade"}return returnURL};var redirectToHomePage=function(timeoutInterval){var interval=timeoutInterval||2e4;$timeout((function(){$window.location.href=PAGE.baseURL}),interval)};var storeLoginRedirect=function(){var returnURL=getReturnURL(steps[currentStepIndex+1]);return storeService.getLoginURL(returnURL).then((function(results){if(results.data&&results.data.length){$window.location.href=results.data[0]}}),(function(error){growl.error(LOCALE.maketext("The system encountered an error when it accessed the cPanel Store login [output,acronym,URL,Uniform Resource Locator]: [_1]",error)+" "+LOCALE.maketext("Redirecting to the [output,acronym,WHM,WebHost Manager] interface …"),{ttl:2e4,disableCountDown:false});redirectToHomePage()}))};var executeStep=function(){if(!$routeParams.nextStep){storeLoginRedirect();return}if($location.search().code&&$routeParams.nextStep==="generateOrder"){var stepIndex=steps.indexOf($routeParams.nextStep);var returnURI=getReturnURL(steps[stepIndex]);return storeService.validateLoginToken($location.search().code,returnURI).then((function(results){if(results.data&&results.data.length){var accessToken=results.data[0].access_token;if(accessToken){returnURI=getReturnURL(steps[currentStepIndex+2]);storeService.generateLicenseOrder(accessToken,returnURI,isUpgrade).then((function(results){if(results.data&&results.data.length){currentStepIndex=currentStepIndex+1;if(results.data[0]){$window.location.href=results.data[0]}else{growl.error(LOCALE.maketext("The system encountered an error when it generated your license order.")+" "+LOCALE.maketext("Redirecting to the [output,acronym,WHM,WebHost Manager] interface …"),{ttl:2e4,disableCountDown:false});redirectToHomePage()}}}),(function(error){growl.error(LOCALE.maketext("The system encountered an error when it generated your license order.")+"<br />"+LOCALE.maketext("Error: “[_1]”",error)+"<br />"+LOCALE.maketext("Redirecting to the [output,acronym,WHM,WebHost Manager] interface …"),{ttl:2e4,disableCountDown:false});redirectToHomePage()}))}else{growl.error(LOCALE.maketext("The system encountered a token validation error.")+" "+LOCALE.maketext("Redirecting to the [output,acronym,WHM,WebHost Manager] interface …"),{ttl:2e4,disableCountDown:false});redirectToHomePage()}}}),(function(error){growl.error(LOCALE.maketext("The system encountered a token validation error.")+"<br />"+LOCALE.maketext("Error: “[_1]”",error)+"<br />"+LOCALE.maketext("Redirecting to the [output,acronym,WHM,WebHost Manager] interface …"),{ttl:2e4,disableCountDown:false});redirectToHomePage()}))}if($routeParams.nextStep==="installLicense"&&$location.search().order_status){if($location.search().order_status==="success"){currentStepIndex=currentStepIndex+1;return storeService.updateLicense().then((function(){currentStepIndex=currentStepIndex+1;growl.success(LOCALE.maketext("The system successfully updated the license.")+" "+LOCALE.maketext("Redirecting to the [output,acronym,WHM,WebHost Manager] interface …"),{ttl:5e3,disableCountDown:false});redirectToHomePage(5e3)}),(function(error){growl.error(LOCALE.maketext("The system encountered an error when it updated your license.")+"<br />"+LOCALE.maketext("Error: “[_1]”",error)+"<br />"+LOCALE.maketext("Redirecting to the [output,acronym,WHM,WebHost Manager] interface …"),{ttl:2e4,disableCountDown:false});redirectToHomePage()}))}else if($location.search().order_status==="cancelled"){growl.error(LOCALE.maketext("The system successfully canceled the order.")+" "+LOCALE.maketext("Redirecting to the [output,acronym,WHM,WebHost Manager] interface …"),{ttl:2e4,disableCountDown:false});redirectToHomePage()}else if($location.search().order_status==="error"){growl.error(LOCALE.maketext("The system encountered an error.")+LOCALE.maketext("Redirecting to the [output,acronym,WHM,WebHost Manager] interface …"),{ttl:2e4,disableCountDown:false});redirectToHomePage()}}};$scope.getStepClass=function(step){var stepIndex=steps.indexOf(step);if(stepIndex!==-1){if(currentStepIndex>stepIndex){return"checkout-step-completed"}else if(currentStepIndex===stepIndex){return"checkout-step-current"}}};executeStep()}]);return controller}));
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Generation time: 0.05 |
proxy
|
phpinfo
|
Settings