CWIS Developer Documentation
|
Public Member Functions | |
__construct ($UserInfoOne=NULL, $UserInfoTwo=NULL) | |
Status () | |
StatusMessage () | |
Delete () | |
Id () | |
Name () | |
GetBestName () | |
Get the best available name associated with a user, i.e., the real name or, if it isn't available, the user name. More... | |
LastLocation ($NewLocation=NULL) | |
LastActiveDate () | |
LastIPAddress () | |
Get ($FieldName) | |
GetDate ($FieldName, $Format="") | |
Set ($FieldName, $NewValue) | |
Login ($UserName, $Password, $IgnorePassword=FALSE) | |
Logout () | |
GetPasswordSalt ($UserName) | |
IsLoggedIn () | |
Report whether user is currently logged in. More... | |
IsNotLoggedIn () | |
Report whether user is not currently logged in. More... | |
IsAnonymous () | |
Report whether user is anonymous user. More... | |
ChangePassword ($OldPassword, $NewPassword, $NewPasswordAgain) | |
Check provided password and set a new one if it war correct. More... | |
SetPassword ($NewPassword) | |
SetEncryptedPassword ($NewEncryptedPassword) | |
CreateNewUserWithEMailedPassword ($UserName, $EMail, $EMailAgain, $TemplateFile="Axis--User--EMailTemplate.txt") | |
CreateNewUserAndMailPasswordFromFile ($UserName, $EMail, $EMailAgain, $TemplateFile="Axis--User--EMailTemplate.txt") | |
CreateNewUserAndMailPassword ($UserName, $EMail, $EMailAgain, $EMailSubject, $EMailBody) | |
GetActivationCode () | |
IsActivationCodeGood ($Code) | |
IsActivated ($NewValue=DB_NOVALUE) | |
GetResetCode () | |
IsResetCodeGood ($Code) | |
GetMailChangeCode () | |
IsMailChangeCodeGood ($Code) | |
SendEMail ($TemplateTextOrFileName, $FromAddress=NULL, $MoreSubstitutions=NULL, $ToAddress=NULL) | |
HasPriv ($Privilege, $Privileges=NULL) | |
Check whether user has specified privilege(s). More... | |
GrantPriv ($Privilege) | |
RevokePriv ($Privilege) | |
GetPrivList () | |
SetPrivList ($NewPrivileges) | |
GetUniqueCode ($SeedString, $CodeLength) | |
GetRandomPassword ($PasswordMinLength=6, $PasswordMaxLength=8) | |
UpdateValue ($FieldName, $NewValue=DB_NOVALUE) | |
GivePriv ($Privilege) | |
Static Public Member Functions | |
static | GetStatusMessageForCode ($StatusCode) |
Get text error message for a specified error code. More... | |
static | SetEmailFunction ($NewValue) |
Set email function to use instead of mail(). More... | |
static | GetSqlQueryForUsersWithPriv ($Privilege, $Privileges=NULL) |
Get an SQL query that will return IDs of all users that have the specified privilege flags. More... | |
static | GetSqlQueryForUsersWithoutPriv ($Privilege, $Privileges=NULL) |
Get an SQL query that will return IDs of all users that do not have the specified privilege flags. More... | |
static | GetAnonymousUser () |
Get the anonymous user (i.e., the User object that exists when no user is logged in), useful when a permission check needs to know if something should be visible to the general public. More... | |
static | IsValidUserName ($UserName) |
static | IsValidPassword ($Password, $UserName, $Email) |
static | CheckPasswordForErrors ($Password, $UserName=NULL, $Email=NULL) |
Determine if a provided password complies with the configured rules, optionally checking that it does not contain a specified username or email. More... | |
static | IsValidLookingEMailAddress ($EMail) |
static | NormalizeEMailAddress ($EMailAddress) |
static | NormalizeUserName ($UserName) |
static | NormalizePassword ($Password) |
static | SetPasswordRules ($NewValue) |
Set password requirements. More... | |
static | SetPasswordMinLength ($NewValue) |
Set password minimum length. More... | |
static | SetPasswordMinUniqueChars ($NewValue) |
Set password minimum unique characters. More... | |
static | GetPasswordRulesDescription () |
Get a string describing the password rules. More... | |
Public Attributes | |
const | PW_REQUIRE_PUNCTUATION = 1 |
const | PW_REQUIRE_MIXEDCASE = 2 |
const | PW_REQUIRE_DIGITS = 4 |
Protected Attributes | |
$DB | |
$UserId = NULL | |
$Result | |
$LoggedIn | |
User::__construct | ( | $UserInfoOne = NULL , |
|
$UserInfoTwo = NULL |
|||
) |
Definition at line 57 of file User.php.
References U_NOSUCHUSER, and U_OKAY.
User::ChangePassword | ( | $OldPassword, | |
$NewPassword, | |||
$NewPasswordAgain | |||
) |
Check provided password and set a new one if it war correct.
string | $OldPassword | Current password. |
string | $NewPassword | Password to set. |
string | $NewPasswordAgain | Confirm new password. |
Definition at line 511 of file User.php.
References $Result, Get(), SetPassword(), U_BADPASSWORD, U_ILLEGALPASSWORD, U_NOTLOGGEDIN, U_OKAY, and U_PASSWORDSDONTMATCH.
|
static |
Determine if a provided password complies with the configured rules, optionally checking that it does not contain a specified username or email.
string | $Password | Password to check. |
string | $UserName | Username to check (OPTIONAL) |
string | Email to check (OPTIONAL) |
Definition at line 1114 of file User.php.
References U_EMPTYPASSWORD, U_PASSWORDCONTAINSEMAIL, U_PASSWORDCONTAINSUSERNAME, U_PASSWORDNEEDSDIGIT, U_PASSWORDNEEDSMIXEDCASE, U_PASSWORDNEEDSPUNCTUATION, U_PASSWORDTOOSHORT, and U_PASSWORDTOOSIMPLE.
User::CreateNewUserAndMailPassword | ( | $UserName, | |
$EMail, | |||
$EMailAgain, | |||
$EMailSubject, | |||
$EMailBody | |||
) |
Definition at line 593 of file User.php.
References $Result, GetRandomPassword(), IsValidLookingEMailAddress(), Set(), U_EMAILSDONTMATCH, U_ILLEGALEMAIL, U_MAILINGERROR, and U_OKAY.
Referenced by CreateNewUserAndMailPasswordFromFile().
User::CreateNewUserAndMailPasswordFromFile | ( | $UserName, | |
$EMail, | |||
$EMailAgain, | |||
$TemplateFile = "Axis--User--EMailTemplate.txt" |
|||
) |
Definition at line 580 of file User.php.
References CreateNewUserAndMailPassword().
Referenced by CreateNewUserWithEMailedPassword().
User::CreateNewUserWithEMailedPassword | ( | $UserName, | |
$EMail, | |||
$EMailAgain, | |||
$TemplateFile = "Axis--User--EMailTemplate.txt" |
|||
) |
Definition at line 572 of file User.php.
References CreateNewUserAndMailPasswordFromFile().
User::Get | ( | $FieldName | ) |
Definition at line 278 of file User.php.
References UpdateValue().
Referenced by ChangePassword(), GetBestName(), GetMailChangeCode(), GetUniqueCode(), LastActiveDate(), LastIPAddress(), LastLocation(), Name(), SendEMail(), and UserEditingUI\UpdateUserAttributes().
User::GetActivationCode | ( | ) |
Definition at line 664 of file User.php.
References GetUniqueCode().
Referenced by IsActivationCodeGood(), and SendEMail().
|
static |
Get the anonymous user (i.e., the User object that exists when no user is logged in), useful when a permission check needs to know if something should be visible to the general public.
Definition at line 1034 of file User.php.
References $Result.
Referenced by ResourceFactory\GetRecentlyReleasedResources(), ResourceFactory\GetReleasedResourceTotal(), and Classification\RecalcResourceCount().
User::GetBestName | ( | ) |
User::GetMailChangeCode | ( | ) |
Definition at line 700 of file User.php.
References Get(), and GetUniqueCode().
Referenced by IsMailChangeCodeGood(), and SendEMail().
|
static |
Get a string describing the password rules.
Definition at line 1272 of file User.php.
Referenced by UserEditingUI\GetRequestAccountForm().
User::GetRandomPassword | ( | $PasswordMinLength = 6 , |
|
$PasswordMaxLength = 8 |
|||
) |
Definition at line 1217 of file User.php.
Referenced by CreateNewUserAndMailPassword().
User::GetResetCode | ( | ) |
Definition at line 685 of file User.php.
References GetUniqueCode().
Referenced by IsResetCodeGood(), and SendEMail().
|
static |
Get an SQL query that will return IDs of all users that do not have the specified privilege flags.
This method is useful primarily for subqueries.
mixed | $Privilege | Privilege or array of privileges. |
mixed | $Privileges | One or more additional privileges. (variable length argument list) (OPTIONAL) |
|
static |
Get an SQL query that will return IDs of all users that have the specified privilege flags.
This method is useful primarily for subqueries.
mixed | $Privilege | Privilege or array of privileges. |
mixed | $Privileges | One or more additional privileges. (variable length argument list) (OPTIONAL) |
|
static |
Get text error message for a specified error code.
int | $StatusCode | One of the U_ constants. |
Definition at line 136 of file User.php.
References U_BADPASSWORD, U_DUPLICATEEMAIL, U_DUPLICATEUSERNAME, U_EMAILSDONTMATCH, U_EMPTYPASSWORD, U_ERROR, U_ILLEGALEMAIL, U_ILLEGALPASSWORD, U_ILLEGALUSERNAME, U_MAILINGERROR, U_NOSUCHUSER, U_NOTLOGGEDIN, U_OKAY, U_PASSWORDCONTAINSEMAIL, U_PASSWORDCONTAINSUSERNAME, U_PASSWORDNEEDSDIGIT, U_PASSWORDNEEDSMIXEDCASE, U_PASSWORDNEEDSPUNCTUATION, U_PASSWORDSDONTMATCH, U_PASSWORDTOOSHORT, U_PASSWORDTOOSIMPLE, and U_TEMPLATENOTFOUND.
Referenced by UserEditingUI\UserFormHasErrors().
User::GetUniqueCode | ( | $SeedString, | |
$CodeLength | |||
) |
Definition at line 1061 of file User.php.
References Get().
Referenced by GetActivationCode(), GetMailChangeCode(), and GetResetCode().
User::GivePriv | ( | $Privilege | ) |
Definition at line 1235 of file User.php.
References GrantPriv().
User::GrantPriv | ( | $Privilege | ) |
Definition at line 950 of file User.php.
References $Result, U_ERROR, U_NOTLOGGEDIN, and U_OKAY.
Referenced by GivePriv(), and SetPrivList().
User::HasPriv | ( | $Privilege, | |
$Privileges = NULL |
|||
) |
Check whether user has specified privilege(s).
mixed | $Privilege | Privilege or array of privileges. |
mixed | $Privileges | One or more additional privileges. (variable length argument list) (OPTIONAL) |
User::Id | ( | ) |
Definition at line 220 of file User.php.
References $UserId.
Referenced by UserEditingUI\UpdateUserAttributes().
User::IsActivated | ( | $NewValue = DB_NOVALUE | ) |
Definition at line 679 of file User.php.
References UpdateValue().
User::IsActivationCodeGood | ( | $Code | ) |
Definition at line 672 of file User.php.
References GetActivationCode().
User::IsAnonymous | ( | ) |
User::IsLoggedIn | ( | ) |
Report whether user is currently logged in.
Definition at line 469 of file User.php.
References $LoggedIn.
Referenced by IsNotLoggedIn(), and Logout().
User::IsMailChangeCodeGood | ( | $Code | ) |
Definition at line 708 of file User.php.
References GetMailChangeCode().
User::IsNotLoggedIn | ( | ) |
Report whether user is not currently logged in.
Definition at line 486 of file User.php.
References IsLoggedIn().
User::IsResetCodeGood | ( | $Code | ) |
Definition at line 693 of file User.php.
References GetResetCode().
|
static |
Definition at line 1185 of file User.php.
Referenced by CreateNewUserAndMailPassword().
|
static |
User::LastLocation | ( | $NewLocation = NULL | ) |
User::Login | ( | $UserName, | |
$Password, | |||
$IgnorePassword = FALSE |
|||
) |
Definition at line 323 of file User.php.
References $Result, $UserId, U_BADPASSWORD, U_NOSUCHUSER, U_NOTACTIVATED, and U_OKAY.
User::Logout | ( | ) |
Definition at line 410 of file User.php.
References IsLoggedIn().
|
static |
User::RevokePriv | ( | $Privilege | ) |
Definition at line 985 of file User.php.
References $Result, U_NOTLOGGEDIN, and U_OKAY.
User::SendEMail | ( | $TemplateTextOrFileName, | |
$FromAddress = NULL , |
|||
$MoreSubstitutions = NULL , |
|||
$ToAddress = NULL |
|||
) |
Definition at line 715 of file User.php.
References $Result, Get(), GetActivationCode(), GetMailChangeCode(), GetResetCode(), Status(), U_MAILINGERROR, U_OKAY, and U_TEMPLATENOTFOUND.
User::Set | ( | $FieldName, | |
$NewValue | |||
) |
Definition at line 310 of file User.php.
References $Result, U_NOTLOGGEDIN, U_OKAY, and UpdateValue().
Referenced by CreateNewUserAndMailPassword(), and UserEditingUI\UpdateUserAttributes().
|
static |
Set email function to use instead of mail().
callback | $NewValue | Callable email function or method that accepts the same arguments as mail(). |
Definition at line 210 of file User.php.
Referenced by CWUser\__construct().
User::SetEncryptedPassword | ( | $NewEncryptedPassword | ) |
Definition at line 566 of file User.php.
References UpdateValue().
User::SetPassword | ( | $NewPassword | ) |
Definition at line 556 of file User.php.
References UpdateValue().
Referenced by ChangePassword().
|
static |
|
static |
|
static |
User::SetPrivList | ( | $NewPrivileges | ) |
Definition at line 1011 of file User.php.
References GrantPriv(), and U_NOTLOGGEDIN.
User::Status | ( | ) |
Definition at line 120 of file User.php.
References $Result.
Referenced by SendEMail().
User::UpdateValue | ( | $FieldName, | |
$NewValue = DB_NOVALUE |
|||
) |
Definition at line 1228 of file User.php.
Referenced by Get(), IsActivated(), Set(), SetEncryptedPassword(), and SetPassword().
|
protected |
Definition at line 1074 of file User.php.
Referenced by SPTUser\GetCryptKey().
|
protected |
Definition at line 1077 of file User.php.
Referenced by IsLoggedIn().
|
protected |
Definition at line 1076 of file User.php.
Referenced by ChangePassword(), CreateNewUserAndMailPassword(), Delete(), CWUser\EmailWrapper(), GetAnonymousUser(), GetPasswordSalt(), GrantPriv(), Login(), RevokePriv(), SendEMail(), Set(), and Status().
|
protected |
Definition at line 1075 of file User.php.
Referenced by CWUser\FetchAssociatedResource(), Id(), and Login().