com.dynamide.security
Class Login

java.lang.Object
  extended by com.dynamide.DynamideObject
      extended by com.dynamide.db.SimpleDatasource
          extended by com.dynamide.security.Login
All Implemented Interfaces:
IDatasource, IDatasourceBasic, IGet

public class Login
extends SimpleDatasource


Nested Class Summary
 
Nested classes/interfaces inherited from class com.dynamide.db.SimpleDatasource
SimpleDatasource.SimpleDatasourceIterator
 
Field Summary
static java.lang.String ACTION_ADDUSER_ALLOWED
           
static java.lang.String ACTION_ADDUSER_DENIED
           
static java.lang.String ACTION_ADDUSER_PENDING
           
static java.lang.String ACTION_CHANGE_PASSWORD
           
static java.lang.String ACTION_CHANGE_USER
           
static java.lang.String ACTION_FORBIDDEN
           
static java.lang.String ACTION_FORBIDDEN_ADMIN
           
static java.lang.String ACTION_LOGIN
           
static java.lang.String ACTION_MISMATCH_PASSWORD
           
static java.lang.String ACTION_NEW_USER
           
static java.lang.String ACTION_NO_USER
           
static java.lang.String ACTION_NULL_PASSWORD
           
static java.lang.String ACTION_OK
           
static java.lang.String ACTION_SYSTEM_ERROR
           
static java.lang.String ACTION_USER_NOT_LOGGED_IN
           
static java.lang.String ACTION_WRONG_PASSWORD
           
static int ADDUSER_ALLOWED
           
static int ADDUSER_DENIED
           
static int ADDUSER_ERROR
           
static int ADDUSER_PENDING
           
protected  StringList m_propertiesTable
           
static int NO_USER
           
static int NULL_PASSWORD
           
static int OK
           
static int SYSTEM_ERROR
           
static int USER_NOT_LOGGED_IN
           
static int WRONG_PASSWORD
           
 
Fields inherited from class com.dynamide.DynamideObject
m_id
 
Fields inherited from interface com.dynamide.db.IDatasource
AFTER, BEFORE, BEFORE_FIRST, BEGIN, END, ROW_COUNT_NOT_ALLOWED, ROW_INDEX_UNKNOWN
 
Constructor Summary
Login(Session session, java.lang.String dbContextName, java.lang.String id)
           
 
Method Summary
 Field addField(java.lang.String fieldName, java.lang.Object value)
           
 int addUser()
           
 int allowUser(java.lang.String USER, java.lang.String newUSER)
           
 int changePassword()
           
 int changeUserProfile()
           
 int changeUserProfile(java.lang.String USER, java.lang.String familiarName, java.lang.String otherName, java.lang.String surname, java.lang.String eMail)
           
 void connect(java.lang.String dbContextName)
           
 java.lang.String crypt(java.lang.String passwd)
           
static java.lang.String crypt(java.lang.String passwd, boolean pad)
           
static java.lang.String errorCodeToString(int code)
           
 java.util.Enumeration getAuthorizedUserLogins()
           
 RDBDatabase getDatabase()
           
 boolean getDebugSQL()
           
 java.lang.String getLastError()
           
 java.lang.String getLogin()
           
 java.lang.String getLoginID()
           
 boolean getNoCrypt()
           
 java.util.Enumeration getPendingUserLogins()
           
 Property getProperty(java.lang.String propertyName)
          %% this is funky, since right now all are stored as String name and value. isEvent is just lost, for example.
 IPropertyProvider getPropertyProvider()
           
 java.lang.String getUserCookie(java.lang.String USER, java.lang.String cookieName)
           
 java.util.Enumeration getUserLogins()
           
 java.util.Map getUsers()
           
 boolean isAdmin(java.lang.String userID)
           
 void logAction(java.lang.String action, java.lang.String login)
           
 int login(java.lang.String USER, java.lang.String clearTextPassword)
           
 boolean loginExists(java.lang.String login)
           
 java.lang.String lookupUserID(java.lang.String login)
           
 int resetOtherUserPassword(java.lang.String otherUSER, java.lang.String newPassword)
           
 void setDatabase(RDBDatabase new_value)
           
 void setDebugSQL(boolean new_value)
           
 void setFieldError(java.lang.String fieldName, java.lang.String msg)
           
 void setLastError(int code)
           
 void setLastError(int code, java.lang.String msg)
           
 void setNoCrypt(boolean new_value)
           
 void setProperty(java.lang.String name, java.lang.String value)
          Rather than having a complicated interface to IDatasource, specialized behaviors can be set/retrieved using setProperty/getProperty, for example, "isMultiRowEditable".
 void setPropertyProvider(IPropertyProvider new_value)
           
 void setUserCookie(java.lang.String USER, java.lang.String cookieName, java.lang.String value)
           
 java.lang.String toString()
           
 boolean userLoggedIn()
           
 boolean userLoggedIn(java.lang.String USER)
           
 
Methods inherited from class com.dynamide.db.SimpleDatasource
addColumn, addField, addRow, cancel, clear, clearColumns, clearCurrentRow, clearRows, deleteRow, deleteRow, distanceToIndex, distanceToIndex, dump, dump, dumpErrorsHTML, dumpRow, dumpRow, dumpRow, fixCase, get, getCaseInsensitive, getCategoryID, getColumnNames, getColumnNamesList, getCurrentRow, getCurrentRowIndex, getDatasourceHelper, getField, getField, getFields, getID, getMetadataForColumn, getProperties, getRow, getRowCount, getSession, go, hasMore, insertRow, insertRow, isCurrentRow, isReadOnly, isRowCountAllowed, iterator, next, onRowChanged, post, reload, seek, seekBegin, seekEnd, setCaseInsensitive, setColumnNames, setCurrentRow, setFieldValue, setFieldValue, setReadOnly, setSession, updateCurrentRowPointers
 
Methods inherited from class com.dynamide.DynamideObject
clearProfiler, dump, dumpHTML, expand, finalize, findParentExpander, findParentPage, findParentSession, findTopParentPage, getDotName, getNextGetter, getObjectID, getOwner, getProfiler, isDebugEnabled, isInfoEnabled, logDebug, logDebug, logDebug, logDebug, logError, logError, logError, logError, logInfo, logInfo, logInfo, logInfo, logWarn, logWarn, logWarn, logWarn, popLogContext, printf, printProfiler, profileEnter, profileLeave, pushLogContext, setDotName, setID, setNextGetter, setObjectID, setOwner, sprintf, useProfiler, walkParents
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OK

public static final int OK
See Also:
Constant Field Values

NO_USER

public static final int NO_USER
See Also:
Constant Field Values

WRONG_PASSWORD

public static final int WRONG_PASSWORD
See Also:
Constant Field Values

NULL_PASSWORD

public static final int NULL_PASSWORD
See Also:
Constant Field Values

USER_NOT_LOGGED_IN

public static final int USER_NOT_LOGGED_IN
See Also:
Constant Field Values

SYSTEM_ERROR

public static final int SYSTEM_ERROR
See Also:
Constant Field Values

ADDUSER_ALLOWED

public static final int ADDUSER_ALLOWED
See Also:
Constant Field Values

ADDUSER_DENIED

public static final int ADDUSER_DENIED
See Also:
Constant Field Values

ADDUSER_PENDING

public static final int ADDUSER_PENDING
See Also:
Constant Field Values

ADDUSER_ERROR

public static final int ADDUSER_ERROR
See Also:
Constant Field Values

ACTION_OK

public static final java.lang.String ACTION_OK
See Also:
Constant Field Values

ACTION_LOGIN

public static final java.lang.String ACTION_LOGIN
See Also:
Constant Field Values

ACTION_NEW_USER

public static final java.lang.String ACTION_NEW_USER
See Also:
Constant Field Values

ACTION_SYSTEM_ERROR

public static final java.lang.String ACTION_SYSTEM_ERROR
See Also:
Constant Field Values

ACTION_WRONG_PASSWORD

public static final java.lang.String ACTION_WRONG_PASSWORD
See Also:
Constant Field Values

ACTION_NULL_PASSWORD

public static final java.lang.String ACTION_NULL_PASSWORD
See Also:
Constant Field Values

ACTION_MISMATCH_PASSWORD

public static final java.lang.String ACTION_MISMATCH_PASSWORD
See Also:
Constant Field Values

ACTION_NO_USER

public static final java.lang.String ACTION_NO_USER
See Also:
Constant Field Values

ACTION_USER_NOT_LOGGED_IN

public static final java.lang.String ACTION_USER_NOT_LOGGED_IN
See Also:
Constant Field Values

ACTION_CHANGE_USER

public static final java.lang.String ACTION_CHANGE_USER
See Also:
Constant Field Values

ACTION_CHANGE_PASSWORD

public static final java.lang.String ACTION_CHANGE_PASSWORD
See Also:
Constant Field Values

ACTION_FORBIDDEN

public static final java.lang.String ACTION_FORBIDDEN
See Also:
Constant Field Values

ACTION_FORBIDDEN_ADMIN

public static final java.lang.String ACTION_FORBIDDEN_ADMIN
See Also:
Constant Field Values

ACTION_ADDUSER_PENDING

public static final java.lang.String ACTION_ADDUSER_PENDING
See Also:
Constant Field Values

ACTION_ADDUSER_ALLOWED

public static final java.lang.String ACTION_ADDUSER_ALLOWED
See Also:
Constant Field Values

ACTION_ADDUSER_DENIED

public static final java.lang.String ACTION_ADDUSER_DENIED
See Also:
Constant Field Values

m_propertiesTable

protected StringList m_propertiesTable
Constructor Detail

Login

public Login(Session session,
             java.lang.String dbContextName,
             java.lang.String id)
Method Detail

connect

public void connect(java.lang.String dbContextName)

toString

public java.lang.String toString()
Overrides:
toString in class SimpleDatasource

errorCodeToString

public static final java.lang.String errorCodeToString(int code)

getLastError

public java.lang.String getLastError()

setLastError

public void setLastError(int code)

setLastError

public void setLastError(int code,
                         java.lang.String msg)

getDatabase

public RDBDatabase getDatabase()

setDatabase

public void setDatabase(RDBDatabase new_value)

getDebugSQL

public boolean getDebugSQL()

setDebugSQL

public void setDebugSQL(boolean new_value)

getNoCrypt

public boolean getNoCrypt()

setNoCrypt

public void setNoCrypt(boolean new_value)

getLoginID

public java.lang.String getLoginID()

getLogin

public java.lang.String getLogin()

getPropertyProvider

public IPropertyProvider getPropertyProvider()

setPropertyProvider

public void setPropertyProvider(IPropertyProvider new_value)

getProperty

public Property getProperty(java.lang.String propertyName)
Description copied from class: SimpleDatasource
%% this is funky, since right now all are stored as String name and value. isEvent is just lost, for example.

Specified by:
getProperty in interface IDatasource
Overrides:
getProperty in class SimpleDatasource
See Also:
IDatasource.get(String)

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
                 throws DatatypeException
Description copied from interface: IDatasource
Rather than having a complicated interface to IDatasource, specialized behaviors can be set/retrieved using setProperty/getProperty, for example, "isMultiRowEditable".

Specified by:
setProperty in interface IDatasource
Overrides:
setProperty in class SimpleDatasource
Throws:
DatatypeException

addField

public Field addField(java.lang.String fieldName,
                      java.lang.Object value)
               throws DatatypeException
Overrides:
addField in class SimpleDatasource
Throws:
DatatypeException

addUser

public int addUser()

allowUser

public int allowUser(java.lang.String USER,
                     java.lang.String newUSER)

changePassword

public int changePassword()
                   throws java.lang.Exception
Throws:
java.lang.Exception

changeUserProfile

public int changeUserProfile()

changeUserProfile

public int changeUserProfile(java.lang.String USER,
                             java.lang.String familiarName,
                             java.lang.String otherName,
                             java.lang.String surname,
                             java.lang.String eMail)

crypt

public java.lang.String crypt(java.lang.String passwd)

crypt

public static java.lang.String crypt(java.lang.String passwd,
                                     boolean pad)

getUserCookie

public java.lang.String getUserCookie(java.lang.String USER,
                                      java.lang.String cookieName)
                               throws java.sql.SQLException
Throws:
java.sql.SQLException
See Also:
setUserCookie(String,String,String)

setUserCookie

public void setUserCookie(java.lang.String USER,
                          java.lang.String cookieName,
                          java.lang.String value)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException
See Also:
getUserCookie(String,String)

getUserLogins

public java.util.Enumeration getUserLogins()
                                    throws java.lang.Exception
Throws:
java.lang.Exception

getPendingUserLogins

public java.util.Enumeration getPendingUserLogins()
                                           throws java.lang.Exception
Throws:
java.lang.Exception

getAuthorizedUserLogins

public java.util.Enumeration getAuthorizedUserLogins()
                                              throws java.lang.Exception
Throws:
java.lang.Exception

getUsers

public java.util.Map getUsers()
                       throws java.lang.Exception
Throws:
java.lang.Exception

isAdmin

public boolean isAdmin(java.lang.String userID)

logAction

public void logAction(java.lang.String action,
                      java.lang.String login)

login

public int login(java.lang.String USER,
                 java.lang.String clearTextPassword)

loginExists

public boolean loginExists(java.lang.String login)

lookupUserID

public java.lang.String lookupUserID(java.lang.String login)
                              throws java.lang.Exception
Throws:
java.lang.Exception

resetOtherUserPassword

public int resetOtherUserPassword(java.lang.String otherUSER,
                                  java.lang.String newPassword)

setFieldError

public void setFieldError(java.lang.String fieldName,
                          java.lang.String msg)
Overrides:
setFieldError in class SimpleDatasource

userLoggedIn

public boolean userLoggedIn()

userLoggedIn

public boolean userLoggedIn(java.lang.String USER)


Copyright 2001-2013 DYNAMIDE.COM. All Rights Reserved.