Package org.compiere.util
Class WebUser
- java.lang.Object
-
- org.compiere.util.WebUser
-
public class WebUser extends Object
Web User Info. Assumes that Email is a direct match. UPDATE AD_User SET EMail=TRIM(EMail) WHERE Email<>TRIM(EMail)- Version:
- $Id$
- Author:
- Jorg Janke
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static WebUser
get(Properties ctx, int AD_User_ID)
Get user unconditional (from cache)static WebUser
get(Properties ctx, String email)
Get user unconditional from cachestatic WebUser
get(Properties ctx, String email, String password, boolean useCache)
Get userstatic WebUser
get(javax.servlet.http.HttpServletRequest request)
Get from requestint
getAD_Client_ID()
int
getAD_User_ID()
String
getAddress()
Get LocationString
getAddress2()
MBPBankAccount
getBankAccount()
Get BP Bank Account (or create it)MBPBankAccount
getBankAccount(boolean requery)
Get BP Bank Account (or create it)Timestamp
getBirthday()
int
getBpartnerID()
int
getC_BPartner_ID()
int
getC_BPartner_Location_ID()
Get BP Location IDint
getC_Country_ID()
int
getC_Region_ID()
String
getCity()
String
getCompany()
Get Company Nameint
getContactID()
String
getCountryID()
String
getCountryName()
String
getEmail()
Get EMail address.String
getEMailVerifyCode()
Get EMail Verification CodeString
getFax()
int
getM_PriceList_ID()
String
getName()
String
getPassword()
Get PasswordString
getPasswordMessage()
Set Password MessageString
getPhone()
String
getPhone2()
String
getPostal()
String
getRegionID()
String
getRegionName()
Get (additional) Region nameint
getSalesRep_ID()
String
getSaveErrorMessage()
Get Save Error MessageString
getSOCreditStatus()
Credit Status Clear Text.String
getTaxID()
String
getTitle()
boolean
hasBPAccess(String BPAccessType, Object[] params)
boolean
isCreditCritical()
Credit Status is Critical.boolean
isCreditStopHold()
Credit Status is Stop or Hold.boolean
isCustomer()
boolean
isEMailValid()
Return Email Validation.boolean
isEMailVerified()
Return Email Verification (reply).boolean
isEmployee()
boolean
isLoggedIn()
Is User Logged inboolean
isPasswordOK()
Is Password OKboolean
isSalesRep()
boolean
isValid()
Return Valid.boolean
isVendor()
boolean
login(String password)
Log in with passwordvoid
logout()
Log in with oasswordboolean
save()
Save BPartner Objectsvoid
setAddress(String address)
void
setAddress2(String address2)
void
setBirthday(Timestamp birthday)
void
setC_BP_Group_ID(int C_BP_Group_ID)
void
setC_BP_Group_ID(String C_BP_Group_ID)
void
setC_Country_ID(int C_Country_ID)
void
setC_Country_ID(String C_Country_ID)
void
setC_Region_ID(int C_Region_ID)
void
setC_Region_ID(String C_Region_ID)
void
setCity(String city)
void
setCompany(String company)
void
setCountryName(String country)
void
setEmail(String email)
void
setEMailVerifyCode(String code, String info)
Check and Set EMail Validation Code.void
setFax(String fax)
void
setIsCustomer(boolean isCustomer)
void
setName(String name)
void
setPassword()
Check and Save Passwordvoid
setPassword(String password)
Set Passwordvoid
setPasswordMessage(String passwordMessage)
Set Password Messagevoid
setPhone(String phone)
void
setPhone2(String phone2)
void
setPostal(String postal)
void
setRegionName(String region)
void
setSaveErrorMessage(String msg)
Set Save Error Messagevoid
setTaxID(String taxID)
void
setTitle(String title)
void
setValue(String value)
String
toString()
Info
-
-
-
Field Detail
-
NAME
public static final String NAME
Attribute Name - also in JSPs- See Also:
- Constant Field Values
-
-
Method Detail
-
get
public static WebUser get(javax.servlet.http.HttpServletRequest request)
Get from request- Parameters:
request
- request- Returns:
- web user if exists
-
get
public static WebUser get(Properties ctx, String email)
Get user unconditional from cache- Parameters:
ctx
- contextemail
- email- Returns:
- web user
-
get
public static WebUser get(Properties ctx, String email, String password, boolean useCache)
Get user- Parameters:
ctx
- contextemail
- emailpassword
- optional passworduseCache
- use cache- Returns:
- web user
-
get
public static WebUser get(Properties ctx, int AD_User_ID)
Get user unconditional (from cache)- Parameters:
ctx
- contextAD_User_ID
- BP Contact- Returns:
- web user
-
isValid
public boolean isValid()
Return Valid.- Returns:
- return true if found
-
isEMailValid
public boolean isEMailValid()
Return Email Validation.- Returns:
- return true if email is valid
-
isEMailVerified
public boolean isEMailVerified()
Return Email Verification (reply).- Returns:
- return true if reply received
-
save
public boolean save()
Save BPartner Objects- Returns:
- true if saved
-
setSaveErrorMessage
public void setSaveErrorMessage(String msg)
Set Save Error Message- Parameters:
msg
- message
-
getSaveErrorMessage
public String getSaveErrorMessage()
Get Save Error Message- Returns:
- message
-
getEmail
public String getEmail()
Get EMail address. used as jsp parameter- Returns:
- email address of contact
-
setEmail
public void setEmail(String email)
-
getName
public String getName()
-
setName
public void setName(String name)
-
setValue
public void setValue(String value)
-
getTitle
public String getTitle()
-
setTitle
public void setTitle(String title)
-
getPassword
public String getPassword()
Get Password- Returns:
- password
-
setPassword
public void setPassword()
Check and Save Password
-
setPassword
public void setPassword(String password)
Set Password- Parameters:
password
- new password
-
isPasswordOK
public boolean isPasswordOK()
Is Password OK- Returns:
- true if OK
-
getPasswordMessage
public String getPasswordMessage()
Set Password Message- Returns:
- error message or null
-
setPasswordMessage
public void setPasswordMessage(String passwordMessage)
Set Password Message- Parameters:
passwordMessage
- message
-
login
public boolean login(String password)
Log in with password- Parameters:
password
- password- Returns:
- true if the user is logged in
-
logout
public void logout()
Log in with oassword
-
isLoggedIn
public boolean isLoggedIn()
Is User Logged in- Returns:
- is the user logged in
-
getPhone
public String getPhone()
-
setPhone
public void setPhone(String phone)
-
getPhone2
public String getPhone2()
-
setPhone2
public void setPhone2(String phone2)
-
getFax
public String getFax()
-
setFax
public void setFax(String fax)
-
getBirthday
public Timestamp getBirthday()
-
setBirthday
public void setBirthday(Timestamp birthday)
-
getTaxID
public String getTaxID()
-
setTaxID
public void setTaxID(String taxID)
-
getAD_Client_ID
public int getAD_Client_ID()
-
getAD_User_ID
public int getAD_User_ID()
-
getContactID
public int getContactID()
-
getCompany
public String getCompany()
Get Company Name- Returns:
- company name
-
setCompany
public void setCompany(String company)
-
getC_BPartner_ID
public int getC_BPartner_ID()
-
getBpartnerID
public int getBpartnerID()
-
getM_PriceList_ID
public int getM_PriceList_ID()
-
getC_BPartner_Location_ID
public int getC_BPartner_Location_ID()
Get BP Location ID- Returns:
- BP Loaction
-
getAddress
public String getAddress()
Get Location- Returns:
- location address
-
setAddress
public void setAddress(String address)
-
getAddress2
public String getAddress2()
-
setAddress2
public void setAddress2(String address2)
-
getCity
public String getCity()
-
setCity
public void setCity(String city)
-
getPostal
public String getPostal()
-
setPostal
public void setPostal(String postal)
-
getRegionName
public String getRegionName()
Get (additional) Region name- Returns:
- location region name
-
setRegionName
public void setRegionName(String region)
-
getC_Region_ID
public int getC_Region_ID()
-
getRegionID
public String getRegionID()
-
setC_Region_ID
public void setC_Region_ID(int C_Region_ID)
-
setC_Region_ID
public void setC_Region_ID(String C_Region_ID)
-
getCountryName
public String getCountryName()
-
setCountryName
public void setCountryName(String country)
-
getC_Country_ID
public int getC_Country_ID()
-
getCountryID
public String getCountryID()
-
setC_Country_ID
public void setC_Country_ID(int C_Country_ID)
-
setC_Country_ID
public void setC_Country_ID(String C_Country_ID)
-
setC_BP_Group_ID
public void setC_BP_Group_ID(int C_BP_Group_ID)
-
setC_BP_Group_ID
public void setC_BP_Group_ID(String C_BP_Group_ID)
-
isEmployee
public boolean isEmployee()
-
isSalesRep
public boolean isSalesRep()
-
isCustomer
public boolean isCustomer()
-
setIsCustomer
public void setIsCustomer(boolean isCustomer)
-
isVendor
public boolean isVendor()
-
getSalesRep_ID
public int getSalesRep_ID()
-
isCreditStopHold
public boolean isCreditStopHold()
Credit Status is Stop or Hold. Used in Asset download- Returns:
- true if Stop/Hold
-
isCreditCritical
public boolean isCreditCritical()
Credit Status is Critical. Used in Web UI- Returns:
- true if Stop/Hold/Watch
-
getSOCreditStatus
public String getSOCreditStatus()
Credit Status Clear Text. Used in Web UI- Returns:
- Clear Text Credit Status
-
getBankAccount
public MBPBankAccount getBankAccount()
Get BP Bank Account (or create it)- Returns:
- Bank Account
-
getBankAccount
public MBPBankAccount getBankAccount(boolean requery)
Get BP Bank Account (or create it)- Parameters:
requery
- Requery data- Returns:
- Bank Account
-
getEMailVerifyCode
public String getEMailVerifyCode()
Get EMail Verification Code- Returns:
- verification code
-
-