Methods |
public
|
__construct()
|
#
|
public
|
session_info(): array
Active session information
Active session information
|
#
|
public
|
change_password(string $password, string $user = null, string $domain = null): bool
Change an account password user parameter may only be supplied by account admin
domain parameter may only be supplied by server admin
Change an account password user parameter may only be supplied by account admin
domain parameter may only be supplied by server admin
|
#
|
public
|
reset_password(string|null $user = null, string|null $domain = null): string
Generate random password for user
Generate random password for user
Returns
|
#
|
public
|
password_permitted(string $password, string|null $user = null): bool
Password meets minimum security requirements
Password meets minimum security requirements
|
#
|
public
|
is_demo(): bool
|
#
|
public
|
crypt(string $password, string|null $salt = null): string
Encrypt a password using the strongest hash
Encrypt a password using the strongest hash
|
#
|
public
|
change_cpassword(string $cpassword, string|null $user = null, string|null $domain = null): bool
Change password (crypted) Notifications are dispatched depending on rules: Self-changes alert the affected users.
Changes to subordinate users notify next role down.
- admin changing sub-user notifies site admin
- site admin changing sub-user notifies sub-user
- sub-user changing self notifies self
Change password (crypted) Notifications are dispatched depending on rules: Self-changes alert the affected users.
Changes to subordinate users notify next role down.
- admin changing sub-user notifies site admin
- site admin changing sub-user notifies sub-user
- sub-user changing self notifies self
Parameters
$cpassword |
crypted password
|
|
#
|
public
|
is_inactive(): bool
|
#
|
public
|
inactive_reason(): string|null
|
#
|
public
|
create_api_key(string $comment = '', string $user = null): null|string
Generate an API key Generates a 256-bit SOAP key for use with invoking the Web Services
in apnscp esprit. The key is a hexadecimal-encoded value traditionally
split into groups of 8, or 96 bits per bunch, delimited by a '-'. When
authenticating, this is the format preferred, but this function will
instead return the 512-bit key gumped into one big string. At this time
you are limited to just 10 keys.
Generate an API key Generates a 256-bit SOAP key for use with invoking the Web Services
in apnscp esprit. The key is a hexadecimal-encoded value traditionally
split into groups of 8, or 96 bits per bunch, delimited by a '-'. When
authenticating, this is the format preferred, but this function will
instead return the 512-bit key gumped into one big string. At this time
you are limited to just 10 keys.
Parameters
$comment |
optional comment
|
$user |
optional user for site admin
|
Returns
|
#
|
public
|
set_api_key_comment(string $key, string $comment = null, string $user = null): bool
Alter a comment attached to an API key
Alter a comment attached to an API key
Parameters
$user |
optional username for site admin
|
|
#
|
public
|
verify_password(string $password): bool
|
#
|
public
|
verify_totp(string $code): bool
|
#
|
public
|
totp_exists(): bool
|
#
|
public
|
totp_enable(string $secret, string $code): bool
Parameters
$secret |
initialization key
|
|
#
|
public
|
totp_disable(): bool
|
#
|
public
|
totp_code(): string|null
Create new TOTP authentication
Create new TOTP authentication
|
#
|
public
|
set_extended_auth_flag(string|null $session = null): bool
Flag an existent session with EXTAUTH privileges
Flag an existent session with EXTAUTH privileges
|
#
|
public
|
get_last_login(): array
Queries the last login data for the current user. Response will be empty on first login, otherwise an associative array
of indexes date and IP are returned containing the date as an
integer (unix timestamp) and IP address in in conventional IPv4 fashion
Queries the last login data for the current user. Response will be empty on first login, otherwise an associative array
of indexes date and IP are returned containing the date as an
integer (unix timestamp) and IP address in in conventional IPv4 fashion
|
#
|
public
|
get_login_history(integer $limit = null): array
Retrieves all login requests for a user Return is NULL if this is the first time logging in,
otherwise an associative array of indexes date and IP are returned
containing the date as an integer (unix timestamp) and IP address in
in conventional IPv4 fashion
Retrieves all login requests for a user Return is NULL if this is the first time logging in,
otherwise an associative array of indexes date and IP are returned
containing the date as an integer (unix timestamp) and IP address in
in conventional IPv4 fashion
Parameters
$limit |
limit results retrieved to N resultsm
|
|
#
|
public
|
change_domain(string $domain): bool|mixed
Change primary account domain
Change primary account domain
|
#
|
public
|
change_username(string $user): bool
Change primary account username
Change primary account username
|
#
|
public
|
set_temp_password(string $item, int $duration = 120, string|null $password = null): bool
Set a temporary password for an account
Set a temporary password for an account
Parameters
$item |
site or user
|
$duration |
duration
|
$password |
optional password
|
|
#
|
public
|
_create()
|
#
|
public
|
_edit()
|
#
|
public
|
user_permitted(string $user = null, string $svc = 'cp'): bool
User permitted to service
User permitted to service
|
#
|
public
|
user_enabled(string $user = null, string $svc = 'cp'): bool
User permitted to service
User permitted to service
|
#
|
public
|
deny_user(string $user, string $svc = 'cp'): bool
|
#
|
public
|
permit_user(string $user, $svc = 'cp'): bool
Permit user access to apnscp
Permit user access to apnscp
Parameters
|
#
|
public
|
restrict_ip(string $ip, string|null $gate = null): bool
Parameters
$ip |
IPv4, IPv6, or CIDR
|
$gate |
optional authentication gate
|
|
#
|
public
|
remove_ip_restriction(string $ip, string|null $gate = null): bool
Parameters
$ip |
IPv4, IPv6, or CIDR
|
$gate |
optional authentication gate
|
|
#
|
public
|
get_ip_restrictions(): array
|
#
|
public
|
_edit_user(string $userold, string $usernew, array $oldpwd)
|
#
|
public
|
_reset(Util_Account_Editor &$editor = null)
|
#
|
public
|
_delete()
|
#
|
public
|
get_api_keys(string $user = null): array|false
array get_api_keys (void) listing all keys associated to an account:
- key: the generated key
- last_used: an integer representation of the last date the key was used.
If the key was never used, null is set for that value.
Returns the list of SOAP keys associated to an account
array get_api_keys (void) listing all keys associated to an account:
- key: the generated key
- last_used: an integer representation of the last date the key was used.
If the key was never used, null is set for that value.
Returns the list of SOAP keys associated to an account
|
#
|
public
|
delete_api_key(string $key, string $user = null): bool
Delete SOAP key The key should be in hexadecimal strictly without dashes,
case does not matter.
Delete SOAP key The key should be in hexadecimal strictly without dashes,
case does not matter.
Parameters
$key |
key to delete from keyring
|
|
#
|
public
|
_housekeeping()
|
#
|
public
|
_cron(Cronus $cron)
|
#
|
public
|
_create_user(string $user)
|
#
|
public
|
_delete_user(string $user)
|
#
|
public
|
_verify_conf(ConfigurationContext $ctx): bool
|
#
|