Jump to: navigation, search

Adding the login form (without OTP) to the custom home page

  • 1. Place the following div element in the page.
<div id="#loginform"></div>
  • 2. Add the following css to the head section of the page (if they are not already present)
 <link rel="stylesheet" href="/dev/css/mailclient.css" type="text/css"/>
 <link rel="stylesheet" href="/dev/css/loginForm.css" type="text/css"/>
 <link rel="stylesheet" href="/dev/css/validationEngine.jquery.css" type="text/css"/>


  • 3. Add the following js to the bottom of the page, just before the </body> tag (if not already present).
 <SCRIPT language=JavaScript src="/dev/js/loginUtil.js"></SCRIPT>
 <SCRIPT LANGUAGE="JavaScript" SRC="/dev/js/jquery.validationEngine-en.js"></SCRIPT>
 <SCRIPT LANGUAGE="JavaScript" SRC="/dev/js/jquery.validationEngine.js"></SCRIPT>
 <SCRIPT LANGUAGE="JavaScript" SRC="/dev/js/underscore/underscore.js"></SCRIPT>
 <SCRIPT LANGUAGE="JavaScript" SRC="/dev/js/otp.js"></SCRIPT>
 <SCRIPT LANGUAGE="JavaScript" SRC="/dev/js/utils.js"></SCRIPT>
 <SCRIPT LANGUAGE="JavaScript" SRC="/dev/js/loginSubmit.js"></SCRIPT>
 <SCRIPT LANGUAGE="JavaScript" SRC="/dev/js/validateValues.js"></SCRIPT>
 <SCRIPT LANGUAGE="JavaScript" SRC="/dev/js/signinSubmit.js"></SCRIPT>
 <SCRIPT LANGUAGE="JavaScript" SRC="/dev/js/CustomLink.js"></SCRIPT>
 <SCRIPT LANGUAGE="JavaScript" SRC="/dev/js/SupportInfo.js"></SCRIPT>
 <SCRIPT LANGUAGE="JavaScript" SRC="/dev/js/validateEnvirnment.js"></SCRIPT>
 <SCRIPT language=JavaScript src="/dev/js/Login.js"></SCRIPT>
 <script src="/dev/js/Placeholders.min.js" type="text/javascript" charset="utf-8"></script>
  • 4. Copy the login form template from
 /mithi/mcs/modules/mithi-mailclient/binconf/LoginFormTemplates/Template_DefaultLoginForm.html
 '''to (replacing <domain> with the domain name)'''
 /mithi/mcs/modules/mithi-mailclient/user/pl/webapp/webroot/Templates/<domain>/Template_DefaultLoginForm.html

  • 5. To initialize the login form add the following code to the bottom of the page just before the </body> tag.
Note: Replace <domain> with the domain name.
 <script>
 $(document).ready(function(){
 //load domain information
 fillDomainInfoBean();
 // render domain logo
 renderPageElements();
 var otpStatus = getPropertyValue('otpstatus');
 var browserName =  navigator.userAgent;
 // Default login form template
 var templateName = "/Templates/Login/Template_DefaultLoginForm.html";
 // OTP login form template if OTP is enabled for domain
 if(otpStatus == "Enabled")
 {
  templateName = "/Templates/Login/Template_DefaultOTPLoginForm.html";
 }
 jQuery.get(templateName ,function(loginformdata)
 {
  // Attach domain name to the name attribute of 'loginform' id.
  var dom = gup("domain");
  domain = dom;
  $("#loginform").attr("name",dom);
  // Attach read login form to the div loginform.  
  $("#loginform").html( loginformdata );
  initLoginPage();
  // Set domain data to the page.	
  initEnvironment();
 });
 // CUSTOM LINKS
 setCustomLinkOnLoginPage();
 // SUPPORT INFORMATION		
 //setSupportInfo();
 });
 </script>