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... | |
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... | |
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 44 of file UserFactory.php.
References User\NormalizeUserName(), 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 544 of file UserFactory.php.
References User\NormalizeEMailAddress().
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 356 of file UserFactory.php.
References User\IsValidUserName().
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 324 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 200 of file UserFactory.php.
UserFactory::GetMatchingUserCount | ( | ) |
Get total number of user that matched last GetMatchingUsers() call.
Definition at line 189 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 432 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 564 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 228 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 178 of file UserFactory.php.
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 265 of file UserFactory.php.
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 91 of file UserFactory.php.
References EMailAddressIsInUse(), User\IsValidLookingEMailAddress(), User\IsValidPassword(), User\IsValidUserName(), User\NormalizeEMailAddress(), User\NormalizePassword(), User\NormalizeUserName(), U_DUPLICATEEMAIL, U_DUPLICATEUSERNAME, U_EMAILSDONTMATCH, U_EMPTYEMAIL, U_EMPTYEMAILAGAIN, U_EMPTYPASSWORD, U_EMPTYPASSWORDAGAIN, U_EMPTYUSERNAME, U_ILLEGALEMAIL, U_ILLEGALEMAILAGAIN, U_ILLEGALPASSWORD, U_ILLEGALPASSWORDAGAIN, U_ILLEGALUSERNAME, U_PASSWORDSDONTMATCH, and UserNameExists().
Referenced by CreateNewUser().
UserFactory::UserNameExists | ( | $UserName | ) |
Check whether user name currently exists.
string | $UserName | Name to check. |
Definition at line 524 of file UserFactory.php.
References User\NormalizeUserName().
Referenced by TestNewUserValues().
|
protected |
Definition at line 588 of file UserFactory.php.
|
protected |
Definition at line 590 of file UserFactory.php.
Referenced by GetMatchingUserCount().
|
protected |
Definition at line 589 of file UserFactory.php.
Referenced by FindUsers(), and GetMatchingUsers().