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

define("app/services/PasswordListService",["angular","cjt/io/whm-v1-request","cjt/services/APICatcher","cjt/io/whm-v1"],(function(e,t){"use strict";var s;try{s=e.module("App")}catch(t){s=e.module("App",["cjt2.services.apicatcher","cjt2.services.api"])}return s.factory("PasswordListService",["APICatcher","APIService",function(e,s){return{requestPasswordChange:function(e,n,i,r){var a=(new t.Class).initialize("","passwd",{user:e,password:n,enabledigest:i?"1":"0",db_pass_update:r?"1":"0"});return s.promise(a)},hasDigestAuth:function(s){var n=(new t.Class).initialize("","has_digest_auth",{user:s});return e.promise(n).then((function(e){return e.data.digestauth&&"1"===e.data.digestauth.toString()}))},hasMySQLCnf:function(s){var n=(new t.Class).initialize("","has_mycnf_for_cpuser",{user:s});return e.promise(n).then((function(e){return e.data.has_mycnf_for_cpuser&&"1"===e.data.has_mycnf_for_cpuser.toString()}))}}}])})),define("app/index",["angular","cjt/util/locale","cjt/modules","ngAnimate","ngSanitize"],(function(e,t){"use strict";return function(){return e.module("App",["cjt2.whm","cjt2.config.whm.configProvider","ngAnimate","ngSanitize","angular-growl"]),require(["cjt/bootstrap","cjt/directives/validateEqualsDirective","cjt/directives/passwordFieldDirective","cjt/directives/toggleLabelInfoDirective","cjt/directives/actionButtonDirective","cjt/directives/validationContainerDirective","cjt/directives/validationItemDirective","app/services/PasswordListService","cjt/directives/whm/userDomainListDirective"],(function(s){e.module("App").controller("PasswordListController",["$scope","PasswordListService","growl",function(s,n,i){var r,a,o=e.isDefined(PAGE.MINIMUM_PASSWORD_STRENGTH)?parseInt(PAGE.MINIMUM_PASSWORD_STRENGTH,10):10,c={};function u(){s.password=s.confirmPassword="",s.changePasswordForm&&s.changePasswordForm.$setPristine()}PAGE.childWorkloadAccounts&&PAGE.childWorkloadAccounts.forEach((function(e){c[e]=t.maketext("You must edit the password of this account on the parent node.")})),s.editLockedAccounts=c,e.extend(s,{domains:PAGE.domains,password:"",minimumPasswordStrength:o,selectedDomain:null,resetAllFields:u,userSelected:function(e){return document.getElementById("changePasswordForm").elements.namedItem("password").focus(),function(e){s.userConfig={},s.userConfig.enableDigestAuth=!1,s.hasMyCnf=!1,r&&r.abort&&(r.abort(),r=null);r=n.hasDigestAuth(e).then((function(e){s.userConfig.enableDigestAuth=e})).finally((function(){r=null})),PAGE.role_MySQLClient?(a&&a.abort&&(a.abort(),a=null),a=n.hasMySQLCnf(e).then((function(e){s.hasMyCnf=e,s.userConfig.syncMySQLPass=!s.hasMyCnf})).finally((function(){a=null}))):s.userConfig.syncMySQLPass=!1}(e),!0},submitChangePassword:function(){if(!s.selectedDomain||!s.selectedDomain.user)return!1;var e=!0;return s.hasMyCnf&&!s.userConfig.syncMySQLPass&&(e=!1),n.requestPasswordChange(s.selectedDomain.user,s.password,s.userConfig.enableDigestAuth,e).then((function(e){i.success(t.maketext("The system successfully updated the “[_1]” password. The following service passwords changed: [list_and,_2]",s.selectedDomain.user,e.data)),u()}),(function(e){i.error(t.maketext("An error occurred while updating the password: [_1]",e.error)),u()}))}.bind(s)})}]),s("#passwdListWidget")}))}}));
Back to Directory File Manager