|
|
const | MEM_UNUSED = 0 |
| |
|
const | MEM_FORCE_RESET = 2 |
| |
|
const | MEM_LOGIN_FAILED_EMAIL = 4 |
| |
|
const | MEM_LOGIN_FAILED_QST = 8 |
| |
|
const | MEM_LOGIN_FAILED_PWD = 16 |
| |
|
const | MEM_ASKBPAY = 32 |
| |
|
const | MEM_LOGIN_FAILED_ALIAS = 64 |
| |
|
const | MEM_LOGIN_FAILED_SAC = 128 |
| |
|
const | MEM_LOGIN_FAILED_BNDL = 256 |
| |
|
const | MEM_LOGIN_FAILED_BNDL_TIMEOUT = 512 |
| |
|
const | MSGTX_TRANSFER = 1 |
| |
|
const | MSGTX_ES = 2 |
| |
|
const | MSGTX_WEBCONNECT = 4 |
| |
|
const | MSGTX_TMP_SURVEY = 8 |
| |
|
const | MSGTX_TMP_XAC_RQ = 16 |
| |
|
const | MSGTX_TMP_XAX_LD = 32 |
| |
|
const | MSGTX_INTUITUPD = 64 |
| |
|
const | MSGTX_TXNDOWN = 128 |
| |
|
const | MSGTX_TMP_MKT = 256 |
| |
|
const | MSGTX_FORCE_EM = 512 |
| |
|
const | MSGTX_PASSCHG = 1024 |
| |
|
const | MSGTX_ONLINEDISC = 2048 |
| |
|
const | MSGTX_PROMOHIDE = 4096 |
| |
|
const | MSGTX_STICKY = 8192 |
| |
|
const | HCUTEMP_FLAGS = 49464 |
| |
|
| $data = [] |
| |
|
| $isUserLoaded = false |
| |
|
|
| $username |
| |
|
| $creditUnion |
| |
|
| $userRepo |
| |
|
| $dirtyFields = [] |
| |
| | $allowedProperties |
| |
| | $derivedProperties |
| |
Model containing user login information
Definition at line 7 of file User.php.
◆ __construct()
| User::__construct |
( |
string |
$username, |
|
|
string |
$creditUnion, |
|
|
UserRepo |
$userRepo |
|
) |
| |
User constructor.
- Parameters
-
| string | $username | |
| String | $cu | |
| UserRepo | $userRepo | |
Definition at line 71 of file User.php.
72 if (!strlen($username) || preg_match(
"/[\\\`,\"\s;]/", $username)) {
73 throw new Exception(static::class .
": invalid username [$username]");
76 if (!strlen($creditUnion)) {
77 throw new Exception(static::class .
": invalid credit union [$cu]");
80 if (!$userRepo instanceof
UserRepo) {
81 throw new Exception(static::class .
": need instance of UserRepo");
83 $this->username = $username;
84 $this->creditUnion = $creditUnion;
85 $this->userRepo = $userRepo;
◆ __get()
| User::__get |
( |
string |
$propertyName | ) |
|
Magic method returns allowed properties
- Parameters
-
- Returns
- mixed|null
- Exceptions
-
Definition at line 96 of file User.php.
97 if (in_array($propertyName, array_merge($this->allowedProperties, $this->derivedProperties))) {
98 return $this->data[$propertyName] ??
null;
100 throw new Exception(static::class .
": Property [$propertyName] does not exist.");
◆ __isset()
| User::__isset |
( |
String |
$propertyName | ) |
|
Magic method to check for existence of a property. Needed for functions like 'empty'
- Parameters
-
- Returns
- bool
Definition at line 128 of file User.php.
129 return !empty($this->data[$propertyName]);
◆ __set()
| User::__set |
( |
string |
$propertyName, |
|
|
string |
$value |
|
) |
| |
Magic method sets allowed properties
- Parameters
-
| string | $propertyName | |
| string | $value | |
- Exceptions
-
Definition at line 112 of file User.php.
113 if (in_array($propertyName, array_merge($this->allowedProperties))) {
114 $this->data[$propertyName] = $value;
115 $this->dirtyFields[] = $propertyName;
117 throw new Exception(static::class .
": Property [$propertyName] does not exist.");
◆ DecodeMFAJson()
| User::DecodeMFAJson |
( |
array |
$mfaJson | ) |
|
|
private |
Convert MFA data into a assoc array with this schema. This structure includes both challenge answer and secure code data. [ mfacount: Number of challenge answers answers: Assoc array of question ids and answers challenge: Active challenge question id. Does not seem to be used anymore authcode: Active secure access code authexpires: Active Secure access code expiration mfadate: Challenge answers save timestamp ]
- Parameters
-
| array | $mfaJson | Array of challenge questions from database |
- Returns
- array
Definition at line 163 of file User.php.
165 'mfacount' => HCU_array_key_exists(
'answers', $mfaJson) ? count($mfaJson[
'answers']) : 0,
166 'answers' => HCU_array_key_exists(
'answers', $mfaJson) ?? [],
167 'challenge' => HCU_array_key_exists(
'challenge', $mfaJson) ? intval($mfaJson[
'challenge']) : 0,
168 'authcode' => HCU_array_key_exists(
'authcode', $mfaJson) ? strtolower($mfaJson[
'authcode']) : null,
169 'authexpires' => HCU_array_key_exists(
'authexpires', $mfaJson) ? intval($mfaJson[
'authexpires']) : null,
170 'mfadate' => HCU_array_key_exists(
'mfadate', $mfaJson) ? intval($mfaJson[
'mfadate']) : 0,
◆ Load()
Load the user model with data
- Exceptions
-
Definition at line 137 of file User.php.
138 $this->data = $this->userRepo->Read($this->username);
141 throw new Exception(static::class .
": Invalid user '$this->username' for credit union {$this->creditUnion}.");
143 $this->isUserLoaded =
true;
145 $this->data[
'mfaquest'] = $this->
DecodeMFAJson(HCU_JsonDecode($this->data[
'mfaquest']));
146 $this->data[
'freset'] = $this->userflags & static::MEM_FORCE_RESET;
DecodeMFAJson(array $mfaJson)
◆ $allowedProperties
Initial value:= [
'confidence',
'cuuser_group_id',
'email',
'failedremain',
'fchange',
'flog',
'fremain',
'llog',
'mfaquest',
'msg_tx',
'passwd',
'pchange',
'primary_account',
'savecqid',
'user_id',
'user_name',
'userflags',
]
Definition at line 41 of file User.php.
◆ $derivedProperties
Initial value:
Definition at line 60 of file User.php.
The documentation for this class was generated from the following file: