clearFusionCMS 3.0.0
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • clearFusionCMS
    • module
      • cloudflare
      • comments
      • content
      • forms
      • members
      • search
  • fusionLib
  • None

Classes

  • _flFormGroup
  • _flUtf8Base
  • flAcMgr
  • flApiDbInstaller
  • flApiKeyMgr
  • flApiServer
  • flApiService
  • flApp
  • flAuthTOTP
  • flBufferCode
  • flBufferCss
  • flBufferJs
  • flCache
  • flCacheAPC
  • flCacheDb
  • flCacheDbInstaller
  • flCacheDummy
  • flCacheFile
  • flCacheFunction
  • flCacheMemcache
  • flCacheMemcached
  • flCacheOutput
  • flCacheRedis
  • flCacheSqlite
  • flConfig
  • flConfigDb
  • flConfigDbInstaller
  • flConfigFile
  • flConfigIni
  • flController
  • flControllerAction
  • flDate
  • flDateTzMenu
  • flDb
  • flDbInstaller
  • flDbInstallerInterface
  • flDbMySQL
  • flDbMySQLi
  • flDbMySQLiResult
  • flDbMySQLResult
  • flDbNestedSet
  • flDbResult
  • flDbSQLite
  • flDbSQLite3
  • flDbSQLite3Result
  • flDbSQLiteResult
  • flEmail
  • flEvent
  • flEventDbInstaller
  • flEventManager
  • flExceptionErrorController
  • flExceptionReporter
  • flForm
  • flFormBuilder
  • flFormDecorator
  • flFormDecoratorDl
  • flFormDecoratorDtDd
  • flFormDecoratorFieldset
  • flFormDecoratorForm
  • flFormDecoratorLi
  • flFormDecoratorList
  • flFormDecoratorUl
  • flFormElement
  • flFormElementButton
  • flFormElementCheckbox
  • flFormElementChecklist
  • flFormElementEmail
  • flFormElementFile
  • flFormElementHidden
  • flFormElementImage
  • flFormElementInteger
  • flFormElementNumber
  • flFormElementPane
  • flFormElementPassword
  • flFormElementRadio
  • flFormElementRecaptcha
  • flFormElementSearch
  • flFormElementSelect
  • flFormElementSubmit
  • flFormElementText
  • flFormElementTextArea
  • flFormElementTextSuggest
  • flFormElementUri
  • flFormElementWYSIWYG
  • flFormValidator
  • flFormValidatorAttribMax
  • flFormValidatorAttribMin
  • flFormValidatorCustomJS
  • flFormValidatorEmail
  • flFormValidatorEquals
  • flFormValidatorInteger
  • flFormValidatorMax
  • flFormValidatorMaxChecklist
  • flFormValidatorMaxLength
  • flFormValidatorMin
  • flFormValidatorMinChecklist
  • flFormValidatorMinLength
  • flFormValidatorMultiEmail
  • flFormValidatorNotEquals
  • flFormValidatorNumber
  • flFormValidatorRegex
  • flFormValidatorRequired
  • flFormValidatorSameAs
  • flFormValidatorUri
  • flFtpClient
  • flGravatar
  • flHttpClient
  • flHttpClientCookie
  • flImage
  • flImageFilter
  • flImageFilterBrightness
  • flImageFilterColorize
  • flImageFilterContrast
  • flImageFilterEdgeDetect
  • flImageFilterEmboss
  • flImageFilterGaussianBlur
  • flImageFilterGrayscale
  • flImageFilterMeanRemoval
  • flImageFilterNegative
  • flImageFilterPixelate
  • flImageFilterSelectiveBlur
  • flImageFilterSepia
  • flImageFilterSepia2
  • flImageFilterSmooth
  • flIntegrity
  • flKeygen
  • flLog
  • flLogHandlerChrome
  • flLogHandlerLoggly
  • flLogHandlerPapertrail
  • flLogHandlerSlack
  • flMimeTypes
  • flModuleDbInstaller
  • flModuleMgr
  • flRegistry
  • flRequest
  • flRequestDbInstaller
  • flRequestThrottle
  • flResponse
  • flRouter
  • flRouterRoute
  • flRssChannel
  • flRssClient
  • flRssItem
  • flSearch
  • flSearchIndexer
  • flSearchManager
  • flSearchResults
  • flSearchTags
  • flSession
  • flSessionData
  • flSessionDb
  • flSessionDbInstaller
  • flSessionFile
  • flSessionMemcache
  • flSessionMemcached
  • flSessionRedis
  • flTemplateDbInstaller
  • flTemplateEngine
  • flTemplateManager
  • flTextHTML
  • flTextSplitWords
  • flTextStemmer
  • flTextStemmerEn
  • flTextStrip
  • flTimer
  • flUri
  • flUser
  • flUserAdapter
  • flUserAdapterRemote
  • flUserDbInstaller
  • flUserMgr
  • flUserPwdGen
  • flUserServerApiV1
  • flUtf8
  • flUuid
  • flVariables
  • flVariablesDbInstaller
  • flWidgetBreadcrumb
  • flWidgetFloatingActionMenu
  • flWidgetPagination
  • flWidgetTable
  • flWidgetTabs
  • flWidgetToolbar
  • flWidgetTreeChildNode
  • flWidgetTreeLinkNode
  • flWidgetTreeNode
  • flWidgetTreeView
  • fusionLib

Interfaces

  • flFormElementWYSIWYGCodeInterface
  • flFormElementWYSIWYGInterface
  • flFormElementWYSIWYGTransformInterface
  • flLogHandler
  • flModuleInstallInterface

Exceptions

  • flAcException
  • flAppException
  • flCacheException
  • flConfigException
  • flDateException
  • flDbException
  • flEventException
  • flException
  • flExceptionBadRequest
  • flExceptionForbidden
  • flExceptionLoadClass
  • flExceptionNotFound
  • flExceptionPHP
  • flFormException
  • flHttpClientException
  • flImageException
  • flRegistryException
  • flRequestThrottleException
  • flRouterException
  • flSessionException
  • flTemplateEngineException
  • flUserException
  • flVariablesException
  • flWidgetException

Functions

  • __
  • __noop
  • _flErrorHandler
  • _n
  • _n_noop

Class flUser

flUser Class

Class to provide user authentication and data access.

Package: fusionLib
Copyright: Copyright (c) 2008 - 2016 fusionLib. All rights reserved.
Located at system/libs/User/flUser.php

Methods summary

public static
# setRememberMeTime( integer $time )

Set the time to remember a user for.

Set the time to remember a user for.

Parameters

$time
The time in seconds to remember a user for.
public static integer
# getRememberMeTime( )

Get the time to remember a user for.

Get the time to remember a user for.

Returns

integer
The time in seconds to remember a user for.
public static
# setCookieInfo( string $cookieName, string $cookieDomain, string $cookiePath )

Set the user authentication cookie information.

Set the user authentication cookie information.

Parameters

$cookieName
The name of the cookie holding user data.
$cookieDomain
The optional domain the cookie is available on, e.g. for all subdomains '.example.com'
$cookiePath
The optional path for the cookie.
public static string
# getCookieName( )

Get the cookie name.

Get the cookie name.

Returns

string
The cookie name.
public static string
# getCookieDomain( )

Get the cookie domain.

Get the cookie domain.

Returns

string
The cookie domain.
public static string
# getCookiePath( )

Get the cookie path.

Get the cookie path.

Returns

string
The cookie path.
public
# __construct( flDb $db, flRequest $request, flResponse $response, flUserAdapter $adapter = null, integer $uid = null )

Construct the object.

Construct the object.

Parameters

$db
The database access object to use.
$request
The request object to use.
$response
The response object to use.
$adapter
The authentication adapter.
$uid
If given and $request is null loads the user.
public flUserAdapter
# getAdapter( )

Get the user authentication adapter in use.

Get the user authentication adapter in use.

Returns

flUserAdapter
The adapter.
public string
# regenerateAuth( )

Regenerate the authentication cookie, forces logout on all machines.

Regenerate the authentication cookie, forces logout on all machines.

Returns

string
The new value for the auth cookie.

Throws

flUserException
public
# logout( )

Log the current user out.

Log the current user out.

public boolean
# authenticate( string $username, string $password, boolean $rememberMe, string $usernameEmail = 'username' )

Authenticate the user with the given name and password.

Authenticate the user with the given name and password.

Parameters

$username
The name of the user.
$password
The users password.
$rememberMe
true if the user should be remembered between visits; else false.
$usernameEmail
Select if $username holds a username 'username', an email address 'email', or null if unknown.

Returns

boolean
true if the user was authenticated else false.
public
# isAuthenticated( )

Test if the user is authenticated.

Test if the user is authenticated.

return bool true if the user is authenticated else false.

public integer
# getState( )

Get the authentication error/state.

Get the authentication error/state.

Returns

integer
One of AUTH_
public integer
# getId( )

Get the id of the currently authenticated user.

Get the id of the currently authenticated user.

Returns

integer
The users id or null if no user authenticated.
public string
# getUsername( )

Get the username.

Get the username.

Returns

string
The username.
public string
# getDisplayName( )

Get the users display name.

Get the users display name.

Returns

string
The display name.
public string
# getBio( )

Get the users bio.

Get the users bio.

Returns

string
The bio.
public string
# getEmail( )

Get the email address.

Get the email address.

Returns

string
The email address.
public boolean
# isRememberMe( )

Test if remember me is enabled.

Test if remember me is enabled.

Returns

boolean
true if remember me is on; else false.
public string
# getTimezone( )

Get the users timezone.

Get the users timezone.

Returns

string
The timezone.
public boolean
# usernameSet( )

Test if the username has been set.

Test if the username has been set.

Returns

boolean
true if the username has been set; else false.
public string
# getAuthKey( )

Get the users private key for two factor authentication.

Get the users private key for two factor authentication.

Returns

string
The two factor authenticaiton secret.
public array
# getRoles( )

Get the roles assigned to a user.

Get the roles assigned to a user.

Returns

array
Array of role names assigned to the user.
public array
# getPermissions( )

Get a list of all the permissions granted to the user.

Get a list of all the permissions granted to the user.

Returns

array
Array holding all the permissions granted to the user, empty if not logged in.
public boolean
# hasPermission( string|array $perm )

Test if the user has been granted one or more permission.

Test if the user has been granted one or more permission.

Parameters

$perm
The permission(s) to test for.

Returns

boolean
true if the permission(s) have been granted; else false.
public string
# getSecret( )

Get the user secret.

Get the user secret.

Returns

string
The secret.
protected
# setFromResults( array $r, boolean $rememberMe )

Set the user information and authentication cookie from adapter returned results.

Set the user information and authentication cookie from adapter returned results.

Parameters

$r
Array of user data.
$rememberMe
true if user selected remember me; else false.

Constants summary

integer AUTH_UNKNOWN

Authentication results.

Authentication results.

# 0
integer AUTH_OK
# 1
integer AUTH_BAD_USER_PASS
# 2
integer AUTH_FAILED
# 3
integer AUTH_IP_BLOCKED
# 4
integer AUTH_PENDING_ACTIVATION
# 5
integer AUTH_DISABLED
# 6
integer AUTH_BLOCKED
# 7

Properties summary

protected flDb $db

The database.

The database.

#
protected flRequest $request

The request object.

The request object.

#
protected flResponse $response

The response object.

The response object.

#
protected static string $cookieName

The name of the cookie.

The name of the cookie.

# '__userid'
protected static string $cookieDomain

The domain the cookie is available on.

The domain the cookie is available on.

# ''
protected static string $cookiePath

The path for the cookie.

The path for the cookie.

# '/'
protected enum $authState

Authentication status code.

Authentication status code.

# flUser::AUTH_UNKNOWN
protected integer $uid

The user id.

The user id.

# null
protected string $username

The username.

The username.

# null
protected string $displayName

The display name of the user.

The display name of the user.

# null
protected string $bio

The users bio.

The users bio.

# null
protected string $email

The users email address.

The users email address.

# null
protected string $timezone

The users timezone

The users timezone

# 'UTC'
protected string $secret

Hashing secret.

Hashing secret.

# ''
protected boolean $rememberMe

Flags if the user is being remembered between browser sessions.

Flags if the user is being remembered between browser sessions.

# false
protected flUserAdapter $adapter

The user authentication adapter.

The user authentication adapter.

# null
protected string $authKey

The users private auth key.

The users private auth key.

# ''
protected static integer $rememberMeTime

The time to remember a user for, default 1 year.

The time to remember a user for, default 1 year.

# 31536000
clearFusionCMS 3.0.0 API documentation generated by ApiGen