/* This Javascript object is used to check to see if a user has entered there correct Domino credientialsRequires: Prototype.js being availableAssociated with: A login form - HTML ID loginFormThe code is formatted in the JSON format for object reuseThis code could break if the standard error message returned by Domino (session based authentication) changes in the future*/var loginObj={//Main functionlogin : function(){//Display busy animation//Element.show('processing');//Get the field valuesusername = $F("Username");password = $F('Password');if(username=="" || password==""){this.resetLogin();return false;}//Set the positng URL -the Names.nsf?login - uses a CGI Variable SERVER_NAMEvar hostname=location.hostname;var url = '/names.nsf?login';//Encode the parametersvar pars="Username="+encodeURIComponent(username)+"&Password="+encodeURIComponent(password)+"&Redirectto=/mail/"+$F("Username")+".nsf";//Build the AJAX request		var myAjax = new Ajax.Request(url, {method: 'post', parameters: pars, onComplete: this.processResponse.bindAsEventListener(this)});},processResponse: function(originalRequest){//Check response to see if the error message is in the stringtest=originalRequest.responseText.indexOf("\u7528\u6237\u540D\u6216\u5BC6\u7801\u4E0D\u6B63\u786E");if(test==-1){//\u5224\u65AD\u662F\u5426\u5728\u4E0D\u5141\u8BB8\u5217\u8868\u91CCif($('AllowList').innerText.indexOf(username)<0){alert('\u51CC\u5B87\u63D0\u9192\u4F60\uFF1A\u4F60\u65E0\u6743\u901A\u8FC7\u5916\u7F51\u8BBF\u95EE\u90AE\u7BB1\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u3002');this.resetLogin();return false;}//Not present so just reload the page as the user is logged in//location.replace("/mail/"+$F("Username")+".nsf");window.open("/mail/"+$F("Username")+".nsf");}else{//Got a login error so alert the user and reset the login formalert('\u51CC\u5B87\u63D0\u9192\u4F60\uFF1A\u7528\u6237\u540D/\u5BC6\u7801\u9519\u8BEF\uFF0C \u8BF7\u91CD\u65B0\u8F93\u5165\u3002');this.resetLogin();return false;}},resetLogin:function(){//Element.hide('processing');Form.reset('loginForm');Form.focusFirstElement('loginForm');}}