public class User extends Object
Modifier and Type | Field and Description |
---|---|
static int |
PERMS_ADMIN
This permissions flag is set if the user is an administrator.
|
static int |
PERMS_CONTROL
This permissions flag is set if the user can control outputs.
|
static int |
PERMS_DISABLED
This permissions flag is set if the user account is disabled.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
canControl()
Check for control access.
|
static boolean |
canControl(String username)
Check for control access.
|
static byte[] |
digestMD5(int userid,
String prefix,
String suffix)
Calculates the MD5 digest obtained by concatenating the user's password to
the 'prefix' and then concatenating the 'suffix'.
|
static byte[] |
digestSHA1(int userid,
String prefix,
String suffix)
Calculates the SHA1 digest obtained by concatenating the user's password to
the 'prefix' and then concatenating the 'suffix'.
|
static int |
getCurrentUID()
Query the current user.
|
static String |
getCurrentUserName()
Returns the name of the current user account.
|
static int |
getUserID(String username)
Retrieves the user account name for a specific ID.
|
static String |
getUserName(int id)
Retrieves the user account name for the specified ID.
|
static boolean |
isAdmin(int uid)
Determines if the given user ID has administrative rights.
|
static boolean |
isCurrentUserAdmin()
Indicates whether or not the current user has administrator privileges.
|
static boolean |
isDisabled(int uid)
Determines if the given user ID has been disabled.
|
static boolean |
isUser(String username)
Queries the existence of a user.
|
static int |
perms(String username)
Obtains the permissions byte for the specified user.
|
static int |
validate(String username,
String password)
Confirms access to a user account.
|
public static final int PERMS_ADMIN
public static final int PERMS_CONTROL
public static final int PERMS_DISABLED
public static int getCurrentUID()
public static String getCurrentUserName()
public static boolean isUser(String username)
username
- user's account (e.g. "jnior")public static int perms(String username)
username
- user's account (e.g. "jnior")public static int getUserID(String username)
username
- user's account name (e.g. "jnior")public static String getUserName(int id)
id
- account IDpublic static boolean isCurrentUserAdmin()
public static boolean isAdmin(int uid)
uid
- user ID for the querypublic static boolean isDisabled(int uid)
uid
- user ID for the querypublic static boolean canControl()
public static boolean canControl(String username)
username
- user's account namepublic static int validate(String username, String password)
username
- the user account name (e.g. "jnior")password
- the account passwordpublic static byte[] digestMD5(int userid, String prefix, String suffix)
userid
- the user's account IDprefix
- String prepended to the user's credentialssuffix
- String appended to the user's credentialspublic static byte[] digestSHA1(int userid, String prefix, String suffix)
userid
- the user's account IDprefix
- String prepended to the user's credentialssuffix
- String appended to the user's credentials