Huygens Remote Manager
  • Namespace
  • Class
  • Tree
  • Todo

Namespaces

  • hrm
    • job
    • param
      • base
    • setting
      • base
    • shell
    • stats
    • user
      • proxy

Classes

  • UserConstants
  • UserManager
  • UserV2

Class UserV2

Manages a User and its state and authenticates against the configured authentication mechanism.

The User class is fundamentally read-only. Changes to the User properties are performed through a UserManager (see below). Persistence of some of those changes are dependent on the underlying authentication system.

A User known to HRM is always stored in the database, no matter what the user management backend is.

A User relies on a proxy to authenticate and to query information from the underlying user management system. Some user management systems are read-only for the HRM.

Supported proxies are: * DatabaseProxy (read/write): the HRM integrated user management system * ActiveDirectoryProxy (read only): interface to Microsoft Active Directory * LDAPProxy (read only): interface to generic LDAP (version 3) * Auth0Proxy (read only): interface to Auth0.

The default authentication mode (and therefore proxy) is defined in the HRM settings.

Namespace: hrm\user
Package: hrm
Located at user/UserV2.php

Methods summary

public
# __construct( string $name = null )

Constructor. Creates a new (unnamed) User with default with values.

Constructor. Creates a new (unnamed) User with default with values.

Parameters

$name

Optional (default = null). Name of the User. If omitted, an empty User with default authentication mode is created. If the name is specified and the User exists, it is loaded from the database. If the User does not exist, only the name is set.

public integer
# id( )

Returns the User id

Returns the User id

Returns

integer
User id.
public string
# name( )

Returns the name of the User.

Returns the name of the User.

Returns

string
The name of the User.
public
# setName( string $name )

Sets the name of the User.

Sets the name of the User.

If a User with the given name exists in the database, it is loaded.

Parameters

$name
The name of the User.
public string
# creationDate( )

Returns the creation date of the User.

Returns the creation date of the User.

Returns

string
Creation date of the User.
public string
# lastAccessDate( )

Returns the last access date of the User.

Returns the last access date of the User.

Returns

string
Last access date of the User.
public string
# role( )

Returns the role of the User.

Returns the role of the User.

Returns

string
Role of the User.
public string
# institution_id( )

Returns the institution of the User.

Returns the institution of the User.

Returns

string
Institution of the User.
public
# set_institution_id( $institution_id )

Set the institution Id for ther User.

Set the institution Id for ther User.

Parameters

$institution_id
Institution Id.
public string
# institution_name( )

Returns the institution of the User.

Returns the institution of the User.

Returns

string
Institution name of the User.
public string
# authenticationMode( )

Returns the authentication mode for the User.

Returns the authentication mode for the User.

Returns

string
Authentication mode for the User.
public
# setAuthenticationMode( $authMode )

Sets the authentication mode for the User.

Sets the authentication mode for the User.

Parameters

$authMode
Authentication mode for the User.

Throws

Exception
If the authentication mode is not configured or recognized.
public string
# status( )

Returns the status of the User.

Returns the status of the User.

Returns

string
Status of the User.
public
# setStatus( $status )

Set the status of the User.

Set the status of the User.

Parameters

$status

Status of the User: one of UserConstants::STATUS_ACTIVE, UserConstants::STATUS_DISABLED.

Throws

Exception
If the status is not valid.
public hrm\user\proxy\AbstractProxy
# proxy( )

Returns the proxy of the User.

Returns the proxy of the User.

Returns

hrm\user\proxy\AbstractProxy
Proxy of the User.
public boolean
# isLoggedIn( )

Checks whether the user is logged in.

Checks whether the user is logged in.

Returns

boolean
True if the user is logged in, false otherwise.
public boolean
# logIn( string $password )

Logs in the user with given user name and password

Logs in the user with given user name and password

This function will use different authentication modes depending on the value of the global configuration variable $authenticateAgainst.

Parameters

$password
Password (plain)

Returns

boolean
True if the user could be logged in, false otherwise.

Throws

Exception
If the User does not have a name.
public
# logOut( )

Logs out the user

Logs out the user

public boolean
# isAccepted( )

Check whether a new user request has been accepted by the administrator

Check whether a new user request has been accepted by the administrator

This should only be used if authentication is against the HRM user management.

Returns

boolean
True if the user has been accepted; false otherwise.
public boolean
# isDisabled( )

Checks whether the user has been suspended by the administrator

Checks whether the user has been suspended by the administrator

This should only be used if authentication is against the HRM user management.

Returns

boolean

True if the user was suspended by the administrator; false otherwise.

public string
# emailAddress( )

Returns the User e-mail address.

Returns the User e-mail address.

Returns

string
The User e-mail address.
public
# SetEmailAddress( $emailAddress )

Sets the User e-mail address.

Sets the User e-mail address.

Parameters

$emailAddress
The User e-mail address.

Throws

Exception
If the underlying proxy does not allow modifying the e-mail address.
public boolean
# isAdmin( )

Checks whether the user is an administrator or the super administrator.

Checks whether the user is an administrator or the super administrator.

Returns

boolean
True if the user is an administrator, false otherwise.
public boolean
# isSuperAdmin( )

Checks whether the user is the super administrator.

Checks whether the user is the super administrator.

Returns

boolean
True if the user is the super administrator, false otherwise.
public string
# group( )

Returns the user to which the User belongs.

Returns the user to which the User belongs.

Returns

string
Group name.
public
# SetGroup( $group )

Sets the User group.

Sets the User group.

Parameters

$group
The User group.

Throws

Exception
If the underlying proxy does not allow modifying the group.
Huygens Remote Manager API documentation generated by ApiGen