UserManagement Module
I contain all business logic about the UserManagement.
I control both the UI as well as the data model for user management (registration, settings, administration) and the user login.
Item Index
Methods
Attributes
Methods
closeAdministrationBox
()
I close the user administration dialog (jQuery UI Dialog).
Returns:
closeLoginBox
()
I close the login box.
ensureAuthenticated
-
callback
-
callbackCancel
-
disallowCancel
Sometimes a routine should only execute, if we can ensure the user is logged in at this point.
I serve this purpose, by checking wether the user has already logged in, and if not provide him the chance to login (or even create an account first).
After the user has logged in I call the callback (the routine which shall execute only with a logged-in user).
If the user aborted the offer to login, an optional cancelCallback can be called.
isLoggedIn
-
callback
I check wether the user has logged in, and call the callback with a boolean to indicate this.
Parameters:
-
callback
Function
login
-
userData
I am called to update my local and gloabl state after the server has created a login session.
Parameters:
-
userData
Object
logout
()
I am called to close the login session and update my local and global state.
showAdministrationBox
()
I open the user administration dialog. The UI is a single DOM element, which is displayed via jQuery UI Dialog
showLoginBox
-
disallowCancel
I open the login box. The UI is a single DOM element
Parameters:
-
disallowCancel
Boolean
updateAdministration
()
private
I update the UI elements of the tab Administration
(WAS MOVED AT A WRONG PLACE)
updateSettings
()
private
I update the UI elements of the tab Settings
updateView
-
loginStatus
The UI of the UserManagement has to be updated, when the loginStatus changes.
I check wether the user is an admin or a normal user, and show and hide the respective tabs (Settings and Administration) accordingly.
Parameters:
-
loginStatus
Boolean