Home > Domino Tips > Developer > Domino > Set preferences on login page
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

DOMINO

Set preferences on login page


Erik Rydberg
07.22.2002
Rating: -4.09- (out of 5) Hall of fame tip of the month winner


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


I had just built a simple configuration page where an incoming mail-user could select between the ordinary green webmail and iNotes and switch over to secure traffic with SSL. The main function was that all users only should learn one URL instead of the full address to his or her mailfile so my form took care of that as well. Nothing fancy, nothing hard. Not even nice profile documents, the user should select this every time he or she logs in because of different connection-speed, public access and so on.

But select and login at the same page? Domino handles login (when session based authentication is enabled) in a database called domcfg.nsf. There is a form that you can change, $$LoginUserForm. This database has some interesting features. When a user enters an URL that leads to a database where anonymous has no access, the domino server displays the login form. The server takes the username and password and tries to find a person document in the domino directory. If the username and password are accepted the users is forwarded to the database. The address is not changed in the users browser in this process.

The problem How can I find the users mailfile before I know who he is? How can I pass the parameters?

My solution There is a field on the $$LoginUserForm called RedirectTo that holds the URL entered by the user. This is the key to my solution. I use a JavaScript function, see below, to capture the users selected options and then creates a URL with some parameters and writes the calculated URL to the RedirectTo field. The URL leads to my original configuration-database. In this database I capture the parameters, finds out who the user is and where the mailfile is located (could be on a different server) and creates a new URL and use the http"<meta http-equiv="refresh" content=0;URL=" + url + ">" entered in the HTML-Head Content to re-direct directly to the users mailfile with all the parameters, i.e. http/https and &ui=inotes/webmail.

If you do this, think of a way out for the user. In the above scenario every user that logs in is automatically re-directed to his/hers mailbox. Perhaps a user wants to access another database? My solution was to check what URL the user entered, is it a predefined address, like webmail.server.com, then the new URL is created and if it is another URL, like server.com/anotherdatabase.nsf, then domcfg.nsf should work as normal. You can always hide the extra options if the user is heading to another database to avoid confusion.

This is part of the code I have in JS header and the function is called in the onSubmit event.



Code

function createUrl() {
 var doc = document.forms[0];
 var url = location.href.toLowerCase() ;
 var pos = url.indexOf("://");
 url = url.substr(pos+3, url.length);
 
 //Checks to see if our mailURL is entered and sets some standard values
 
 if ( url == "webmail.server.com/") {
  var valdui = "webmail";   
  var protokoll = "http://";
  var krypterat = "no";
  
  //Picks the users choises from the form
  //ui iNotes or webmail
  ui = doc.fldUI;
  langd = ui.length;
  for (i=0; i<langd; i++){
       if (ui[i].checked) {
        valdui = ui[i].value;
       }
  }

  //SSL or not
  ssl = doc.fldSSL;
  if (ssl.checked){
   protokoll = "https://";
   krypterat = "yes";
  }
  //Builds the URL to the form that does the logic. 
  var url = protokoll + url + "mailspark.nsf/frmmailspark?openform&" + krypterat + "~" + valdui;
  }
  
  //The user entered another URL
  else {
    var url = location.href;
  }

  doc.RedirectTo.value = url;

}

Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
Domino
Mimic Lotus Notes Domino application functionality on the Web
A single form to view and edit any Lotus Notes document
DECS and DCR external data access considerations
How to create non-scrolling Lotus Domino view headers on the Web
Disabling the 'Submit' button on a form
An easier way to update a rich text field
Results from Default Notes Search have # of responses in brackets
Lotus Notes/Domino veteran offers comprehensive list of app dev tools
Notes to XML. . .and back again
Creating thumbnail images using LS2J in LotusScript

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 1999 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts