org.olat.registration
Class RegistrationManager

java.lang.Object
  extended by org.olat.registration.RegistrationManager

public class RegistrationManager
extends java.lang.Object

Description:

Author:
Sabina Jeger

Field Summary
static java.lang.String EMAIL_CHANGE
           
 
Method Summary
 Identity createNewUserAndIdentityFromTemporaryKey(java.lang.String login, java.lang.String pwd, User myUser, TemporaryKeyImpl tk)
          creates a new user and identity with the data of the temporary key (email) and other supplied user data (within myUser)
 TemporaryKeyImpl createTemporaryKeyByEmail(java.lang.String email, java.lang.String ip, java.lang.String action)
          A temporary key is created
 void deleteTemporaryKey(TemporaryKeyImpl key)
          deletes a TemporaryKey
 void deleteTemporaryKeyWithId(java.lang.String keyValue)
          Delete a temporary key.
 java.util.List<Identity> getIdentitiesWithConfirmedDisclaimer()
          Get a list of all users that did already confirm the disclaimer
static RegistrationManager getInstance()
           
 java.util.List<TemporaryKey> loadTemporaryKeyByAction(java.lang.String action)
          returns an existing list of TemporaryKey by a given action or null if none found
 TemporaryKeyImpl loadTemporaryKeyByEmail(java.lang.String email)
          returns an existing TemporaryKey by a given email address or null if none found
 TemporaryKeyImpl loadTemporaryKeyByRegistrationKey(java.lang.String regkey)
          Looks for a TemporaryKey by a given registrationkey
 boolean needsToConfirmDisclaimer(Identity identity)
          Evaluates whether the given identity needs to accept a disclaimer before logging in or not.
 TemporaryKeyImpl register(java.lang.String emailaddress, java.lang.String ipaddress, java.lang.String action)
          Creates a TemporaryKey and saves it permanently
 void revokeAllconfirmedDisclaimers()
          Remove all disclaimer confirmations.
 void revokeConfirmedDisclaimer(Identity identity)
          Remove the disclaimer confirmation for the specified identity.
 void sendNewUserNotificationMessage(java.lang.String notificationMailAddress, Identity newIdentity)
          Send a notification messaged to the given notification email address about the registratoin of the given new identity.
 void setHasConfirmedDislaimer(Identity identity)
          Marks the given identity to have confirmed the disclaimer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMAIL_CHANGE

public static final java.lang.String EMAIL_CHANGE
See Also:
Constant Field Values
Method Detail

getInstance

public static RegistrationManager getInstance()
Returns:
Manager instance.

createNewUserAndIdentityFromTemporaryKey

public Identity createNewUserAndIdentityFromTemporaryKey(java.lang.String login,
                                                         java.lang.String pwd,
                                                         User myUser,
                                                         TemporaryKeyImpl tk)
creates a new user and identity with the data of the temporary key (email) and other supplied user data (within myUser)

Parameters:
login - Login name
pwd - Password
myUser - Not yet persisted user object
tk - Temporary key
Returns:
the newly created subject or null

sendNewUserNotificationMessage

public void sendNewUserNotificationMessage(java.lang.String notificationMailAddress,
                                           Identity newIdentity)
Send a notification messaged to the given notification email address about the registratoin of the given new identity.

Parameters:
notificationMailAddress - Email address who should be notified. MUST NOT BE NULL
newIdentity - The newly registered Identity

createTemporaryKeyByEmail

public TemporaryKeyImpl createTemporaryKeyByEmail(java.lang.String email,
                                                  java.lang.String ip,
                                                  java.lang.String action)
A temporary key is created

Parameters:
email - address of new user
ip - address of new user
action - REGISTRATION or PWCHANGE
Returns:
TemporaryKey

deleteTemporaryKey

public void deleteTemporaryKey(TemporaryKeyImpl key)
deletes a TemporaryKey

Parameters:
key - the temporary key to be deleted

loadTemporaryKeyByEmail

public TemporaryKeyImpl loadTemporaryKeyByEmail(java.lang.String email)
returns an existing TemporaryKey by a given email address or null if none found

Parameters:
email -
Returns:
the found temporary key or null if none is found

loadTemporaryKeyByAction

public java.util.List<TemporaryKey> loadTemporaryKeyByAction(java.lang.String action)
returns an existing list of TemporaryKey by a given action or null if none found

Parameters:
action -
Returns:
the found temporary key or null if none is found

loadTemporaryKeyByRegistrationKey

public TemporaryKeyImpl loadTemporaryKeyByRegistrationKey(java.lang.String regkey)
Looks for a TemporaryKey by a given registrationkey

Parameters:
regkey - the encrypted registrationkey
Returns:
the found TemporaryKey or null if none is found

register

public TemporaryKeyImpl register(java.lang.String emailaddress,
                                 java.lang.String ipaddress,
                                 java.lang.String action)
Creates a TemporaryKey and saves it permanently

Parameters:
emailaddress -
ipaddress -
action - REGISTRATION or PWCHANGE
Returns:
newly created temporary key

deleteTemporaryKeyWithId

public void deleteTemporaryKeyWithId(java.lang.String keyValue)
Delete a temporary key.

Parameters:
keyValue -

needsToConfirmDisclaimer

public boolean needsToConfirmDisclaimer(Identity identity)
Evaluates whether the given identity needs to accept a disclaimer before logging in or not.

Parameters:
identity -
Returns:
true: user must accept the disclaimer; false: user did already accept or must not accept a disclaimer

setHasConfirmedDislaimer

public void setHasConfirmedDislaimer(Identity identity)
Marks the given identity to have confirmed the disclaimer. Note that this method does not check if the disclaimer does already exist, do this by calling needsToConfirmDisclaimer() first!

Parameters:
identity -

revokeAllconfirmedDisclaimers

public void revokeAllconfirmedDisclaimers()
Remove all disclaimer confirmations. This means that every user on the system must accept the disclaimer again.


revokeConfirmedDisclaimer

public void revokeConfirmedDisclaimer(Identity identity)
Remove the disclaimer confirmation for the specified identity. This means that this user must accept the disclaimer again.

Parameters:
identity -

getIdentitiesWithConfirmedDisclaimer

public java.util.List<Identity> getIdentitiesWithConfirmedDisclaimer()
Get a list of all users that did already confirm the disclaimer

Returns: