Packaged version 1.16
Packaged version 1.16

--- a/Resources/admin.min.js
+++ b/Resources/admin.min.js
@@ -11,3 +11,4 @@
 
 */
 function checkNewGroup(){var e=document.getElementById("frmName");if(e.value.length<=0){e.className+=" frmEntryMissed";return false}return true}function checkAddCredType(){var e=document.getElementById("frmName"),t=document.getElementById("ClickDiv").className.indexOf("EntropyGenerated");if(e.value.length<=0){e.className+=" frmEntryMissed";return false}if(t>=0){return true}alert("You must generate Entropy");return false}function validateUserAdd(){var e=0,t=document.getElementById("frmUsername"),n=document.getElementById("frmRName");if(t.value.length<=0){t.className="frmEntryMissed";e=1}if(n.value.length<=0){n.className="frmEntryMissed";e=1}if(!comparePwds()){e=1}if(e==1){alert("Please correct input errors and re-submit");return false}return true}function validateUserEdit(){var e=document.getElementById("frmUsername"),t=document.getElementById("frmRName"),n=document.getElementById("frmPass"),r=0;if(e.value.length<=0){e.className="frmEntryMissed";r=1}if(t.value.length<=0){t.className="frmEntryMissed";r=1}if(n.value.length>0){if(!comparePwds()){r=1}}if(r==1){alert("Please correct input errors and re-submit");return false}return true}function delGroup(e){var t,n,r,i,s=retKey(),o=document.getElementById("GroupDisp"+e),u=document.getElementById("NotificationArea");if(!confirm("Are you sure you want to delete this group (any credentials recorded against the group will be deleted)?")){return false}if(window.XMLHttpRequest){t=new XMLHttpRequest}else{t=new ActiveXObject("Microsoft.XMLHTTP")}t.onreadystatechange=function(){if(t.readyState==4&&t.status==200){n=decryptAPIResp(t.responseText,s).split(getDivider());if(n[1]==2){return unknownAPICommand()}if(n[1]==0||n[2]==0){u.innerHTML+='<div class="alert alert-error">Failed to Delete</div>';return false}o.parentNode.removeChild(o);u.innerHTML+='<div class="alert alert-success">Group Deleted</div>'}};i=cryptReq("delGroup",s);t.open("POST","api.php",true);t.setRequestHeader("Content-type","application/x-www-form-urlencoded");t.send("option="+i+"&id="+e)}function delUser(e){var t,n,r,i,s=retKey(),o=document.getElementById("User"+e),u=document.getElementById("NotificationArea");if(!confirm("Are you sure you want to delete this user?")){return false}if(window.XMLHttpRequest){t=new XMLHttpRequest}else{t=new ActiveXObject("Microsoft.XMLHTTP")}t.onreadystatechange=function(){if(t.readyState==4&&t.status==200){n=decryptAPIResp(t.responseText,s).split(getDivider());if(n[1]==2){return unknownAPICommand()}if(n[1]==0||n[2]==0){u.innerHTML+='<div class="alert alert-error">Failed to Delete</div>';return false}o.parentNode.removeChild(o);u.innerHTML+='<div class="alert alert-success">User Deleted</div>'}};i=cryptReq("delUser",s);t.open("POST","api.php",true);t.setRequestHeader("Content-type","application/x-www-form-urlencoded");t.send("option="+i+"&id="+e)}function delCredType(e){var t,n,r,i,s=retKey(),o=document.getElementById("CredType"+e),u=document.getElementById("NotificationArea");if(!confirm("Are you sure you want to delete this Credential Type (any associated credentials will be deleted)?")){return false}if(window.XMLHttpRequest){t=new XMLHttpRequest}else{t=new ActiveXObject("Microsoft.XMLHTTP")}t.onreadystatechange=function(){if(t.readyState==4&&t.status==200){n=decryptAPIResp(t.responseText,s).split(getDivider());if(n[1]==2){return unknownAPICommand()}if(n[1]==0||n[2]==0){u.innerHTML+='<div class="alert alert-error">Failed to Delete</div>';return false}o.parentNode.removeChild(o);u.innerHTML+='<div class="alert alert-success">Credential Type Deleted</div>'}};i=cryptReq("delCredType",s);t.open("POST","api.php",true);t.setRequestHeader("Content-type","application/x-www-form-urlencoded");t.send("option="+i+"&id="+e)}
+

--- a/Resources/main.min.js
+++ b/Resources/main.min.js
@@ -10,4 +10,5 @@
 Copyright (c) 2012 Ben Tasker
 
 */
-function genPwd(e,t){var n,r="",i="(=?)+.,abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(n=0;n<t;n++){r+=i.charAt(Math.floor(Math.random()*i.length))}if(e=="r"){return r}document.getElementById(e).value=r}function resizebkgrnd(){var width=document.documentElement.clientHeight,height=width,img;img=document.getElementById("ContentWrap");img.style.minHeight=eval(height*.8)+"px"}function CreateMenuContent(e,t,n,r,i,s){var o,u,a,f,l=0,e=document.getElementById(e),c=document.getElementById(n);if(!c){return false}for(var h=0;h<c.rows.length;h++){if(l==i){break}u=c.rows[h].cells[3].innerHTML;if(u==t){a=document.createElement("li");a.id=s+c.rows[h].cells[2].innerHTML;a.innerHTML="<a href='index.php?option="+c.rows[h].cells[5].innerHTML+"&id="+c.rows[h].cells[2].innerHTML+"'>"+c.rows[h].cells[r].innerHTML+"</a>";e.appendChild(a);l=l+1}}}function Credtimer(e){var t,n=document.getElementById("PassCount"+e),r=document.getElementById("retrievePassword"+e);t=n.value-1;n.value=t;if(t<=0||cancel==1){clearInterval(counter);if(document.getElementById("credHidden"+e)){r.innerHTML='Display<span class="DisPwdText"> Username</span>'}else{r.innerHTML='Display<span class="DisPwdText"> Password</span>'}document.getElementById("Address"+e).innerHTML="";document.getElementById("UserName"+e).innerHTML="";document.getElementById("Password"+e).innerHTML="";document.getElementById("CredPluginOutput"+e).innerHTML="";document.getElementById("clickCount"+e).value=0;return}r.innerHTML="Displaying for "+t+" seconds"}function noCredTypes(){$(document).ready(function(){var e;if(document.getElementById("AddCredBtnTop")){e=document.getElementById("AddCredBtnTop");e.parentNode.removeChild(e)}if(document.getElementById("AddCredBtnBottom")){e=document.getElementById("AddCredBtnBottom");e.parentNode.removeChild(e)}})}function loginReqProcess(){var e,t="",n=document.getElementById("FrmPassPlace"),r=document.getElementById("FrmPass");if(!enabledEncryption()){r.value=n.value;return true}r.value=Base64.encode(xorestr(n.value,retAuthKey()));for(e=0;e<n.length;e++){t+="a"}n.value=t;return true}function checkNewCust(){var e=document.getElementById("FrmName"),t=document.getElementById("frmGroup"),n=document.getElementById("FrmEmail");if(n.value.indexOf("@")==-1){n.className+=" frmEntryMissed";return false}if(t.options[t.selectedIndex].value=="null"){t.className+=" frmEntryMissed";return false}if(e.value==""){e.className+=" frmEntryMissed";return false}if(enabledEncryption()){var r=document.getElementById("FrmconName"),i=document.getElementById("FrmSurname");e.value=Base64.encode(xorestr(e.value,retKey()));n.value=Base64.encode(xorestr(n.value,retKey()));r.value=Base64.encode(xorestr(r.value,retKey()));i.value=Base64.encode(xorestr(i.value,retKey()))}return true}function checkNewCred(){var e=document.getElementById("frmCredential"),t=document.getElementById("frmUser"),n=document.getElementById("frmAddress"),r=document.getElementById("frmGroup"),i=document.getElementById("frmComment");if(r.options[r.selectedIndex].value=="null"){r.className+=" frmEntryMissed";return false}if(e.value.indexOf("http")!==-1){if(confirm("Click OK to make this credential a hyperlink in the database, click cancel to set not clicky")){document.getElementById("frmClicky").value=1}}if(enabledEncryption()){e.value=Base64.encode(xorestr(e.value,retKey()));t.value=Base64.encode(xorestr(t.value,retKey()));n.value=Base64.encode(xorestr(n.value,retKey()));i.value=Base64.encode(xorestr(i.value,retKey()))}return true}function checkEditCred(){var e=document.getElementById("frmCredential"),t=document.getElementById("frmUser"),n=document.getElementById("frmAddress"),r=document.getElementById("frmGroup"),i=document.getElementById("frmComment");if(r.options[r.selectedIndex].value=="null"){r.className+=" frmEntryMissed";return false}if(e.value.indexOf("http")!==-1){if(confirm("Click OK to make this credential a hyperlink in the database, click cancel to set not clicky")){document.getElementById("frmClicky").value=1}}if(e.value==null||e.value==""){e.value=" "}if(i.value==null||i.value==""){i.value=" "}if(t.value==null||t.value==""){t.value=" "}if(n.value==null||n.value==""){n.value=" "}if(enabledEncryption()){e.value=Base64.encode(xorestr(e.value,retKey()));t.value=Base64.encode(xorestr(t.value,retKey()));n.value=Base64.encode(xorestr(n.value,retKey()));i.value=Base64.encode(xorestr(i.value,retKey()))}return true}function checkChngPwds(){if(!comparePwds()){return false}if(!enabledEncryption()){return true}var e=document.getElementById("frmPass"),t=document.getElementById("frmPassConf");e.value=Base64.encode(xorestr(e.value,retKey()));t.value=Base64.encode(xorestr(t.value,retKey()));return true}function comparePwds(){var e,t,n,r=document.getElementById("frmPass"),i=document.getElementById("PassNoMatch"),s=document.getElementById("passScore"),o=document.getElementById("minpassStrength");if(o){e=o.value;if(e.indexOf("+")>=0){if(parseInt(passScore.value)>45){t=true}else{t=false}}else{n=e.split("-");if(parseInt(passScore.value)>n[0]){t=true}else{t=false}}if(!t){i.innerHTML="Password is too weak";i.style.display="inline-block";return false}}if(r.value!=document.getElementById("frmPassConf").value){i.innerHTML="Passwords don't match";i.style.display="inline-block";return false}if(r.value==null||r.value==""){document.getElementById("PassNoMatch").innerHTML="You must set a password";i.style.display="inline-block";return false}i.style.display="none";return true}function getCreds(e){var t,n,r,i,s,o,u=document.getElementById("retrievePassword"+e),a=document.getElementById("Address"+e),f=document.getElementById("UserName"+e),l=document.getElementById("Password"+e),c=document.getElementById("CredPluginOutput"+e),h=retKey(),p=document.getElementById("clickCount"+e);if(p.value!=0){return}p.value=1;u.innerHTML="<i>Retrieving.....</i>";if(window.XMLHttpRequest){t=new XMLHttpRequest}else{t=new ActiveXObject("Microsoft.XMLHTTP")}t.onreadystatechange=function(){if(t.readyState==4&&t.status==200){n=decryptAPIResp(t.responseText,h).split(getDivider());if(n[1]==2){return unknownAPICommand()}if(n[1]==0){u.innerHTML="Failed to retrieve credentials. Click to try again";return false}r=document.getElementById("defaultInterval").value;i=document.getElementById("PassCount"+e);i.value=r;s=r;a.innerHTML=n[3];l.innerHTML='<input class="passDisp" onclick="this.select();" type="text" value="'+n[2]+'" title="Click to select" name="null"/>';f.innerHTML=n[4];c.innerHTML=n[5];u.innerHTML="Displaying Password for "+s+" seconds";if(counter){cancel=1;document.getElementById("clickCount"+dispcred).value=0;dispcred=e;setTimeout(function(){cancel=false;counter=setInterval("Credtimer('"+e+"')",1e3)},1e3);return}dispcred=e;counter=setInterval("Credtimer('"+e+"')",1e3)}};o=cryptReq("retCred");t.open("POST","api.php",true);t.setRequestHeader("Content-type","application/x-www-form-urlencoded");t.send("option="+o+"&id="+e)}function checkSession(){var e,t,n,r,i=retKey();if(window.XMLHttpRequest){e=new XMLHttpRequest}else{e=new ActiveXObject("Microsoft.XMLHTTP")}e.onreadystatechange=function(){if(e.readyState==4&&e.status==200){t=e.responseText.split(getDivider());if(t[1]==2){return unknownAPICommand()}if(t[1]==0){removeCurrKey(0);n=document.cookie.split(";");for(var r=0;r<n.length;r++){KillCookie(n[r].split("=")[0])}window.location.href="index.php?notif=InvalidSession";return false}}};r=cryptReq("checkSess");e.open("POST","api.php",true);e.setRequestHeader("Content-type","application/x-www-form-urlencoded");e.send("option="+r+"&id="+Math.floor(Math.random()*100+1))}function DelCust(e){var t,n,r,i,s,o=retKey();if(!confirm("Are you sure you want to delete this customer and all associated credentials?")){return false}r=document.getElementById("CustDisp"+e);i=document.getElementById("NotificationArea");if(document.getElementById("Custmenu"+e)){var u=document.getElementById("Custmenu"+e)}if(window.XMLHttpRequest){t=new XMLHttpRequest}else{t=new ActiveXObject("Microsoft.XMLHTTP")}t.onreadystatechange=function(){if(t.readyState==4&&t.status==200){n=decryptAPIResp(t.responseText,o).split(getDivider());if(n[1]==2){return unknownAPICommand()}if(n[1]==0||n[2]==0){i.innerHTML+='<div class="alert alert-error">Failed to Delete</div>';return false}r.parentNode.removeChild(r);i.innerHTML+='<div class="alert alert-success">Customer and all associated credentials Deleted</div>';if(u){u.parentNode.removeChild(u)}}};s=cryptReq("delCust");t.open("POST","api.php",true);t.setRequestHeader("Content-type","application/x-www-form-urlencoded");t.send("option="+s+"&id="+e)}function DelCred(e){var t,n,r,i,s,o=retKey();if(!confirm("Are you sure you want to delete this credential?")){return false}r=document.getElementById("CredDisp"+e);i=document.getElementById("NotificationArea");if(window.XMLHttpRequest){t=new XMLHttpRequest}else{t=new ActiveXObject("Microsoft.XMLHTTP")}t.onreadystatechange=function(){if(t.readyState==4&&t.status==200){n=decryptAPIResp(t.responseText,o).split(getDivider());if(n[1]==2){return unknownAPICommand()}if(n[1]==0||n[2]==0){i.innerHTML+='<div class="alert alert-error">Failed to Delete</div>';return false}r.parentNode.removeChild(r);i.innerHTML+='<div class="alert alert-success">Credential Deleted</div>'}};s=cryptReq("delCred");t.open("POST","api.php",true);t.setRequestHeader("Content-type","application/x-www-form-urlencoded");t.send("option="+s+"&id="+e)}function positionResults(SearchBox,ResBox){var search=document.getElementById(SearchBox),res=document.getElementById(ResBox);res.style.left=search.offsetLeft+"px";res.style.top=eval(search.offsetTop+search.offsetHeight+6)+"px";res.style.width=search.offsetWidth+"px"}function SearchTable(e,t,n,r,i){var s,o,u,a,f=0,l,c,h,p,d=0;if(window.event){d=window.event.keyCode}else if(i.which){d=i.which}if(d===38){selectResult("up");return}if(d===40){selectResult("down");return}s=document.getElementById(n);s.innerHTML="";if(e.length<3){return}document.getElementById("SelectedValue").value=0;positionResults("SearchBox",n);o=e.toLowerCase();u=document.getElementById(t);for(p=0;p<u.rows.length;p++){c=u.rows[p].cells[r].innerHTML.replace(/<[^>]+>/g,"");if(c.toLowerCase().indexOf(o)>=0||o.indexOf(":")>=0&&u.rows[p].cells[1].innerHTML.toLowerCase().indexOf(o)>=0){f=f+1;a=document.createElement("div");a.id="SearchResult"+f;a.className="SearchResult";a.setAttribute("link",u.rows[p].cells[5].innerHTML);a.setAttribute("entID",u.rows[p].cells[2].innerHTML);if(u.rows[p].cells[4].innerHTML!=null&&u.rows[p].cells[4].innerHTML!=""){l=u.rows[p].cells[4].innerHTML}else{l="id"}if(u.rows[p].cells[6]){h=u.rows[p].cells[6].innerHTML.split("=");a.setAttribute("entid2",h[0]);a.setAttribute("entid2val",h[1]);h="&"+u.rows[p].cells[6].innerHTML}else{h=""}a.setAttribute("onclick","window.location.href = 'index.php?option="+u.rows[p].cells[5].innerHTML+"&"+l+"="+u.rows[p].cells[2].innerHTML+h+"';");a.setAttribute("frmName",l);a.innerHTML=u.rows[p].cells[1].innerHTML+" "+u.rows[p].cells[r].innerHTML;s.appendChild(a);s.style.display="block"}}}function selectResult(dir){var ind,SearchResult,SelIndex=document.getElementById("SelectedValue"),SearchLength=document.getElementById("SearchResBox").childNodes.length;if(dir=="down"){if(SelIndex.value!=0){document.getElementById("SearchResult"+parseInt(SelIndex.value)).className="SearchResult"}if(SearchLength==SelIndex.value){SelIndex.value=0}ind=eval(parseInt(SelIndex.value)+1)}else{document.getElementById("SearchResult"+parseInt(SelIndex.value)).className="SearchResult";if(SelIndex.value==1){ind=SearchLength}else{ind=eval(parseInt(SelIndex.value)-1)}}SearchResult=document.getElementById("SearchResult"+ind);SearchResult.className="SearchResult SearchResultActive";SelIndex.value=ind;document.getElementById("SrchOpt").value=SearchResult.getAttribute("link");document.getElementById("SrchID").name=SearchResult.getAttribute("frmName");document.getElementById("SrchID").value=SearchResult.getAttribute("entID");document.getElementById("SrchID2").name=SearchResult.getAttribute("entid2");document.getElementById("SrchID2").value=SearchResult.getAttribute("entid2val");document.getElementById("SearchBox").focus()}function hideSearchDiv(e){var t=document.getElementById(e);for(opacity=10;opacity>0;opacity--){t.style.opacity="0."+opacity}t.style.display="none";t.style.opacity="1"}function checkExistingSearch(e,t){if(e.length>3){document.getElementById(t).style.display="block"}}function setUpMenus(){jQuery(document).ready(function(){if(!document.getElementById("SearchListing")){return}var e,t;CreateMenuContent("TypeDropDownMenu",2,"SearchListing",0,100,"TypeMenu");CreateMenuContent("CustDropDownMenu",1,"SearchListing",0,5,"Custmenu");e=document.getElementById("CustDropDownMenu");t=document.createElement("li");t.className="divider";e.appendChild(t);t=document.createElement("li");t.className="viewAll";t.innerHTML="<a href='index.php?option=viewCustomers'>View All</a></li>";e.appendChild(t)})}function inlineDeCrypt(){var e,t=document.getElementsByClassName("inlineTLS");for(e=0;e<t.length;e++){t[e].innerHTML=decryptAPIResp(t[e].innerHTML,retKey())}}function xorestr(e,t){if(!enabledEncryption()){return e}var n,r,i="",s=0,o=t.split(":");for(var u=0;u<e.length;u++){n=e.charCodeAt(u);r=n^o[0].charCodeAt(s)^o[1].charCodeAt(s);i+=r.toString()+" ";s++;if(s>=t.length){s=0}}return i}function xordstr(e,t){if(!enabledEncryption()){return e}var n,r,i="",s=0,e=e.split(" "),o=t.split(":");for(var u=0;u<e.length;u++){if(e[u].length==0){continue}n=e[u];r=n^o[1].charCodeAt(s)^o[0].charCodeAt(s);i+=String.fromCharCode(r);s++;if(s>=t.length){s=0}}return i}function unknownAPICommand(){var e=document.getElementById("NotificationArea");clearInterval(sesscheck);e.innerHTML+="<div id='apiError' class='alert alert-error'>API Error Detected</div>";if(!enabledEncryption()){return}if(!confirm("The API reported an error, attempting to rectify. Click OK to try and rectify")){return}e.removeChild(document.getElementById("apiError"));e.innerHTML="<div id='apiError' class='alert alert-info'>Attempting to rectify API issue. Window will refresh when ready</div>";destroyKeys();removeCurrKey(1)}function removeCurrKey(e){var t,n=document.getElementById("kFile"),r=n.getAttribute("src"),i=n.parentNode;i.removeChild(n);t=document.createElement("iframe");t.setAttribute("id","kfile");t.setAttribute("src",r+"&forceload=y");t.style.width="0px";t.style.height="0px";t.style.border="0px";document.body.appendChild(t);interval=setInterval("reloadKeyf('"+r+"',"+e+")",500)}function reloadKeyf(e,t){var n,r,i;clearInterval(interval);n=document.getElementById("kfile");n.contentWindow.document.cookie="PHPCredLockerKeySet=0;";n.parentNode.removeChild(n);r=new Date;n=document.createElement("script");n.setAttribute("id","kFile");n.setAttribute("src",e+"&forceload=y"+"&rand="+r.getTime());document.getElementsByTagName("head")[0].appendChild(n);if(window.getKey!=""&&t==1){i=document.getElementById("apiError");i.parentNode.removeChild(i);sesscheck=setInterval("checkSession()",12e4)}}function decryptAPIResp(e,t){if(!enabledEncryption()){return e}return Base64.decode(xordstr(Base64.decode(e),t))}function getDivider(){if(typeof Storage!=="undefined"&&sessionStorage.Delimiter){return sessionStorage.getItem("Delimiter")}return getDelimiter()}function getTerms(e){if(typeof Storage!=="undefined"){if(!terms){terms=JSON.parse(sessionStorage.getItem("Terminology"))}return Base64.decode(terms[e.toString()])}return Base64.decode(getTerminology(e))}function cryptReq(e){var t,n=retKey(),r=getDivider();t=genPadding()+r+getTerms(e)+r+genPadding();if(!enabledEncryption()){return t}return encodeURIComponent(Base64.encode(xorestr(Base64.encode(t),n)))}function genPadding(){if(!enabledEncryption()){return"a"}var e,t,n="";t=Math.random().toString(10).substring(2,3);for(e=0;e<t;e++){n+=Math.random().toString(10).substring(Math.random().toString(10).substring(2,3))}return n}function retAuthKey(){return Base64.decode(getAuthKey())}function retKey(){return Base64.decode(getKey())}function checkKeyAvailable(){if(!getKey&&typeof getTLSKey!="function"){if(confirm("Key retrieval failed - Attempting to rectify, Click OK to continue - Screen may refresh")){var e,t=document.cookie.split(";");for(e=0;e<t.length;e++){KillCookie(t[e].split("=")[0])}removeCurrKey();if(typeof getTLSKey=="function"){alert("Keys retrieved successfully");return true}window.location.reload(true);return false}}return true}function getKey(){if(typeof Storage!=="undefined"&&sessionStorage.key){return sessionStorage.getItem("key")}else{if(typeof getTLSKey!="function"){return false}return getTLSKey()}}function enabledEncryption(){if(typeof Storage!=="undefined"&&sessionStorage.CryptEnabled){return sessionStorage.getItem("CryptEnabled")}else{if(typeof enabledTLSEncryption!="function"){return false}return enabledTLSEncryption()}}function KillCookie(e){createCookie(e,"",-1)}function createCookie(e,t,n){var r,i;if(n){i=new Date;i.setTime(i.getTime()+n*24*60*60*1e3);r="; expires="+i.toGMTString()}else r="";document.cookie=e+"="+t+r+"; path=/"}var counter=false,cancel="",dispcred,interval,terms
+function genPwd(e,t){var n,r="",i="(=?)+.,abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(n=0;n<t;n++){r+=i.charAt(Math.floor(Math.random()*i.length))}if(e=="r"){return r}document.getElementById(e).value=r}function resizebkgrnd(){var width=document.documentElement.clientHeight,height=width,img;img=document.getElementById("ContentWrap");img.style.minHeight=eval(height*.8)+"px"}function CreateMenuContent(e,t,n,r,i,s){var o,u,a,f,l=0,e=document.getElementById(e),c=document.getElementById(n);if(!c){return false}for(var h=0;h<c.rows.length;h++){if(l==i){break}u=c.rows[h].cells[3].innerHTML;if(u==t){a=document.createElement("li");a.id=s+c.rows[h].cells[2].innerHTML;a.innerHTML="<a href='index.php?option="+c.rows[h].cells[5].innerHTML+"&id="+c.rows[h].cells[2].innerHTML+"'>"+c.rows[h].cells[r].innerHTML+"</a>";e.appendChild(a);l=l+1}}}function Credtimer(e){var t,n=document.getElementById("PassCount"+e),r=document.getElementById("retrievePassword"+e);t=n.value-1;n.value=t;if(t<=0||cancel==1){clearInterval(counter);if(document.getElementById("credHidden"+e)){r.innerHTML='Display<span class="DisPwdText"> Username</span>'}else{r.innerHTML='Display<span class="DisPwdText"> Password</span>'}document.getElementById("Address"+e).innerHTML="";document.getElementById("UserName"+e).innerHTML="";document.getElementById("Password"+e).innerHTML="";document.getElementById("CredPluginOutput"+e).innerHTML="";document.getElementById("clickCount"+e).value=0;return}r.innerHTML="Displaying for "+t+" seconds"}function noCredTypes(){$(document).ready(function(){var e;if(document.getElementById("AddCredBtnTop")){e=document.getElementById("AddCredBtnTop");e.parentNode.removeChild(e)}if(document.getElementById("AddCredBtnBottom")){e=document.getElementById("AddCredBtnBottom");e.parentNode.removeChild(e)}})}function loginReqProcess(){var e,t="",n=document.getElementById("FrmPassPlace"),r=document.getElementById("FrmPass");if(!enabledEncryption()){r.value=n.value;return true}r.value=Base64.encode(xorestr(n.value,retAuthKey()));for(e=0;e<n.length;e++){t+="a"}n.value=t;return true}function checkNewCust(){var e=document.getElementById("FrmName"),t=document.getElementById("frmGroup"),n=document.getElementById("FrmEmail");if(n.value.indexOf("@")==-1){n.className+=" frmEntryMissed";return false}if(t.options[t.selectedIndex].value=="null"){t.className+=" frmEntryMissed";return false}if(e.value==""){e.className+=" frmEntryMissed";return false}if(enabledEncryption()){var r=document.getElementById("FrmconName"),i=document.getElementById("FrmSurname");e.value=Base64.encode(xorestr(e.value,retKey()));n.value=Base64.encode(xorestr(n.value,retKey()));r.value=Base64.encode(xorestr(r.value,retKey()));i.value=Base64.encode(xorestr(i.value,retKey()))}return true}function checkNewCred(){var e=document.getElementById("frmCredential"),t=document.getElementById("frmUser"),n=document.getElementById("frmAddress"),r=document.getElementById("frmGroup"),i=document.getElementById("frmComment");if(r.options[r.selectedIndex].value=="null"){r.className+=" frmEntryMissed";return false}if(e.value.indexOf("http")!==-1){if(confirm("Click OK to make this credential a hyperlink in the database, click cancel to set not clicky")){document.getElementById("frmClicky").value=1}}if(enabledEncryption()){e.value=Base64.encode(xorestr(e.value,retKey()));t.value=Base64.encode(xorestr(t.value,retKey()));n.value=Base64.encode(xorestr(n.value,retKey()));i.value=Base64.encode(xorestr(i.value,retKey()))}return true}function checkEditCred(){var e=document.getElementById("frmCredential"),t=document.getElementById("frmUser"),n=document.getElementById("frmAddress"),r=document.getElementById("frmGroup"),i=document.getElementById("frmComment");if(r.options[r.selectedIndex].value=="null"){r.className+=" frmEntryMissed";return false}if(e.value.indexOf("http")!==-1){if(confirm("Click OK to make this credential a hyperlink in the database, click cancel to set not clicky")){document.getElementById("frmClicky").value=1}}if(e.value==null||e.value==""){e.value=" "}if(i.value==null||i.value==""){i.value=" "}if(t.value==null||t.value==""){t.value=" "}if(n.value==null||n.value==""){n.value=" "}if(enabledEncryption()){e.value=Base64.encode(xorestr(e.value,retKey()));t.value=Base64.encode(xorestr(t.value,retKey()));n.value=Base64.encode(xorestr(n.value,retKey()));i.value=Base64.encode(xorestr(i.value,retKey()))}return true}function checkChngPwds(){if(!comparePwds()){return false}if(!enabledEncryption()){return true}var e=document.getElementById("frmPass"),t=document.getElementById("frmPassConf");e.value=Base64.encode(xorestr(e.value,retKey()));t.value=Base64.encode(xorestr(t.value,retKey()));return true}function comparePwds(){var e,t,n,r=document.getElementById("frmPass"),i=document.getElementById("PassNoMatch"),s=document.getElementById("passScore"),o=document.getElementById("minpassStrength");if(o){e=o.value;if(e.indexOf("+")>=0){if(parseInt(passScore.value)>45){t=true}else{t=false}}else{n=e.split("-");if(parseInt(passScore.value)>n[0]){t=true}else{t=false}}if(!t){i.innerHTML="Password is too weak";i.style.display="inline-block";return false}}if(r.value!=document.getElementById("frmPassConf").value){i.innerHTML="Passwords don't match";i.style.display="inline-block";return false}if(r.value==null||r.value==""){document.getElementById("PassNoMatch").innerHTML="You must set a password";i.style.display="inline-block";return false}i.style.display="none";return true}function getCreds(e){var t,n,r,i,s,o,u=document.getElementById("retrievePassword"+e),a=document.getElementById("Address"+e),f=document.getElementById("UserName"+e),l=document.getElementById("Password"+e),c=document.getElementById("CredPluginOutput"+e),h=retKey(),p=document.getElementById("clickCount"+e);if(p.value!=0){return}p.value=1;u.innerHTML="<i>Retrieving.....</i>";if(window.XMLHttpRequest){t=new XMLHttpRequest}else{t=new ActiveXObject("Microsoft.XMLHTTP")}t.onreadystatechange=function(){if(t.readyState==4&&t.status==200){n=decryptAPIResp(t.responseText,h).split(getDivider());if(n[1]==2){return unknownAPICommand()}if(n[1]==0){u.innerHTML="Failed to retrieve credentials. Click to try again";return false}r=document.getElementById("defaultInterval").value;i=document.getElementById("PassCount"+e);i.value=r;s=r;a.innerHTML=n[3];l.innerHTML='<input class="passDisp" onclick="this.select();" type="text" value="'+n[2]+'" title="Click to select" name="null"/>';f.innerHTML=n[4];c.innerHTML=n[5];u.innerHTML="Displaying Password for "+s+" seconds";if(counter){cancel=1;document.getElementById("clickCount"+dispcred).value=0;dispcred=e;setTimeout(function(){cancel=false;counter=setInterval("Credtimer('"+e+"')",1e3)},1e3);return}dispcred=e;counter=setInterval("Credtimer('"+e+"')",1e3)}};o=cryptReq("retCred");t.open("POST","api.php",true);t.setRequestHeader("Content-type","application/x-www-form-urlencoded");t.send("option="+o+"&id="+e)}function checkSession(){var e,t,n,r,i=retKey();if(window.XMLHttpRequest){e=new XMLHttpRequest}else{e=new ActiveXObject("Microsoft.XMLHTTP")}e.onreadystatechange=function(){if(e.readyState==4&&e.status==200){t=e.responseText.split(getDivider());if(t[1]==2){return unknownAPICommand()}if(t[1]==0){removeCurrKey(0);n=document.cookie.split(";");for(var r=0;r<n.length;r++){KillCookie(n[r].split("=")[0])}window.location.href="index.php?notif=InvalidSession";return false}}};r=cryptReq("checkSess");e.open("POST","api.php",true);e.setRequestHeader("Content-type","application/x-www-form-urlencoded");e.send("option="+r+"&id="+Math.floor(Math.random()*100+1))}function DelCust(e){var t,n,r,i,s,o=retKey();if(!confirm("Are you sure you want to delete this customer and all associated credentials?")){return false}r=document.getElementById("CustDisp"+e);i=document.getElementById("NotificationArea");if(document.getElementById("Custmenu"+e)){var u=document.getElementById("Custmenu"+e)}if(window.XMLHttpRequest){t=new XMLHttpRequest}else{t=new ActiveXObject("Microsoft.XMLHTTP")}t.onreadystatechange=function(){if(t.readyState==4&&t.status==200){n=decryptAPIResp(t.responseText,o).split(getDivider());if(n[1]==2){return unknownAPICommand()}if(n[1]==0||n[2]==0){i.innerHTML+='<div class="alert alert-error">Failed to Delete</div>';return false}r.parentNode.removeChild(r);i.innerHTML+='<div class="alert alert-success">Customer and all associated credentials Deleted</div>';if(u){u.parentNode.removeChild(u)}}};s=cryptReq("delCust");t.open("POST","api.php",true);t.setRequestHeader("Content-type","application/x-www-form-urlencoded");t.send("option="+s+"&id="+e)}function DelCred(e){var t,n,r,i,s,o=retKey();if(!confirm("Are you sure you want to delete this credential?")){return false}r=document.getElementById("CredDisp"+e);i=document.getElementById("NotificationArea");if(window.XMLHttpRequest){t=new XMLHttpRequest}else{t=new ActiveXObject("Microsoft.XMLHTTP")}t.onreadystatechange=function(){if(t.readyState==4&&t.status==200){n=decryptAPIResp(t.responseText,o).split(getDivider());if(n[1]==2){return unknownAPICommand()}if(n[1]==0||n[2]==0){i.innerHTML+='<div class="alert alert-error">Failed to Delete</div>';return false}r.parentNode.removeChild(r);i.innerHTML+='<div class="alert alert-success">Credential Deleted</div>'}};s=cryptReq("delCred");t.open("POST","api.php",true);t.setRequestHeader("Content-type","application/x-www-form-urlencoded");t.send("option="+s+"&id="+e)}function positionResults(SearchBox,ResBox){var search=document.getElementById(SearchBox),res=document.getElementById(ResBox);res.style.left=search.offsetLeft+"px";res.style.top=eval(search.offsetTop+search.offsetHeight+6)+"px";res.style.width=search.offsetWidth+"px"}function SearchTable(e,t,n,r,i){var s,o,u,a,f=0,l,c,h,p,d=0;if(window.event){d=window.event.keyCode}else if(i.which){d=i.which}if(d===38){selectResult("up");return}if(d===40){selectResult("down");return}s=document.getElementById(n);s.innerHTML="";if(e.length<3){return}document.getElementById("SelectedValue").value=0;positionResults("SearchBox",n);o=e.toLowerCase();u=document.getElementById(t);for(p=0;p<u.rows.length;p++){c=u.rows[p].cells[r].innerHTML.replace(/<[^>]+>/g,"");if(c.toLowerCase().indexOf(o)>=0||o.indexOf(":")>=0&&u.rows[p].cells[1].innerHTML.toLowerCase().indexOf(o)>=0){f=f+1;a=document.createElement("div");a.id="SearchResult"+f;a.className="SearchResult";a.setAttribute("link",u.rows[p].cells[5].innerHTML);a.setAttribute("entID",u.rows[p].cells[2].innerHTML);if(u.rows[p].cells[4].innerHTML!=null&&u.rows[p].cells[4].innerHTML!=""){l=u.rows[p].cells[4].innerHTML}else{l="id"}if(u.rows[p].cells[6]){h=u.rows[p].cells[6].innerHTML.split("=");a.setAttribute("entid2",h[0]);a.setAttribute("entid2val",h[1]);h="&"+u.rows[p].cells[6].innerHTML}else{h=""}a.setAttribute("onclick","window.location.href = 'index.php?option="+u.rows[p].cells[5].innerHTML+"&"+l+"="+u.rows[p].cells[2].innerHTML+h+"';");a.setAttribute("frmName",l);a.innerHTML=u.rows[p].cells[1].innerHTML+" "+u.rows[p].cells[r].innerHTML;s.appendChild(a);s.style.display="block"}}}function selectResult(dir){var ind,SearchResult,SelIndex=document.getElementById("SelectedValue"),SearchLength=document.getElementById("SearchResBox").childNodes.length;if(dir=="down"){if(SelIndex.value!=0){document.getElementById("SearchResult"+parseInt(SelIndex.value)).className="SearchResult"}if(SearchLength==SelIndex.value){SelIndex.value=0}ind=eval(parseInt(SelIndex.value)+1)}else{document.getElementById("SearchResult"+parseInt(SelIndex.value)).className="SearchResult";if(SelIndex.value==1){ind=SearchLength}else{ind=eval(parseInt(SelIndex.value)-1)}}SearchResult=document.getElementById("SearchResult"+ind);SearchResult.className="SearchResult SearchResultActive";SelIndex.value=ind;document.getElementById("SrchOpt").value=SearchResult.getAttribute("link");document.getElementById("SrchID").name=SearchResult.getAttribute("frmName");document.getElementById("SrchID").value=SearchResult.getAttribute("entID");document.getElementById("SrchID2").name=SearchResult.getAttribute("entid2");document.getElementById("SrchID2").value=SearchResult.getAttribute("entid2val");document.getElementById("SearchBox").focus()}function hideSearchDiv(e){var t=document.getElementById(e);for(opacity=10;opacity>0;opacity--){t.style.opacity="0."+opacity}t.style.display="none";t.style.opacity="1"}function checkExistingSearch(e,t){if(e.length>3){document.getElementById(t).style.display="block"}}function setUpMenus(){jQuery(document).ready(function(){if(!document.getElementById("SearchListing")){return}var e,t;CreateMenuContent("TypeDropDownMenu",2,"SearchListing",0,100,"TypeMenu");CreateMenuContent("CustDropDownMenu",1,"SearchListing",0,5,"Custmenu");e=document.getElementById("CustDropDownMenu");t=document.createElement("li");t.className="divider";e.appendChild(t);t=document.createElement("li");t.className="viewAll";t.innerHTML="<a href='index.php?option=viewCustomers'>View All</a></li>";e.appendChild(t)})}function inlineDeCrypt(){var e,t=document.getElementsByClassName("inlineTLS");for(e=0;e<t.length;e++){t[e].innerHTML=decryptAPIResp(t[e].innerHTML,retKey())}}function xorestr(e,t){if(!enabledEncryption()){return e}var n,r,i="",s=0,o=t.split(":");for(var u=0;u<e.length;u++){n=e.charCodeAt(u);r=n^o[0].charCodeAt(s)^o[1].charCodeAt(s);i+=r.toString()+" ";s++;if(s=t[0].length){s=0}}return i}function xordstr(e,t){if(!enabledEncryption()){return e}var n,r,i="",s=0,e=e.split(" "),o=t.split(":");for(var u=0;u<e.length;u++){if(e[u].length==0){continue}n=e[u];r=n^o[1].charCodeAt(s)^o[0].charCodeAt(s);i+=String.fromCharCode(r);s++;if(s=t[0].length){s=0}}return i}function unknownAPICommand(){var e=document.getElementById("NotificationArea");clearInterval(sesscheck);e.innerHTML+="<div id='apiError' class='alert alert-error'>API Error Detected</div>";if(!enabledEncryption()){return}if(!confirm("The API reported an error, attempting to rectify. Click OK to try and rectify")){return}e.removeChild(document.getElementById("apiError"));e.innerHTML="<div id='apiError' class='alert alert-info'>Attempting to rectify API issue. Window will refresh when ready</div>";destroyKeys();removeCurrKey(1)}function removeCurrKey(e){var t,n=document.getElementById("kFile"),r=n.getAttribute("src"),i=n.parentNode;i.removeChild(n);t=document.createElement("iframe");t.setAttribute("id","kfile");t.setAttribute("src",r+"&forceload=y");t.style.width="0px";t.style.height="0px";t.style.border="0px";document.body.appendChild(t);interval=setInterval("reloadKeyf('"+r+"',"+e+")",500)}function reloadKeyf(e,t){var n,r,i;clearInterval(interval);n=document.getElementById("kfile");n.contentWindow.document.cookie="PHPCredLockerKeySet=0;";n.parentNode.removeChild(n);r=new Date;n=document.createElement("script");n.setAttribute("id","kFile");n.setAttribute("src",e+"&forceload=y"+"&rand="+r.getTime());document.getElementsByTagName("head")[0].appendChild(n);if(window.getKey!=""&&t==1){i=document.getElementById("apiError");i.parentNode.removeChild(i);sesscheck=setInterval("checkSession()",12e4)}}function decryptAPIResp(e,t){if(!enabledEncryption()){return e}return Base64.decode(xordstr(Base64.decode(e),t))}function getDivider(){if(typeof Storage!=="undefined"&&sessionStorage.Delimiter){return sessionStorage.getItem("Delimiter")}return getDelimiter()}function getTerms(e){if(typeof Storage!=="undefined"){if(!terms){terms=JSON.parse(sessionStorage.getItem("Terminology"))}return Base64.decode(terms[e.toString()])}return Base64.decode(getTerminology(e))}function cryptReq(e){var t,n=retKey(),r=getDivider();t=genPadding()+r+getTerms(e)+r+genPadding();if(!enabledEncryption()){return t}return encodeURIComponent(Base64.encode(xorestr(Base64.encode(t),n)))}function genPadding(){if(!enabledEncryption()){return"a"}var e,t,n="";t=Math.random().toString(10).substring(2,3);for(e=0;e<t;e++){n+=Math.random().toString(10).substring(Math.random().toString(10).substring(2,3))}return n}function retAuthKey(){return Base64.decode(getAuthKey())}function retKey(){return Base64.decode(getKey())}function checkKeyAvailable(){if(!getKey&&typeof getTLSKey!="function"){if(confirm("Key retrieval failed - Attempting to rectify, Click OK to continue - Screen may refresh")){var e,t=document.cookie.split(";");for(e=0;e<t.length;e++){KillCookie(t[e].split("=")[0])}removeCurrKey();if(typeof getTLSKey=="function"){alert("Keys retrieved successfully");return true}window.location.reload(true);return false}}return true}function getKey(){if(typeof Storage!=="undefined"&&sessionStorage.key){return sessionStorage.getItem("key")}else{if(typeof getTLSKey!="function"){return false}return getTLSKey()}}function enabledEncryption(){if(typeof Storage!=="undefined"&&sessionStorage.CryptEnabled){return sessionStorage.getItem("CryptEnabled")}else{if(typeof enabledTLSEncryption!="function"){return false}return enabledTLSEncryption()}}function KillCookie(e){createCookie(e,"",-1)}function createCookie(e,t,n){var r,i;if(n){i=new Date;i.setTime(i.getTime()+n*24*60*60*1e3);r="; expires="+i.toGMTString()}else r="";document.cookie=e+"="+t+r+"; path=/"}var counter=false,cancel="",dispcred,interval,terms
+

--- a/lib/.version.php
+++ b/lib/.version.php
@@ -12,8 +12,9 @@
 
 
 
-$versionmaj = "1.15";
+$versionmaj = "1.16";
 $versionmin = "";
 $status = "";
 
 ?>
+