<LoginSimple LoginSimple for dojo

LoginSimple is a dijit.Dialog extension for easy addition of a login prompt to a web site

It is currently written to go into the same directory as dojo, such as a /resources directory

The only reason I didn't submit this to dojox is because I didn't build in backend database support and went with a backend php script instead

Feel free to write in the correct backend support and submit it if you think that dojotoolkit.org would like this extension

 
 Simple login dialog: A Username and Password popup dialog
   Detect whether user is logged in at startup
   Detect whether user is logged in at regular intervals (loggedInTestInterval =  default 30000)
   If user is not logged in, then automatically pop up this dialog.
   Keep the last communication with session.php in this.session. This way, if you have session.php return other things such as session.fullName, you can retrieve it and show it on your screen.
   this.onChange(isLoggedIn) is fired whenever the status changes. If true then you are logged in else you are logged out.
   You can listen to this.onChange(isLoggedIn) and use it to blank the background screen when the user is logged out, or use it to update a displayed user name.
   this.value == true if you are logged in.
   This class blanks out the this.usr.attr("value") and this.password.attr("value") after a successful login as a security measure so don't bother to use these for anything once the dialog disappears
 Backend - session.php
   Backend must support session.php
   session.php must respond to an empty query with session="valid" or session=
   session.php should use a cookie to detect whether the login is still valid (And should update the cookie when user logs in)
   session.php?user=&password= should return either session="valid" or msg=
   If session!="valid" then msg will be displayed in red above the Username field.
   session.php can return other information such as fullName. If it does, the user can use this.session.fullName or whatever else was returned to display login information on the screen
   If you do use session.php to return other information. It should be returned whether session.php is called with or without arguments since this.session is updated everytime it talks to the backend.
 Obvious Recommendations:
   All other backend scripts should also call session.php (Or it's parent class) to test for valid logins.
   The aforementioned cookie should contain a [random non-sequential] session id, not the username/password








Last modified 02/01/2012
By Lee Lofgren