mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-31 01:35:15 +02:00
[DEV-161] Add apikey to ticket comment path (#1173)
* update ticket comment path * update validations * remove useless line
This commit is contained in:
parent
c64eb9930b
commit
f890fdc2d3
@ -42,8 +42,7 @@ class CommentController extends Controller {
|
|||||||
private $imagePaths;
|
private $imagePaths;
|
||||||
|
|
||||||
public function validations() {
|
public function validations() {
|
||||||
$this->session = Session::getInstance();
|
$validations = [
|
||||||
return [
|
|
||||||
'permission' => 'user',
|
'permission' => 'user',
|
||||||
'requestData' => [
|
'requestData' => [
|
||||||
'content' => [
|
'content' => [
|
||||||
@ -56,6 +55,15 @@ class CommentController extends Controller {
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
if(Controller::request('captcha')){
|
||||||
|
$validations['permission'] = 'any';
|
||||||
|
$validations['requestData']['captcha'] = [
|
||||||
|
'validation' => DataValidator::captcha(APIKey::TICKET_CREATE_PERMISSION),
|
||||||
|
'error' => ERRORS::INVALID_CAPTCHA
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $validations;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handler() {
|
public function handler() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user