Documentation

Folks_Driver
in package

Folks_Driver:: defines an API for implementing storage backends for Folks.

Copyright Obala d.o.o. (www.obala.si)

See the enclosed file LICENSE for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.

Tags
author

Duck duck@obala.net

Table of Contents

$_params  : array<string|int, mixed>
Hash containing connection parameters.
changePassword()  : mixed
Change user password
comparePassword()  : bool
Compare an encrypted pasword to a plaintext string to see if they match.
deleteActivity()  : true
Delete users activity
deleteImage()  : mixed
Delete user image
deleteSavedSearch()  : mixed
Delete saved search
deleteUser()  : bool
Delete user
factory()  : Folks_Driver
Attempts to return a concrete Folks_Driver instance based on $driver.
getActivity()  : array<string|int, mixed>
Get user's activity
getAttributes()  : mixed
Get user attributes
getConfirmationCode()  : string
Get confirmation code
getCookie()  : string
Get encripted cookie login string
getNewUsers()  : array<string|int, mixed>
Get last signed up users
getOnlineUsers()  : array<string|int, mixed>
Get usersnames online
getProfile()  : mixed
Get user profile
getRandomUsers()  : array<string|int, mixed>
Get random users
getRawProfile()  : mixed
Get raw profile of current user
getRecentVisitors()  : array<string|int, mixed>
Get usersnames online
getSavedSearch()  : array<string|int, mixed>
Get saved search
getSearchCriteria()  : array<string|int, mixed>
Get saved search criteria
isOnline()  : bool
Check if a user is online
logActivity()  : true
Log users activity
logView()  : bool
Logs a user view.
resetOnlineUsers()  : bool
Reset online users cache
saveAttributes()  : mixed
Save user attributes
saveProfile()  : mixed
Save user profile
saveSearch()  : mixed
Save search criteria
updateOnlineStatus()  : mixed
Update user online status
_saveImage()  : mixed
Store image

Properties

$_params

Hash containing connection parameters.

protected array<string|int, mixed> $_params = array()

Methods

changePassword()

Change user password

public changePassword(string $password[, string $user = null ]) : mixed
Parameters
$password : string

Plain password

$user : string = null

Username

Return values
mixed

comparePassword()

Compare an encrypted pasword to a plaintext string to see if they match.

public comparePassword(string $user, string $plaintext) : bool
Parameters
$user : string

Username

$plaintext : string

The plaintext pasword to verify.

Return values
bool

True if matched, false otherwise.

deleteActivity()

Delete users activity

public deleteActivity(string $scope, int $date) : true
Parameters
$scope : string

Scope

$date : int

Date

Return values
true

on success

deleteImage()

Delete user image

public deleteImage(string $user) : mixed
Parameters
$user : string

User pricture belongs to

Return values
mixed

deleteSavedSearch()

Delete saved search

public deleteSavedSearch(string $name) : mixed
Parameters
$name : string

Username

Return values
mixed

deleteUser()

Delete user

public deleteUser(string $user) : bool
Parameters
$user : string

Username

Return values
bool

factory()

Attempts to return a concrete Folks_Driver instance based on $driver.

public factory([string $driver = null ][, array<string|int, mixed> $params = null ]) : Folks_Driver
Parameters
$driver : string = null

The type of the concrete Folks_Driver subclas to return. The clas name is based on the storage driver ($driver). The code is dynamically included.

$params : array<string|int, mixed> = null

A hash containing any additional configuration or connection parameters a subclas might need.

Return values
Folks_Driver

The newly created concrete Folks_Driver instance, or false on an error.

getActivity()

Get user's activity

public getActivity(string $user[, int $limit = 10 ]) : array<string|int, mixed>
Parameters
$user : string

Username

$limit : int = 10

Number of actions to return

Return values
array<string|int, mixed>

Activity log

getAttributes()

Get user attributes

public getAttributes([string $user = null ][, string $group = null ]) : mixed
Parameters
$user : string = null

Username

$group : string = null

Only a specific group

Return values
mixed

getConfirmationCode()

Get confirmation code

public getConfirmationCode(string $user[, string $type = 'activate' ]) : string
Parameters
$user : string

Username to get code for

$type : string = 'activate'

Code type

Return values
string

Confirmation code

getCookie()

Get encripted cookie login string

public getCookie(string $user) : string
Parameters
$user : string

Username to get cookie for

Return values
string

Encripted

getNewUsers()

Get last signed up users

public getNewUsers([mixed $limit = 10 ]) : array<string|int, mixed>
Parameters
$limit : mixed = 10
Return values
array<string|int, mixed>

users online

getOnlineUsers()

Get usersnames online

public getOnlineUsers() : array<string|int, mixed>
Return values
array<string|int, mixed>

users online

getProfile()

Get user profile

public getProfile([string $user = null ]) : mixed
Parameters
$user : string = null

Username

Return values
mixed

getRandomUsers()

Get random users

public getRandomUsers([int $limit = 10 ][, bool $online = true ]) : array<string|int, mixed>
Parameters
$limit : int = 10

Username to check

$online : bool = true

User is online?

Return values
array<string|int, mixed>

users

getRawProfile()

Get raw profile of current user

public getRawProfile(mixed $user) : mixed
Parameters
$user : mixed
Return values
mixed

getRecentVisitors()

Get usersnames online

public getRecentVisitors([mixed $limit = 10 ]) : array<string|int, mixed>
Parameters
$limit : mixed = 10
Return values
array<string|int, mixed>

users online

getSavedSearch()

Get saved search

public getSavedSearch() : array<string|int, mixed>
Return values
array<string|int, mixed>

saved searches

getSearchCriteria()

Get saved search criteria

public getSearchCriteria(string $name) : array<string|int, mixed>
Parameters
$name : string

Username

Return values
array<string|int, mixed>

search criteria

isOnline()

Check if a user is online

public isOnline(string $user) : bool
Parameters
$user : string

Username to check

Return values
bool

logActivity()

Log users activity

public logActivity(string $message[, string $scope = 'folks' ][, string $user = null ]) : true
Parameters
$message : string

Activity message

$scope : string = 'folks'

Scope

$user : string = null

$user

Return values
true

on success

logView()

Logs a user view.

public logView(string $id) : bool
Parameters
$id : string

Username

Return values
bool

True, if the view was logged, false if the mesage was aleredy seen

resetOnlineUsers()

Reset online users cache

public resetOnlineUsers() : bool
Return values
bool

saveAttributes()

Save user attributes

public saveAttributes(array<string|int, mixed> $data, string $group[, string $user = null ]) : mixed
Parameters
$data : array<string|int, mixed>

Attributes data

$group : string

Only a specific group

$user : string = null

Username

Return values
mixed

saveProfile()

Save user profile

public saveProfile(array<string|int, mixed> $data[, string $user = null ]) : mixed
Parameters
$data : array<string|int, mixed>

Profile data

$user : string = null

Username

Return values
mixed

saveSearch()

Save search criteria

public saveSearch(string $criteria, string $name) : mixed
Parameters
$criteria : string

Search criteria

$name : string

Search name

Return values
mixed

updateOnlineStatus()

Update user online status

public updateOnlineStatus() : mixed
Return values
mixed

_saveImage()

Store image

protected _saveImage(string $file, string $user) : mixed
Parameters
$file : string

Image file

$user : string

User pricture belongs to

Return values
mixed

Search results