68 Classifieds API

Features
class tree: 68Classifieds | index: 68Classifieds | all elements

 Class Users

Description

Users class handles everything for the users.

Located in /includes/classes/kernel/Users.php (line 16)


	
			
Variable Summary
 string $msg
Method Summary
 object Users Users ([boolean $init = true])
 void appendUserData (array $data, [boolean $overWrite = true])
 boolean banUser (integer $id)
 boolean deleteUser (integer $id)
 string formValidation ([boolean $modify = FALSE])
 mixed getAllUsers (array $options, integer $page, [booleen $csv = false])
 array getCountries ()
 integer getNumberOfListingsByUserID (int $id)
 mixed getPairs ()
 string getSearchWhere ()
 void getSortField ()
 string getSortFieldCookie ()
 void getSortOrder ()
 string getSortOrderCookie ()
 array getStates ()
 mixed getUser (integer $id, [ $assign = true])
 mixed getUserByUsername (string $username)
 mixed getUserNameById (integer $id)
 mixed getUserNotes (integer $id)
 void setOptions (array $options)
 void setSortField (string $field)
 void setSortFieldCookieName (string $name)
 void setSortOrder (string $order)
 void setSortOrderCookieName (string $name)
 void setUserData (array $userData)
 void updateSortFieldCookie (string $field)
 void updateSortOrderCookie ( $order, string $field)
 boolean updateUserDetails (array $data, [boolean $usermodify = FALSE])
 mixed _adminGetUserNotes (integer $id)
 mixed _userGetUserNotes (integer $id)
Variables
string $msg = '' (line 96)

Class message, usually for errors

  • access: public
Methods
Constructor Users (line 115)

Constructor, init is used to load the template object

object Users Users ([boolean $init = true])
  • boolean $init
appendUserData (line 544)

Appends data to the _userData var and overrights existing values by default.

  • access: public
void appendUserData (array $data, [boolean $overWrite = true])
  • array $data
  • boolean $overWrite
banUser (line 783)

Ban A User

boolean banUser (integer $id)
  • integer $id: userid
deleteUser (line 745)

Delete a user

boolean deleteUser (integer $id)
  • integer $id: userid
formValidation (line 927)

Create javascript for form validation.

  • return: Javascript String.
  • access: public
string formValidation ([boolean $modify = FALSE])
  • boolean $modify
getAllUsers (line 195)

Gets all users by the parameters.

  • return: false on failure array user list on success
  • access: public
  • uses: Users::getSortOrder
  • uses: Users::setOptions
  • uses: Users::getSortField
  • uses: Pagination::querystring
  • uses: $_REQUEST
  • uses: Pagination::paging
  • uses: Users::getSearchWhere
mixed getAllUsers (array $options, integer $page, [booleen $csv = false])
  • array $options: sort params
  • integer $page: current page #
  • booleen $csv: true - removes paging
getAllUsersForSelect (line 144)

Get all users for a select list

  • access: public
  • uses: Users::getPairs
void getAllUsersForSelect ()
getCountries (line 715)

Get an array of the countries

array getCountries ()
getNumberOfListingsByUserID (line 674)

Get the number of listings for a specific user

  • return: number of listings
  • deprecated: v4.1 use Listings::countByUser($id)
  • access: public
integer getNumberOfListingsByUserID (int $id)
  • int $id: User id.
getPairs (line 160)

Get user id/username pairs - generally used for select boxes

  • return: false on failure and array pairs on success
  • access: public
mixed getPairs ()
getSearchWhere (line 255)

Processes $_REQUEST data for the where clause of sql statment in getAllUsers.

  • return: formated and escaped variables for where clause
  • access: public
  • uses: $_REQUEST
string getSearchWhere ()
getSortField (line 314)

Get sort field, must have setOptions before using this method. Additionally, $_REQUEST and $_COOKIE are evaluated.

  • access: public
  • uses: Users::updateSortFieldCookie
  • uses: Users::setSortField
void getSortField ()
getSortFieldCookie (line 441)

Get the value of the sort field cookie

  • access: public
string getSortFieldCookie ()
getSortOrder (line 341)

Get sort order, must have setOptions before using this method. Additionally, $_REQUEST and $_COOKIE are evaluated.

  • access: public
  • uses: Users::updateSortOrderCookie
  • uses: Users::setSortOrder
void getSortOrder ()
getSortOrderCookie (line 478)

Get the value of the sort order cookie

  • access: public
string getSortOrderCookie ()
getStates (line 730)

Get an array of the states

array getStates ()
getUser (line 620)

Get a single user

  • return: false on failure array of user data on success
  • access: public
  • usedby: Orders::getOrderById()
  • uses: _userGetSelf
  • uses: _assignUserData
  • uses: _adminGetUser
mixed getUser (integer $id, [ $assign = true])
  • integer $id
  • $assign
getUserByUsername (line 648)

Get user data by username

  • return: false on faliure array on success
  • access: public
mixed getUserByUsername (string $username)
  • string $username
getUserGroupsList (line 690)

Get an array of the user groups ordered by id.

  • return: user groups
  • access: public
array getUserGroupsList ()
getUserNameById (line 812)

Gets a users name by their id.

mixed getUserNameById (integer $id)
  • integer $id: userid
getUserNotes (line 838)

Get a users notes.

  • return: false on failure and array on success
  • since: v4.1
  • access: public
  • uses: _userGetUSerNotes
  • uses: Users::_adminGetUserNotes()
  • uses: _appendUserData
mixed getUserNotes (integer $id)
  • integer $id: userid.
setOptions (line 299)

Used to store options for use in other methods. This is used by getAllUsers.

  • access: public
void setOptions (array $options)
  • array $options
setSortField (line 366)

Filters/validates sort field against switch statement and set $_sortField to the proper value.

  • access: public
void setSortField (string $field)
  • string $field
setSortFieldCookieName (line 416)

Sets the cookie name for the sort field

  • access: public
void setSortFieldCookieName (string $name)
  • string $name
setSortOrder (line 397)

Validates/Filters the sort order and sets its oppostite value

  • access: public
void setSortOrder (string $order)
  • string $order
setSortOrderCookieName (line 453)

Sets the cookie name for the sort order

  • access: public
void setSortOrderCookieName (string $name)
  • string $name
setUserData (line 530)

Sets the user data, mainly used incase of extension

  • access: public
void setUserData (array $userData)
  • array $userData
updateSortFieldCookie (line 429)

Overwrites/sets the sort field cookie

void updateSortFieldCookie (string $field)
  • string $field
updateSortOrderCookie (line 466)

Overwrites/sets the sort order cookie

void updateSortOrderCookie ( $order, string $field)
  • string $field
  • $order
updateUserDetails (line 910)

Edit a user.

boolean updateUserDetails (array $data, [boolean $usermodify = FALSE])
  • array $data
  • boolean $usermodify: Not used.
_adminGetUserNotes (line 859)

Gets the users notes for admin review

mixed _adminGetUserNotes (integer $id)
  • integer $id: userid
_userGetUserNotes (line 883)

Gets the users notes for the user's review

  • return: false on failure array on success
  • access: public
mixed _userGetUserNotes (integer $id)
  • integer $id: userid