function ZmSkin(e){ this.hints=this.mergeObjects(ZmSkin.hints,e) } ZmSkin.hints={ name:"harmony",version:"1",skin:{ containers:"skin_outer"} ,banner:{ position:"static",url:"www.ine.es"} ,favicon:{ dir:""} ,userInfo:{ position:"static"} ,search:{ position:"static"} ,quota:{ position:"static"} ,presence:{ width:"40px",height:"24px"} ,appView:{ position:"static"} ,searchResultsToolbar:{ containers:["skin_tr_search_results_toolbar"]} ,newButton:{ containers:["skin_td_new_button"]} ,tree:{ minWidth:"13.5rem",maxWidth:"84rem",containers:["skin_td_tree","skin_td_tree_app_sash"],resizeContainers:["skin_td_tree","skin_container_app_new_button"]} ,topToolbar:{ containers:"skin_spacing_app_top_toolbar"} ,treeFooter:{ containers:"skin_tr_tree_footer"} ,topAd:{ containers:"skin_tr_top_ad"} ,sidebarAd:{ containers:"skin_td_sidebar_ad"} ,bottomAd:{ containers:"skin_tr_bottom_ad"} ,treeTopAd:{ containers:"skin_tr_tree_top_ad"} ,treeBottomAd:{ containers:"skin_tr_tree_bottom_ad"} ,helpButton:{ style:"link",container:"quota",url:""} ,logoutButton:{ style:"link",container:"quota"} ,appChooser:{ position:"static",direction:"LR"} ,toast:{ location:"N",transitions:[{ type:"fade-in",step:5,duration:50} ,{ type:"pause",duration:5000} ,{ type:"fade-out",step:-10,duration:500} ]} ,fullScreen:{ containers:["!skin_td_tree","!skin_td_tree_app_sash"]} ,allAds:{ containers:["skin_tr_top_ad","skin_td_sidebar_ad","skin_tr_bottom_ad","skin_tr_tree_top_ad","skin_tr_tree_bottom_ad"]} ,hideSearchInCompose:true,notificationBanner:"/zimbra/skins/_base/logos/NotificationBanner_grey.gif?v=250210122141"}; window.BaseSkin=ZmSkin; ZmSkin.prototype={ show:function(t,e,l){ var a=this.hints[t]&&this.hints[t].containers; if(a){ if(typeof a=="function"){ a.apply(this,[e!=false]); skin._reflowApp(); return } if(typeof a=="string"){ a=[a] } var s=false; for(var r=0; r= 0) { check(rule.checkImg, rule.closeImg); } else { unCheck(rule.checkImg, rule.closeImg); } }) } function setloginButtonDisabled(condition) { if (condition) { loginButton.disabled = true; } else { if (oldPasswordInput.value !== "") { loginButton.disabled = false; } } } // Function to encode XML characters function escapeXml(xmlString) { return xmlString.replace(/[<>&'"]/g, function (char) { switch (char) { case '<': return '<'; case '>': return '>'; case '&': return '&'; case "'": return '''; case '"': return '"'; } }); } // Function to check special character function isAsciiPunc(ch) { return (ch >= 33 && ch <= 47) || // ! " # $ % & ' ( ) * + , - . / (ch >= 58 && ch <= 64) || // : ; < = > ? @ (ch >= 91 && ch <= 96) || // [ \ ] ^ _ ` (ch >= 123 && ch <= 126); // { | } ~ } function parseCharsFromPassword(passwordString) { const uppers = [], lowers = [], numbers = [], punctuations = [], invalidChars = [], invalidPuncs = []; const chars = passwordString.split(''); chars.forEach(function (char) { const charCode = char.charCodeAt(0); let isInvalid = false; if ("") { try { if (!char.match(new RegExp("", 'g'))) { invalidChars.push(char); isInvalid = true; } } catch (error) { console.error(error); } } if (!isInvalid) { if (charCode >= 65 && charCode <= 90) { uppers.push(char); } else if (charCode >= 97 && charCode <= 122) { lowers.push(char); } else if (charCode >= 48 && charCode <= 57) { numbers.push(char); } else if ("") { try { char.match(new RegExp("", 'g')) ? punctuations.push(char) : invalidPuncs.push(char); } catch (error) { console.error(error); } } else if (isAsciiPunc(charCode)) { punctuations.push(char); } } }); return { uppers: uppers, lowers: lowers, numbers: numbers, punctuations: punctuations, invalidChars: invalidChars, invalidPuncs: invalidPuncs }; }; function handleNewPasswordChange() { var currentValue = newPasswordInput.value; var encodedPwd = escapeXml(currentValue); var parsedChars = parseCharsFromPassword(currentValue); var matchedRule = []; if (0){ if (currentValue.length >= 0) { matchedRule.push({type : "zimbraPasswordMinLength"}); } } if (0) { if (parsedChars.uppers.length >= 0) { matchedRule.push({type : "zimbraPasswordMinUpperCaseChars"}); } } if (0) { if (parsedChars.lowers.length >= 0) { matchedRule.push({type : "zimbraPasswordMinLowerCaseChars"}); } } if (0) { if (parsedChars.numbers.length >= 0) { matchedRule.push({type : "zimbraPasswordMinNumericChars"}); } } if (0) { if (parsedChars.punctuations.length >= 0) { matchedRule.push({type : "zimbraPasswordMinPunctuationChars"}); } } if (0) { if (parsedChars.punctuations.length + parsedChars.numbers.length >= 0) { matchedRule.push({type : "zimbraPasswordMinDigitsOrPuncs"}); } } if (true) { if (!encodedPwd.includes("")) { matchedRule.push({type : "zimbraPasswordAllowUsername"}); } } if(matchedRule.length >= enabledRules.length){ allRulesMatched = true; } else { allRulesMatched = false; } compareMatchedRules(matchedRule); if (parsedChars.invalidChars.length > 0) { errorMessageDiv.style.display = "block"; errorMessageDiv.innerHTML = parsedChars.invalidChars.join(", ") + " "; } else { errorMessageDiv.style.display = "none"; } if(newPasswordInput.value !== "") { resetImg(confirmPasswordInput.value === newPasswordInput.value, getElement("mustMatchCheckImg"), getElement("mustMatchCloseImg")); setloginButtonDisabled(!allRulesMatched || confirmPasswordInput.value !== newPasswordInput.value); } }; function handleConfirmPasswordChange() { resetImg(confirmPasswordInput.value === newPasswordInput.value, getElement("mustMatchCheckImg"), getElement("mustMatchCloseImg")); setloginButtonDisabled(!allRulesMatched || confirmPasswordInput.value !== newPasswordInput.value); }; function handleOldPasswordChange() { setloginButtonDisabled(!allRulesMatched || newPasswordInput.value === "" || oldPasswordInput.value === "" || confirmPasswordInput.value !== newPasswordInput.value) } newPasswordInput && oldPasswordInput && oldPasswordInput.addEventListener("input", handleOldPasswordChange, null); newPasswordInput && newPasswordInput.addEventListener("input", handleNewPasswordChange, null); confirmPasswordInput && confirmPasswordInput.addEventListener("input", handleConfirmPasswordChange, null);