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


Public Member Functions | |
| __construct () | |
| Construct the user factory object. More... | |
| GetTopContributors ($Limit=5) | |
| Get a list of users sorted by how many resources they have added or edited, starting with those who have added/edited the most. More... | |
| GetMostRecentContributors ($Limit=5) | |
| Get the users sorted by when they last added or edited a resource starting with those who added/edited a resource most recently. More... | |
| FindUsersThatMeetRequirements ($Privset, $ResourceIds=array()) | |
| Find all users that meet the requirements for a specified privilege set. More... | |
| CreateNewUser ($UserName, $Password, $PasswordAgain, $EMail, $EMailAgain, $IgnoreErrorCodes=NULL) | |
| Create a new user. More... | |
Public Member Functions inherited from UserFactory | |
| __construct () | |
| Object constructor. More... | |
| CreateNewUser ($UserName, $Password, $PasswordAgain, $EMail, $EMailAgain, $IgnoreErrorCodes=NULL) | |
| Create new user. More... | |
| TestNewUserValues ($UserName, $Password, $PasswordAgain, $EMail, $EMailAgain) | |
| Test new user values (usually used before creating new user). More... | |
| GetUserCount ($Condition=NULL) | |
| Return number of users in the system. More... | |
| GetMatchingUserCount () | |
| Get total number of user that matched last GetMatchingUsers() call. More... | |
| GetUserIds () | |
| Get IDs for all users. More... | |
| GetLoggedInUsers ($InactivityTimeout=60) | |
| Get users who are currently logged in (i.e. More... | |
| GetRecentlyLoggedInUsers ($Since=NULL, $Limit=10) | |
| Get users recently logged in. More... | |
| GetUsersWithPrivileges () | |
| Return array of user names who have the specified privileges. More... | |
| FindUsers ($SearchString, $FieldName="UserName", $SortFieldName="UserName", $Offset=0, $Count=9999999) | |
| Get users who have values matching specified string in specified field. More... | |
| FindUserNames ($SearchString, $FieldName="UserName", $SortFieldName="UserName", $Offset=0, $Count=9999999, $IdExclusions=array(), $ValueExclusions=array()) | |
| Get users who have values matching specified string in specified field. More... | |
| GetMatchingUsers ($SearchString, $FieldName=NULL, $SortFieldName="UserName", $ResultsStartAt=0, $ReturnNumber=NULL) | |
| Return array of users who have values matching search string (in specific field if requested). More... | |
| UserExists ($UserId) | |
| Check whether user currently exists with specified ID. More... | |
| UserNameExists ($UserName) | |
| Check whether user name currently exists. More... | |
| EMailAddressIsInUse ($Address) | |
| Check whether e-mail address currently has account associated with it. More... | |
| GetNewestUsers ($Limit=5) | |
| Get the users sorted by when they signed up, starting with those who signed up most recently. More... | |
Static Public Member Functions | |
| static | GenerateUniqueUsernameFromEmail ($Email) |
| Derive a unique username from an email address. More... | |
| static | FilterNonViewableResourcesFromPerUserLists ($ResourcesPerUser) |
| Take a per-user list of resources and filter out the non-viewable ones. More... | |
Protected Attributes | |
| $ResourceFactory | |
| The resource factory for user resources. More... | |
Protected Attributes inherited from UserFactory | |
| $DB | |
| $SortFieldName | |
| $MatchingUserCount | |
CWIS-specific user factory class.
Definition at line 13 of file CWUserFactory.php.
| CWUserFactory::__construct | ( | ) |
Construct the user factory object.
Definition at line 20 of file CWUserFactory.php.
References MetadataSchema\SCHEMAID_USER.
| CWUserFactory::CreateNewUser | ( | $UserName, | |
| $Password, | |||
| $PasswordAgain, | |||
| $EMail, | |||
| $EMailAgain, | |||
$IgnoreErrorCodes = NULL |
|||
| ) |
Create a new user.
The second password and e-mail address parameters are intended for second copies of each entered by the user.
| string | $UserName | Login name for new user. |
| string | $Password | Password for new user. |
| string | $PasswordAgain | Second copy of password entered by user. |
| string | E-mail address for new user. | |
| string | $EMailAgain | Second copy of e-mail address entered by user. |
| bool | $IgnoreErrorCodes | Array containing any error codes that should be ignored. (OPTIONAL) |
Definition at line 273 of file CWUserFactory.php.
References Resource\Create(), MetadataSchema\MDFTYPE_TIMESTAMP, MetadataSchema\SCHEMAID_USER, U_OKAY, and MetadataField\UPDATEMETHOD_ONRECORDCREATE.
|
static |
Take a per-user list of resources and filter out the non-viewable ones.
| array | $ResourcesPerUser | Array keyed by UserId giving a list of ResourceIds. |
Definition at line 220 of file CWUserFactory.php.
References ResourceFactory\BuildMultiSchemaResourceList(), and ResourceFactory\FlattenMultiSchemaResourceList().
| CWUserFactory::FindUsersThatMeetRequirements | ( | $Privset, | |
$ResourceIds = array() |
|||
| ) |
Find all users that meet the requirements for a specified privilege set.
This is (currently) a very brute-force, inefficient implementation, so it should not be used anywhere long execution times might be an issue.
| PrivilegeSet | $Privset | Privilege Set giving the requirements to satisfy. |
| array | $ResourceIds | IDs of resources to use for comparisons, if the set includes resource-dependent conditions. (OPTIONAL) |
Definition at line 107 of file CWUserFactory.php.
References UserFactory\GetUserIds(), and UserFactory\GetUsersWithPrivileges().
|
static |
Derive a unique username from an email address.
| string | Source email address. |
Definition at line 186 of file CWUserFactory.php.
| CWUserFactory::GetMostRecentContributors | ( | $Limit = 5 | ) |
Get the users sorted by when they last added or edited a resource starting with those who added/edited a resource most recently.
| int | $Limit | The maximum number of users to return. (OPTIONAL, defaults to 5.) |
Definition at line 69 of file CWUserFactory.php.
| CWUserFactory::GetTopContributors | ( | $Limit = 5 | ) |
Get a list of users sorted by how many resources they have added or edited, starting with those who have added/edited the most.
| int | $Limit | The maximum number of users to return. (OPTIONAL, defaults to 5.) |
Definition at line 34 of file CWUserFactory.php.
|
protected |
The resource factory for user resources.
Definition at line 362 of file CWUserFactory.php.