CWIS Developer Documentation
|
Public Member Functions | |
__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... | |
Protected Attributes | |
$DB | |
$SortFieldName | |
$MatchingUserCount | |
Definition at line 18 of file UserFactory.php.
UserFactory::__construct | ( | ) |
Object constructor.
Definition at line 26 of file UserFactory.php.
UserFactory::CreateNewUser | ( | $UserName, | |
$Password, | |||
$PasswordAgain, | |||
$EMail, | |||
$EMailAgain, | |||
$IgnoreErrorCodes = NULL |
|||
) |
Create 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 48 of file UserFactory.php.
References TestNewUserValues(), and U_OKAY.
UserFactory::EMailAddressIsInUse | ( | $Address | ) |
Check whether e-mail address currently has account associated with it.
string | $Address | Address to check. |
Definition at line 568 of file UserFactory.php.
Referenced by TestNewUserValues().
UserFactory::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.
string | $SearchString | String to match. |
string | $FieldName | Database column name to search. (OPTIONAL, defaults to "UserName") |
string | $SortFieldName | Database column name to sort results by. (OPTIONAL, defaults to "UserName") |
int | $Offset | Starting index for results. (OPTIONAL) |
int | $Count | Maximum number of results to return. (OPTIONAL) |
array | $IdExclusions | User IDs to exclude. (OPTIONAL) |
array | $ValueExclusions | User names to exclude. (OPTIONAL) |
Definition at line 382 of file UserFactory.php.
Referenced by FindUsers().
UserFactory::FindUsers | ( | $SearchString, | |
$FieldName = "UserName" , |
|||
$SortFieldName = "UserName" , |
|||
$Offset = 0 , |
|||
$Count = 9999999 |
|||
) |
Get users who have values matching specified string in specified field.
string | $SearchString | String to match. |
string | $FieldName | Database column name to search. (OPTIONAL, defaults to "UserName") |
string | $SortFieldName | Database column name to sort results by. (OPTIONAL, defaults to "UserName") |
int | $Offset | Starting index for results. (OPTIONAL) |
int | $Count | Maximum number of results to return. (OPTIONAL) |
Definition at line 350 of file UserFactory.php.
References $SortFieldName, and FindUserNames().
UserFactory::GetLoggedInUsers | ( | $InactivityTimeout = 60 | ) |
Get users who are currently logged in (i.e.
recently active and not logged out).
int | $InactivityTimeout | Number of minutes after which an inactive user is considered to be no longer logged in. (OPTIONAL, defaults to 60) |
Definition at line 226 of file UserFactory.php.
UserFactory::GetMatchingUserCount | ( | ) |
Get total number of user that matched last GetMatchingUsers() call.
Definition at line 205 of file UserFactory.php.
References $MatchingUserCount.
UserFactory::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).
(Search string respects POSIX-compatible regular expressions.) Optimization: $SearchString = ".*." and $FieldName = NULL will return all users ordered by $SortFieldName.
string | $SearchString | Search pattern. |
string | $FieldName | Database column name to search. (OPTIONAL) |
string | $SortFieldName | Database column name to sort results by. (OPTIONAL, defaults to "UserName") |
int | $ResultsStartAt | Starting index for results. (OPTIONAL) |
int | $ReturnNumber | Maximum number of results to return. (OPTIONAL) |
Definition at line 439 of file UserFactory.php.
References $SortFieldName.
UserFactory::GetNewestUsers | ( | $Limit = 5 | ) |
Get the users sorted by when they signed up, starting with those who signed up most recently.
By default, the number of users returned is five.
int | $Limit | The maximum number of users to return. |
Definition at line 589 of file UserFactory.php.
UserFactory::GetRecentlyLoggedInUsers | ( | $Since = NULL , |
|
$Limit = 10 |
|||
) |
Get users recently logged in.
string | $Since | Used to define "recently". (OPTIONAL, defaults to 24 hours) |
int | $Limit | Maximum number of users to return. |
Definition at line 254 of file UserFactory.php.
UserFactory::GetUserCount | ( | $Condition = NULL | ) |
Return number of users in the system.
string | $Condition | SQL condition (without "WHERE") to limit user count. (OPTIONAL) |
Definition at line 194 of file UserFactory.php.
UserFactory::GetUserIds | ( | ) |
Get IDs for all users.
Definition at line 214 of file UserFactory.php.
Referenced by CWUserFactory\FindUsersThatMeetRequirements().
UserFactory::GetUsersWithPrivileges | ( | ) |
Return array of user names who have the specified privileges.
Multiple privileges can be passed in as parameters (rather than in an array), if desired.
Definition at line 291 of file UserFactory.php.
Referenced by CWUserFactory\FindUsersThatMeetRequirements().
UserFactory::TestNewUserValues | ( | $UserName, | |
$Password, | |||
$PasswordAgain, | |||
$EMail, | |||
$EMailAgain | |||
) |
Test new user values (usually used before creating new user).
string | $UserName | User name entered. |
string | $Password | Password entered. |
string | $PasswordAgain | Second copy of password entered. |
string | Email entered. | |
string | $EMailAgain | Second copy of email entered. |
Definition at line 96 of file UserFactory.php.
References EMailAddressIsInUse(), U_DUPLICATEEMAIL, U_DUPLICATEUSERNAME, U_EMAILSDONTMATCH, U_EMPTYEMAIL, U_EMPTYEMAILAGAIN, U_EMPTYPASSWORDAGAIN, U_EMPTYUSERNAME, U_ILLEGALEMAIL, U_ILLEGALEMAILAGAIN, U_ILLEGALUSERNAME, U_PASSWORDSDONTMATCH, and UserNameExists().
Referenced by CreateNewUser().
UserFactory::UserExists | ( | $UserId | ) |
Check whether user currently exists with specified ID.
int | $UserId | ID to check. |
Definition at line 531 of file UserFactory.php.
UserFactory::UserNameExists | ( | $UserName | ) |
Check whether user name currently exists.
string | $UserName | Name to check. |
Definition at line 547 of file UserFactory.php.
Referenced by TestNewUserValues().
|
protected |
Definition at line 615 of file UserFactory.php.
|
protected |
Definition at line 617 of file UserFactory.php.
Referenced by GetMatchingUserCount().
|
protected |
Definition at line 616 of file UserFactory.php.
Referenced by FindUsers(), and GetMatchingUsers().