abstract class \mpf\web\ActiveUser

abstract class \mpf\web\ActiveUser

-no description found-

Attributes
private static mixed $_instance

-no description found-

public string $sessionKey = "ActiveUser"

Key used for session data

public string $cookieKey = "ActiveUser"

Key used for cookie data

private string[] $_rights = []

List of rights for active user

private string[] $_userData = []

Active user data loaded from $_SESSION

protected bool $connected = false

Record if user is connected or not.

Methods

public static \mpf\web\ActiveUser get ()

Get an instance of current class

public mixed init (mixed $config)

  • $config

    -no description found-

-no description found-

public bool isGuest ()

Check if user is not connected.

public bool isConnected ()

Check if user is connected.

public mixed logout ()

Logout for current user. It wil clear session and cookie.

public \mpf\web\ActiveUser setState (string $name, string $value)

  • $name

    -no description found-

  • $value

    -no description found-

Set user state.

protected mixed refresh ()

Load data from $_SESSION if exists

public bool hasRight (mixed $right)

  • $right

    -no description found-

Check if user has selected right.

public \mpf\web\ActiveUser setRights (mixed $rights)

  • $rights

    -no description found-

Set a new set of rights for active user.

public \string[] getRights ()

Return list of rights for current user.

public mixed __get (string $name)

  • $name

    -no description found-

Return value of data from _userData for current user.

public mixed __set (string $name, mixed $value)

  • $name

    -no description found-

  • $value

    -no description found-

A shortcut to setState method.

protected abstract mixed checkAutoLogin ()

Checks login from cookie or any other used by user;