CWIS Developer Documentation

- Home
- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes | List of all members
UserFactory Class Reference
Inheritance diagram for UserFactory:
[legend]

## Public Member Functions
| UserFactory ()
| Object constructor. More...
| CreateNewUser ($UserName, $Password, $PasswordAgain, $EMail, $EMailAgain, $IgnoreErrorCodes=NULL)
| Create new user. More...
| TestNewUserValues ($UserName, $Password, $PasswordAgain, $EMail, $EMailAgain)
| GetUserCount ($Condition=NULL)
| Return number of users in the system. More...
| GetMatchingUserCount ()
| GetLoggedInUsers ($InactivityTimeout=60)
| Get users who are currently logged in (i.e. More...
| GetRecentlyLoggedInUsers ($Since=NULL, $Limit=10)
| GetUsersWithPrivileges ()
| Return array of user names who have the specified privileges. More...
| FindUsers ($SearchString, $FieldName="UserName", $SortFieldName="UserName", $Offset=0, $Count=9999999)
| FindUserNames ($SearchString, $FieldName="UserName", $SortFieldName="UserName", $Offset=0, $Count=9999999, $IdExclusions=array(), $ValueExclusions=array())
| GetMatchingUsers ($SearchString, $FieldName=NULL, $SortFieldName="UserName", $ResultsStartAt=0, $ReturnNumber=NULL)
| UserNameExists ($UserName)
| EMailAddressIsInUse ($Address)
| GetNewestUsers ($Limit=5)
| Get the users sorted by when they signed up, starting with those who signed up most recently. More...
| CompareUsersForSort ($UserA, $UserB)

## Public Attributes
| $DB
| $SortFieldName
| $MatchingUserCount

## Detailed Description

Definition at line 18 of file Axis--UserFactory.php.

## Member Function Documentation

UserFactory::CompareUsersForSort | ( |  | $UserA,
|  |  | $UserB
| ) |  |

Definition at line 534 of file Axis--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.

Parameters

  string | $UserName | Login name for new user.
  string | $Password | Password for new user.
  string | $PasswordAgain | Second copy of password entered by user.
  string | $EMail | 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)

Returns
  User object or array of error codes.

Definition at line 43 of file Axis--UserFactory.php.

References User\NormalizeUserName(), TestNewUserValues(), and U_OKAY.

UserFactory::EMailAddressIsInUse | ( |  | $Address | ) |

Definition at line 485 of file Axis--UserFactory.php.

References User\NormalizeEMailAddress().

Referenced by TestNewUserValues().

Here is the caller graph for this function:

UserFactory::FindUserNames | ( |  | $SearchString,
|  |  | $FieldName = `"UserName"`,
|  |  | $SortFieldName = `"UserName"`,
|  |  | $Offset = `0`,
|  |  | $Count = `9999999`,
|  |  | $IdExclusions = `array()`,
|  |  | $ValueExclusions = `array()`
| ) |  |

Definition at line 316 of file Axis--UserFactory.php.

References User\IsValidUserName().

Referenced by FindUsers().

Here is the caller graph for this function:

UserFactory::FindUsers | ( |  | $SearchString,
|  |  | $FieldName = `"UserName"`,
|  |  | $SortFieldName = `"UserName"`,
|  |  | $Offset = `0`,
|  |  | $Count = `9999999`
| ) |  |

Definition at line 296 of file Axis--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).

Parameters

  int | $InactivityTimeout | Number of minutes after which an inactive user is considered to be no longer logged in. (OPTIONAL, defaults to 60)

Returns
  Array of User objects.

Definition at line 187 of file Axis--UserFactory.php.

UserFactory::GetMatchingUserCount | ( |  | ) |

Definition at line 176 of file Axis--UserFactory.php.

References $MatchingUserCount.

UserFactory::GetMatchingUsers | ( |  | $SearchString,
|  |  | $FieldName = `NULL`,
|  |  | $SortFieldName = `"UserName"`,
|  |  | $ResultsStartAt = `0`,
|  |  | $ReturnNumber = `NULL`
| ) |  |

Definition at line 381 of file Axis--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.

Parameters

  $Limit | the maximum number of users to return

Definition at line 505 of file Axis--UserFactory.php.

UserFactory::GetRecentlyLoggedInUsers | ( |  | $Since = `NULL`,
|  |  | $Limit = `10`
| ) |  |

Definition at line 209 of file Axis--UserFactory.php.

UserFactory::GetUserCount | ( |  | $Condition = `NULL` | ) |

Return number of users in the system.

Parameters

  string | $Condition | SQL condition (without "WHERE") to limit user count. (OPTIONAL)

Returns
  Count of users.

Definition at line 168 of file Axis--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.

Parameters

  mixed | $Priv | Privilege or array of privileges.

Returns
  array User names with user IDs for the array index.

Definition at line 247 of file Axis--UserFactory.php.

UserFactory::TestNewUserValues | ( |  | $UserName,
|  |  | $Password,
|  |  | $PasswordAgain,
|  |  | $EMail,
|  |  | $EMailAgain
| ) |  |

Definition at line 82 of file Axis--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().

Here is the caller graph for this function:

UserFactory::UserFactory | ( |  | ) |

Object constructor.

Definition at line 25 of file Axis--UserFactory.php.

UserFactory::UserNameExists | ( |  | $UserName | ) |

Definition at line 469 of file Axis--UserFactory.php.

References User\NormalizeUserName().

Referenced by TestNewUserValues().

Here is the caller graph for this function:

## Member Data Documentation

UserFactory::$DB

Definition at line 529 of file Axis--UserFactory.php.

UserFactory::$MatchingUserCount

Definition at line 531 of file Axis--UserFactory.php.

Referenced by GetMatchingUserCount().

UserFactory::$SortFieldName

Definition at line 530 of file Axis--UserFactory.php.

Referenced by FindUsers(), and GetMatchingUsers().

The documentation for this class was generated from the following file:

- lib/AxisPHP/Axis--UserFactory.php