Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchCourrier
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchCourrier
Commits
ebbc506d
Verified
Commit
ebbc506d
authored
5 years ago
by
Damien
Browse files
Options
Downloads
Patches
Plain Diff
FIX #12070 TIME 0:15 Destination and initiator are integer in webservice
parent
7b7db495
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/resource/controllers/ResController.php
+6
-7
6 additions, 7 deletions
src/app/resource/controllers/ResController.php
src/app/resource/controllers/StoreController.php
+10
-0
10 additions, 0 deletions
src/app/resource/controllers/StoreController.php
with
16 additions
and
7 deletions
src/app/resource/controllers/ResController.php
+
6
−
7
View file @
ebbc506d
...
@@ -781,7 +781,7 @@ class ResController
...
@@ -781,7 +781,7 @@ class ResController
if
(
!
empty
(
$body
[
'initiator'
]))
{
if
(
!
empty
(
$body
[
'initiator'
]))
{
$userEntities
=
UserModel
::
getEntitiesByLogin
([
'login'
=>
$GLOBALS
[
'userId'
]]);
$userEntities
=
UserModel
::
getEntitiesByLogin
([
'login'
=>
$GLOBALS
[
'userId'
]]);
$userEntities
=
array_column
(
$userEntities
,
'
entity_
id'
);
$userEntities
=
array_column
(
$userEntities
,
'id'
);
if
(
!
in_array
(
$body
[
'initiator'
],
$userEntities
))
{
if
(
!
in_array
(
$body
[
'initiator'
],
$userEntities
))
{
return
[
'errors'
=>
"Body initiator does not belong to your entities"
];
return
[
'errors'
=>
"Body initiator does not belong to your entities"
];
}
}
...
@@ -1011,16 +1011,15 @@ class ResController
...
@@ -1011,16 +1011,15 @@ class ResController
$allowedEntities
=
array_unique
(
$allowedEntities
);
$allowedEntities
=
array_unique
(
$allowedEntities
);
}
}
$preparedClause
=
''
;
if
(
!
empty
(
$clauseToProcess
))
{
if
(
!
empty
(
$clauseToProcess
))
{
$preparedClause
=
PreparedClauseController
::
getPreparedClause
([
'clause'
=>
$clauseToProcess
,
'login'
=>
$GLOBALS
[
'userId'
]]);
$preparedClause
=
PreparedClauseController
::
getPreparedClause
([
'clause'
=>
$clauseToProcess
,
'login'
=>
$GLOBALS
[
'userId'
]]);
}
$preparedEntities
=
EntityModel
::
get
([
'select'
=>
[
'id'
],
'where'
=>
[
'enabled = ?'
,
"entity_id in
{
$preparedClause
}
"
],
'data'
=>
[
'Y'
]]);
if
(
!
empty
(
$allow
edEntities
))
{
$preparedEntities
=
array_column
(
$prepar
edEntities
,
'id'
);
$
prepar
edEntities
=
EntityModel
::
get
([
'select'
=>
[
'entity_id'
],
'where'
=>
[
'enabled = ?'
,
'id in (?)'
],
'data'
=>
[
'Y'
,
$allow
edEntities
]]
);
$
allow
edEntities
=
array_merge
(
$allowedEntities
,
$prepar
edEntities
);
$allowedEntities
=
array_
column
(
$preparedEntities
,
'entity_id'
);
$allowedEntities
=
array_
unique
(
$allowedEntities
);
}
}
if
(
!
in_array
(
$body
[
'destination'
],
$allowedEntities
)
&&
strpos
(
$preparedClause
,
$body
[
'destination'
])
===
false
)
{
if
(
!
in_array
(
$body
[
'destination'
],
$allowedEntities
))
{
return
[
'errors'
=>
"Body destination is out of your indexing parameters"
];
return
[
'errors'
=>
"Body destination is out of your indexing parameters"
];
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/app/resource/controllers/StoreController.php
+
10
−
0
View file @
ebbc506d
...
@@ -17,6 +17,7 @@ namespace Resource\controllers;
...
@@ -17,6 +17,7 @@ namespace Resource\controllers;
use
Attachment\models\AttachmentModel
;
use
Attachment\models\AttachmentModel
;
use
Docserver\controllers\DocserverController
;
use
Docserver\controllers\DocserverController
;
use
Entity\models\EntityModel
;
use
IndexingModel\models\IndexingModelModel
;
use
IndexingModel\models\IndexingModelModel
;
use
Resource\models\ChronoModel
;
use
Resource\models\ChronoModel
;
use
SrcCore\models\DatabaseModel
;
use
SrcCore\models\DatabaseModel
;
...
@@ -125,6 +126,15 @@ class StoreController
...
@@ -125,6 +126,15 @@ class StoreController
$chrono
=
ChronoModel
::
getChrono
([
'id'
=>
$indexingModel
[
'category'
],
'entityId'
=>
$args
[
'destination'
],
'typeId'
=>
$args
[
'doctype'
],
'resId'
=>
$args
[
'resId'
]]);
$chrono
=
ChronoModel
::
getChrono
([
'id'
=>
$indexingModel
[
'category'
],
'entityId'
=>
$args
[
'destination'
],
'typeId'
=>
$args
[
'doctype'
],
'resId'
=>
$args
[
'resId'
]]);
}
}
if
(
!
empty
(
$args
[
'initiator'
]))
{
$entity
=
EntityModel
::
getById
([
'id'
=>
$args
[
'initiator'
],
'select'
=>
[
'entity_id'
]]);
$args
[
'initiator'
]
=
$entity
[
'entity_id'
];
}
if
(
!
empty
(
$args
[
'destination'
]))
{
$entity
=
EntityModel
::
getById
([
'id'
=>
$args
[
'destination'
],
'select'
=>
[
'entity_id'
]]);
$args
[
'destination'
]
=
$entity
[
'entity_id'
];
}
if
(
!
empty
(
$args
[
'processLimitDate'
])
&&
!
empty
(
$args
[
'priority'
]))
{
if
(
!
empty
(
$args
[
'processLimitDate'
])
&&
!
empty
(
$args
[
'priority'
]))
{
$args
[
'priority'
]
=
IndexingController
::
calculatePriorityWithProcessLimitDate
([
'processLimitDate'
=>
$args
[
'processLimitDate'
]]);
$args
[
'priority'
]
=
IndexingController
::
calculatePriorityWithProcessLimitDate
([
'processLimitDate'
=>
$args
[
'processLimitDate'
]]);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment