\Folks_Driver

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.

Summary

Methods
Properties
Constants
factory()
deleteImage()
getOnlineUsers()
resetOnlineUsers()
getRecentVisitors()
getNewUsers()
getRandomUsers()
isOnline()
updateOnlineStatus()
getRawProfile()
getProfile()
changePassword()
saveProfile()
logView()
deleteUser()
getAttributes()
saveAttributes()
comparePassword()
getCookie()
getConfirmationCode()
saveSearch()
getSavedSearch()
getSearchCriteria()
deleteSavedSearch()
logActivity()
getActivity()
deleteActivity()
No public properties found
No constants found
_saveImage()
$_params
N/A
No private methods found
No private properties found
N/A

Properties

$_params

$_params : array

Hash containing connection parameters.

Type

array

Methods

factory()

factory(string  $driver = null, array  $params = null) : \Folks_Driver

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

Parameters

string $driver

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.

array $params

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

Returns

\Folks_Driver

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

deleteImage()

deleteImage(string  $user) 

Delete user image

Parameters

string $user

User pricture belongs to

getOnlineUsers()

getOnlineUsers() : array

Get usersnames online

Returns

array —

users online

resetOnlineUsers()

resetOnlineUsers() : boolean

Reset online users cache

Returns

boolean

getRecentVisitors()

getRecentVisitors(  $limit = 10) : array

Get usersnames online

Parameters

$limit

Returns

array —

users online

getNewUsers()

getNewUsers(  $limit = 10) : array

Get last signed up users

Parameters

$limit

Returns

array —

users online

getRandomUsers()

getRandomUsers(integer  $limit = 10, boolean  $online = true) : array

Get random users

Parameters

integer $limit

Username to check

boolean $online

User is online?

Returns

array —

users

isOnline()

isOnline(string  $user) : boolean

Check if a user is online

Parameters

string $user

Username to check

Returns

boolean

updateOnlineStatus()

updateOnlineStatus() 

Update user online status

getRawProfile()

getRawProfile(  $user) 

Get raw profile of current user

Parameters

$user

getProfile()

getProfile(string  $user = null) 

Get user profile

Parameters

string $user

Username

changePassword()

changePassword(string  $password, string  $user = null) 

Change user password

Parameters

string $password

Plain password

string $user

Username

saveProfile()

saveProfile(array  $data, string  $user = null) 

Save user profile

Parameters

array $data

Profile data

string $user

Username

logView()

logView(string  $id) : boolean

Logs a user view.

Parameters

string $id

Username

Returns

boolean —

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

deleteUser()

deleteUser(string  $user) : boolean

Delete user

Parameters

string $user

Username

Returns

boolean

getAttributes()

getAttributes(string  $user = null, string  $group = null) 

Get user attributes

Parameters

string $user

Username

string $group

Only a specific group

saveAttributes()

saveAttributes(array  $data, string  $group, string  $user = null) 

Save user attributes

Parameters

array $data

Attributes data

string $group

Only a specific group

string $user

Username

comparePassword()

comparePassword(string  $user, string  $plaintext) : boolean

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

Parameters

string $user

Username

string $plaintext

The plaintext pasword to verify.

Returns

boolean —

True if matched, false otherwise.

getCookie()

getCookie(string  $user) : string

Get encripted cookie login string

Parameters

string $user

Username to get cookie for

Returns

string —

Encripted

getConfirmationCode()

getConfirmationCode(string  $user, string  $type = 'activate') : string

Get confirmation code

Parameters

string $user

Username to get code for

string $type

Code type

Returns

string —

Confirmation code

saveSearch()

saveSearch(string  $criteria, string  $name) 

Save search criteria

Parameters

string $criteria

Search criteria

string $name

Search name

getSavedSearch()

getSavedSearch() : array

Get saved search

Returns

array —

saved searches

getSearchCriteria()

getSearchCriteria(string  $name) : array

Get saved search criteria

Parameters

string $name

Username

Returns

array —

search criteria

deleteSavedSearch()

deleteSavedSearch(string  $name) 

Delete saved search

Parameters

string $name

Username

logActivity()

logActivity(string  $message, string  $scope = 'folks', string  $user = null) : true

Log users activity

Parameters

string $message

Activity message

string $scope

Scope

string $user

$user

Returns

true —

on success

getActivity()

getActivity(string  $user, integer  $limit = 10) : array

Get user's activity

Parameters

string $user

Username

integer $limit

Number of actions to return

Returns

array —

Activity log

deleteActivity()

deleteActivity(string  $scope, integer  $date) : true

Delete users activity

Parameters

string $scope

Scope

integer $date

Date

Returns

true —

on success

_saveImage()

_saveImage(string  $file, string  $user) 

Store image

Parameters

string $file

Image file

string $user

User pricture belongs to