Hawk - PHP documentation
  • Namespace
  • Class
  • Tree

Namespaces

  • Hawk
    • View
      • Plugins

Classes

  • App
  • ButtonInput
  • Cache
  • CheckboxInput
  • ColorInput
  • Conf
  • Controller
  • Crypto
  • DatabaseSessionHandler
  • DatetimeInput
  • DB
  • DBExample
  • DeleteInput
  • Dialogbox
  • EmailInput
  • ErrorHandler
  • Event
  • FileInput
  • FileSystem
  • FloatInput
  • Form
  • FormFieldset
  • FormInput
  • GenericModel
  • GifImage
  • HawkApi
  • HawkUpdater
  • HiddenInput
  • HtmlInput
  • HTTPRequest
  • Icon
  • Image
  • IntegerInput
  • ItemList
  • ItemListField
  • JpegImage
  • Lang
  • Language
  • LeftSidebarTab
  • Less
  • Logger
  • Mail
  • MenuItem
  • Model
  • NoSidebarTab
  • NumberInput
  • ObjectInput
  • Option
  • Panel
  • PasswordInput
  • Permission
  • Plugin
  • PluginInstaller
  • PngImage
  • ProfileQuestion
  • ProfileQuestionValue
  • RadioInput
  • Request
  • Response
  • RightSidebarTab
  • Role
  • RolePermission
  • Route
  • Router
  • SelectInput
  • Session
  • Singleton
  • SubmitInput
  • Tabs
  • TextareaInput
  • TextInput
  • Theme
  • TimeInput
  • Upload
  • User
  • View
  • ViewPlugin
  • Widget
  • WysiwygInput

Traits

  • Utils

Exceptions

  • AppStopException
  • DBExampleException
  • DBException
  • FileSystemException
  • HawkApiException
  • ImageException
  • MailException
  • UploadException
  • ViewException

Class Session

This trait is used to manage the user's sessions. It's declared as trait to be used in custom classes developer could want to develop to extend the session management (manage licences, number of simultaneous connections, ...)

Hawk\Singleton
Extended by Hawk\Session
Namespace: Hawk
Package: Core
Located at Session.php

Methods summary

public
# init( )

Initialize the session user

Initialize the session user

public Hawk\User
# getUser( )

Get the user of the current session

Get the user of the current session

Returns

Hawk\User
the user of the current session
public boolean
# isLogged( )

Returns if the current user is logged or not

Returns if the current user is logged or not

Returns

boolean
true if the user is logged, else returns false
public boolean
# isAllowed( string $action )

Check if the user is allowed to make action

Check if the user is allowed to make action

Parameters

$action
The name of the permission to check

Returns

boolean
True if the user is allowed to perform this action, False in other case
public
# setData( array $name, mixed $value )

Set data in session

Set data in session

Parameters

$name

The variable name to set in the session. To set a parameter in a sub array, type 'index1.index2'. For example, to set the parameter $data['user']['name'], type 'user.name'

$value
The value to set
public
# getData( string $name = null )

Get session data

Get session data

Parameters

$name
The variable name to get in session. For a multidimentionnal data, write 'level1.level2'

Methods inherited from Hawk\Singleton

__construct(), getInstance()

Properties summary

protected static array $instance

The session instance

The session instance

#
Hawk - PHP documentation API documentation generated by ApiGen