Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
iwl-live
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Anthony.Suerte
iwl-live
Commits
75600e14
Commit
75600e14
authored
Mar 18, 2024
by
iWallet Dev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remittance API Security Enhancement
parent
7813a375
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
5 deletions
+37
-5
MoneyRequest.php
api/MoneyRequest.php
+37
-5
No files found.
api/MoneyRequest.php
View file @
75600e14
...
@@ -168,10 +168,34 @@ class MoneyRequest extends System {
...
@@ -168,10 +168,34 @@ class MoneyRequest extends System {
mkdir
(
$this
->
accessLogDir
,
0777
,
true
);
mkdir
(
$this
->
accessLogDir
,
0777
,
true
);
}
}
$charvalidity
=
[
$this
->
fromAccount
,
$this
->
toAccount
];
foreach
(
$charvalidity
as
$checkaccnum
){
if
(
!
is_numeric
(
$checkaccnum
)){
$this
->
result
[
PARAM_RESULT
]
=
sprintf
(
"%02d"
,
VAL_INT_6
);
$this
->
result
[
PARAM_STATUS
]
=
"CHARACTER_RESTRICTION"
;
$this
->
result
[
"desc"
]
=
"account number must be numeric"
;
goto
ends
;
}
if
(
strlen
(
$checkaccnum
)
>
VAL_INT_8
){
$this
->
result
[
PARAM_RESULT
]
=
sprintf
(
"%02d"
,
VAL_INT_6
);
$this
->
result
[
PARAM_STATUS
]
=
"CHARACTER_LIMIT"
;
$this
->
result
[
"desc"
]
=
"an account number must only have 8 digits"
;
goto
ends
;
}
}
$requestDetails
=
[
$requestDetails
=
[
"IP_Address"
=>
$this
->
getColumnData
(
$_SERVER
,
"REMOTE_ADDR"
),
"IP_Address"
=>
$this
->
getColumnData
(
$_SERVER
,
"REMOTE_ADDR"
),
"Program_Code"
=>
$this
->
pnum
"Program_Code"
=>
$this
->
pnum
];
];
$requestDetails
=
print_r
(
array_merge
(
$requestDetails
,
apache_request_headers
()),
true
);
$requestDetails
=
print_r
(
array_merge
(
$requestDetails
,
apache_request_headers
()),
true
);
$this
->
logDetails
(
$requestDetails
,
VAL_INT_1
);
$this
->
logDetails
(
$requestDetails
,
VAL_INT_1
);
...
@@ -226,6 +250,13 @@ class MoneyRequest extends System {
...
@@ -226,6 +250,13 @@ class MoneyRequest extends System {
$sha
=
hash
(
"sha256"
,
$checkSignature
);
$sha
=
hash
(
"sha256"
,
$checkSignature
);
if
(
$apiUserAccount
!==
$this
->
fromAccount
){
$this
->
result
[
PARAM_RESULT
]
=
sprintf
(
"%02d"
,
VAL_INT_4
);
$this
->
result
[
PARAM_STATUS
]
=
"SENDER_ERROR"
;
goto
ends
;
}
if
(
$this
->
signature
!=
$sha
){
if
(
$this
->
signature
!=
$sha
){
$this
->
result
[
"combination"
]
=
[
$this
->
result
[
"combination"
]
=
[
"real_raw"
=>
$checkSignature
,
"real_raw"
=>
$checkSignature
,
...
@@ -265,6 +296,7 @@ class MoneyRequest extends System {
...
@@ -265,6 +296,7 @@ class MoneyRequest extends System {
$this
->
responseCode
=
406
;
$this
->
responseCode
=
406
;
}
}
ends
:
$this
->
logPost
(
$this
->
pnum
);
$this
->
logPost
(
$this
->
pnum
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment