|
CWIS Developer Documentation
|
CWIS-specific user class. More...


Public Member Functions | |
| __construct ($UserInfo=NULL) | |
| Load user data from the given user info or from the session if available. More... | |
| Privileges (PrivilegeSet $NewValue=NULL) | |
| Get/set user privileges as a set. More... | |
| ResourceId () | |
| Get the ID of the user resource associated with the user. More... | |
| GetResource () | |
| Get the associated user resource for this user. More... | |
| HasPriv ($Privilege, $Privileges=NULL) | |
| Delete () | |
| Delete the user and its associated user resource. More... | |
| Get ($FieldName) | |
| Get a value from the specified field. More... | |
| Set ($FieldName, $NewValue) | |
| Set a value for the specified field. More... | |
Public Member Functions inherited from User | |
| User ($UserInfoOne=NULL, $UserInfoTwo=NULL) | |
| Status () | |
| StatusMessage ($StatusCode=NULL) | |
| 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 () | |
| IsNotLoggedIn () | |
| ChangePassword ($OldPassword, $NewPassword, $NewPasswordAgain) | |
| SetPassword ($NewPassword) | |
| 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 | EmailWrapper ($To, $Subject, $Message, $AdditionalHeaders) |
| Adapter method to bridge between AxisPHP User class and ScoutLib Email class. More... | |
| static | GetCustomUserFields () |
| Get all custom user fields. More... | |
| static | GetDefaultUserFields () |
| Get the default user fields. More... | |
Static Public Member Functions inherited from User | |
| 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 | IsValidUserName ($UserName) |
| static | IsValidPassword ($Password) |
| static | IsValidLookingEMailAddress ($EMail) |
| static | NormalizeEMailAddress ($EMailAddress) |
| static | NormalizeUserName ($UserName) |
| static | NormalizePassword ($Password) |
Protected Member Functions | |
| FetchAssociatedResource ($UserId) | |
| Fetch the associated user resource based off of a user ID. More... | |
| IsResourceObjectSet () | |
| Determine if the resource object for this object is set. More... | |
Protected Attributes | |
| $Resource | |
| The user resource associated with the user or NULL if the user isn't logged in. More... | |
Protected Attributes inherited from User | |
| $DB | |
| $UserId = NULL | |
| $Result | |
| $LoggedIn | |
Static Protected Attributes | |
| static | $MigratedUserFields |
| Fields that were previously part of the APUsers table that have been migrated to the Resources table as of CWIS 3.0.0. More... | |
CWIS-specific user class.
Definition at line 13 of file CWUser.php.
| CWUser::__construct | ( | $UserInfo = NULL | ) |
Load user data from the given user info or from the session if available.
| mixed | $UserInfo | A user ID or user name. (OPTIONAL) |
Definition at line 21 of file CWUser.php.
References $Resource, FetchAssociatedResource(), User\SetEmailFunction(), and U_OKAY.
| CWUser::Delete | ( | ) |
Delete the user and its associated user resource.
Methods should not be called on the object after calling this method.
Definition at line 220 of file CWUser.php.
References Resource\Delete(), and U_OKAY.
|
static |
Adapter method to bridge between AxisPHP User class and ScoutLib Email class.
| string | $To | To line for message. |
| string | $Subject | Subject line for message. |
| string | $Message | Body of message. |
| string | $AdditionalHeaders | Other message header lines, concatenated together into a string. |
Definition at line 127 of file CWUser.php.
References User\$Result.
|
protected |
Fetch the associated user resource based off of a user ID.
| int | $UserId | The user ID for the user associated with the esource. |
Definition at line 311 of file CWUser.php.
References User\$UserId, MetadataSchema\SCHEMAID_USER, U_ERROR, and U_NOSUCHUSER.
Referenced by __construct().

| CWUser::Get | ( | $FieldName | ) |
Get a value from the specified field.
| string | $FieldName | The name of the field to get. |
Definition at line 238 of file CWUser.php.
References Resource\Get(), and IsResourceObjectSet().
|
static |
Get all custom user fields.
Definition at line 165 of file CWUser.php.
References MetadataSchema\SCHEMAID_USER.
|
static |
Get the default user fields.
Definition at line 191 of file CWUser.php.
References MetadataSchema\SCHEMAID_USER.
| CWUser::GetResource | ( | ) |
Get the associated user resource for this user.
Definition at line 98 of file CWUser.php.
References IsResourceObjectSet().
| CWUser::HasPriv | ( | $Privilege, | |
$Privileges = NULL |
|||
| ) |
Definition at line 104 of file CWUser.php.
References Privileges().
|
protected |
Determine if the resource object for this object is set.
Definition at line 359 of file CWUser.php.
Referenced by Get(), GetResource(), ResourceId(), and Set().

| CWUser::Privileges | ( | PrivilegeSet | $NewValue = NULL | ) |
Get/set user privileges as a set.
| PrivilegeSet | $NewValue | New set of privileges. (OPTIONAL) |
Definition at line 57 of file CWUser.php.
References User\GetPrivList(), User\Id(), and User\SetPrivList().
Referenced by HasPriv().

| CWUser::ResourceId | ( | ) |
Get the ID of the user resource associated with the user.
Definition at line 88 of file CWUser.php.
References Resource\Id(), and IsResourceObjectSet().
| CWUser::Set | ( | $FieldName, | |
| $NewValue | |||
| ) |
Set a value for the specified field.
| string | $FieldName | The name of the field to set. |
| mixed | $NewValue | The value to which to set the field. |
Definition at line 264 of file CWUser.php.
References IsResourceObjectSet(), Resource\Set(), and U_OKAY.
|
staticprotected |
Fields that were previously part of the APUsers table that have been migrated to the Resources table as of CWIS 3.0.0.
Definition at line 301 of file CWUser.php.
|
protected |
The user resource associated with the user or NULL if the user isn't logged in.
Definition at line 295 of file CWUser.php.
Referenced by __construct().