| java.lang.Object com.knowgate.acl.ACL
ACL | final public class ACL (Code) | | Top Level User Authentication and Access Control List Functions.
author: Sergio Montoro Ten version: 3.0 |
Constructor Summary | |
public | ACL() |
Method Summary | |
public static String | RC4EnDeCrypt(String sTxt) | public static String | RC4EnDeCrypt(String sTxt, String sKey) | public static short | autenticate(JDCConnection oConn, String sUserId, String sAuthStr, int iFlags) | public static short | autenticate(JDCConnection oConn, String sUserId, String sAuthStr, int iFlags, long lTimestamp, long lTimeout, String sPlainCaptcha, String sTimeCaptchaMD5) | public static String | encript(String sStr, int iFlags) | public static String | getErrorMessage(short iErrCode) | public static String | getLocalizedMaskName(int iACLMask, String sLanguage) | public static String | getRC4key() | public static String | getUserIdFromNick(JDCConnection oConn, String sNickName, int iDomain) | public static void | setRC4key(String sKey) |
ACCOUNT_CANCELLED | final public static short ACCOUNT_CANCELLED(Code) | | |
ACCOUNT_DEACTIVATED | final public static short ACCOUNT_DEACTIVATED(Code) | | |
CAPTCHA_MISMATCH | final public static short CAPTCHA_MISMATCH(Code) | | |
CAPTCHA_TIMEOUT | final public static short CAPTCHA_TIMEOUT(Code) | | |
DOMAIN_NOT_FOUND | final public static short DOMAIN_NOT_FOUND(Code) | | |
INTERNAL_ERROR | final public static short INTERNAL_ERROR(Code) | | |
INVALID_PASSWORD | final public static short INVALID_PASSWORD(Code) | | |
PASSWORD_EXPIRED | final public static short PASSWORD_EXPIRED(Code) | | |
PERMISSION_ADD | final public static int PERMISSION_ADD(Code) | | |
PERMISSION_DELETE | final public static int PERMISSION_DELETE(Code) | | |
PERMISSION_FULL_CONTROL | final public static int PERMISSION_FULL_CONTROL(Code) | | |
PERMISSION_GRANT | final public static int PERMISSION_GRANT(Code) | | |
PERMISSION_LIST | final public static int PERMISSION_LIST(Code) | | |
PERMISSION_MODERATE | final public static int PERMISSION_MODERATE(Code) | | |
PERMISSION_MODIFY | final public static int PERMISSION_MODIFY(Code) | | |
PERMISSION_READ | final public static int PERMISSION_READ(Code) | | |
PERMISSION_SEND | final public static int PERMISSION_SEND(Code) | | |
PWD_CLEAR_TEXT | final public static int PWD_CLEAR_TEXT(Code) | | |
PWD_DTIP_RC4 | final public static int PWD_DTIP_RC4(Code) | | |
ROLE_ADMIN | final public static int ROLE_ADMIN(Code) | | |
ROLE_GUEST | final public static int ROLE_GUEST(Code) | | |
ROLE_NONE | final public static int ROLE_NONE(Code) | | |
ROLE_POWERUSER | final public static int ROLE_POWERUSER(Code) | | |
ROLE_USER | final public static int ROLE_USER(Code) | | |
SESSION_EXPIRED | final public static short SESSION_EXPIRED(Code) | | |
USER_NOT_FOUND | final public static short USER_NOT_FOUND(Code) | | |
WORKAREA_NOT_FOUND | final public static short WORKAREA_NOT_FOUND(Code) | | |
WORKAREA_NOT_SET | final public static short WORKAREA_NOT_SET(Code) | | |
ACL | public ACL()(Code) | | Default Constructor
|
RC4EnDeCrypt | public static String RC4EnDeCrypt(String sTxt) throws NullPointerException(Code) | | Encrypt text using RC4 algorithm and a default encryption key
Parameters: sTxt - Text to be encrypted String Encrypted text throws: NullPointerException - if sTxt is null See Also: http://www.4guysfromrolla.com/webtech/010100-1.shtml |
RC4EnDeCrypt | public static String RC4EnDeCrypt(String sTxt, String sKey)(Code) | | Encrypt text using RC4 algorithm
Parameters: sTxt - Text to be encrypted Parameters: sKey - Encryption key See Also: http://www.4guysfromrolla.com/webtech/010100-1.shtml |
autenticate | public static short autenticate(JDCConnection oConn, String sUserId, String sAuthStr, int iFlags) throws SQLException, UnsupportedOperationException(Code) | | Checks whether or not password is valid for given user.
This method calls k_sp_autenticate stored procedure witch looks up tx_pwd field at k_users table and see if it is the same as sAuthStr parameter.
Parameters: oConn - Opened Database Connection Parameters: sUserId - User nickname Parameters: sAuthStr - Authentication String (password) Parameters: iFlags - Authentication String Flags- ACL.PWD_CLEAR_TEXT Authentication String is passed as clear text (no encryption)
- ACL.PWD_DTIP_RC4 Authentication String is given encrypted using RC4 algorithm
- ACL.USER_NOT_FOUND sUserId not found at gu_user field from k_users table
- ACL.INVALID_PASSWORD sAuthStr parameter does not match tx_pwd field from k_users for sUserId
- ACL.PASSWORD_EXPIRED Password has expired (dt_pwd_expires field value is before current date)
- ACL.ACCOUNT_DEACTIVATED User account as been deactivated (field bo_active from k_users table set to zero)
- ACL.ACCOUNT_CANCELLED User account as been cancelled (field dt_cancel from k_users table set to date before now)
- ACL.INTERNAL_ERROR Internal error while trying to autenticate user
throws: SQLException - throws: UnsupportedOperationException - If k_sp_autenticate stored procedure is not found |
autenticate | public static short autenticate(JDCConnection oConn, String sUserId, String sAuthStr, int iFlags, long lTimestamp, long lTimeout, String sPlainCaptcha, String sTimeCaptchaMD5) throws SQLException, UnsupportedOperationException(Code) | | Checks password and captcha for a given user
This method
Parameters: oConn - Opened Database Connection Parameters: sUserId - User nickname Parameters: sAuthStr - Authentication String (password) Parameters: iFlags - Authentication String Flags Parameters: lTimestamp - Timestamp (in miliseconds) when sPlainCaptcha was generated Parameters: lTimemout - Number of miliseconds after which sPlainCaptcha expires Parameters: sPlainCaptcha - Captcha plain text Parameters: sTimeCaptchaMD5 - Precomputed MD5 hash for String sPlainCaptcha+lTimestamp This method returns the same values as autenticate(JDCConnection,String,String,int) and also- ACL.CAPTCHA_MISMATCH The computed MD5 hash for sPlainCaptcha+lTimestamp does not match sTimeCaptchaMD5
- ACL.CAPTCHA_TIMEOUT lTimestamp+lTimeout is before current datetime
throws: SQLException - throws: UnsupportedOperationException - If k_sp_autenticate stored procedure is not found since: 2.2 |
getErrorMessage | public static String getErrorMessage(short iErrCode)(Code) | | |
getLocalizedMaskName | public static String getLocalizedMaskName(int iACLMask, String sLanguage) throws IllegalArgumentException(Code) | | Gets permissions mask descriptive name for given language
Parameters: iACLMask - Permissions Mask, any combination of ACL.PERMISSION_ constants Parameters: sLanguage - Language for localized string {"en", "es"} |
getRC4key | public static String getRC4key()(Code) | | Get RC4 default key for encryption
|
getUserIdFromNick | public static String getUserIdFromNick(JDCConnection oConn, String sNickName, int iDomain) throws SQLException(Code) | | Get user unique id given its nickname.
Calls k_get_user_from_nick stored procedure and gets gu_user field from tx_nickname field
Parameters: oConn - Database Connection Parameters: sNickName - User nickname (tx_nickname from k_users table) Parameters: iDomain - Domain Identifier (id_domain from k_users table) User Unique Identifier (gu_user from k_users table) throws: SQLException - |
setRC4key | public static void setRC4key(String sKey)(Code) | | Set RC4 default key for encryption
Parameters: sKey - |
|
|