File tree Expand file tree Collapse file tree 5 files changed +21
-9
lines changed
Resources/Private/Language Expand file tree Collapse file tree 5 files changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -57,16 +57,16 @@ public function editAction(): ResponseInterface
5757 public function updateAction (User $ user , string $ captcha = null )
5858 {
5959 $ currentUser = UserUtility::getCurrentUser ();
60- $ userValues = $ this ->request ->hasArgument ('user ' ) ? $ this ->request ->getArgument ('user ' ) : null ;
61- $ token = $ this ->request ->hasArgument ('token ' ) ? $ this ->request ->getArgument ('token ' ) : null ;
60+ $ userValues = $ this ->request ->getArgument ('user ' ) ?? [];
61+ $ token = $ this ->request ->getArgument ('token ' ) ?? null ;
62+ $ identity = (int )($ userValues ['__identity ' ] ?? 0 );
63+ $ isSpoof = $ this ->isSpoof ($ currentUser , $ identity , $ token );
64+
65+ if (!$ currentUser instanceof User || $ identity === 0 || $ token === null || $ isSpoof ) {
66+ $ logStatus = $ isSpoof ? Log::STATUS_PROFILEUPDATEATTEMPTEDSPOOF : Log::STATUS_PROFILEUPDATEREFUSEDSECURITY ;
67+ $ logContext = $ isSpoof ? $ currentUser : $ user ;
68+ $ this ->logUtility ->log ($ logStatus , $ logContext );
6269
63- if ($ currentUser === null ||
64- empty ($ userValues ['__identity ' ]) ||
65- (int )$ userValues ['__identity ' ] === null ||
66- $ token === null ||
67- $ this ->isSpoof ($ currentUser , (int )$ userValues ['__identity ' ], $ token )
68- ) {
69- $ this ->logUtility ->log (Log::STATUS_PROFILEUPDATEREFUSEDSECURITY , $ user );
7070 $ this ->addFlashMessage (
7171 LocalizationUtility::translateByState (Log::STATUS_PROFILEUPDATEREFUSEDSECURITY ),
7272 '' ,
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ class Log extends AbstractEntity
2323 final public const STATUS_PROFILEUPDATEREQUEST = 204 ;
2424 final public const STATUS_PROFILEUPDATEREFUSEDSECURITY = 205 ;
2525 final public const STATUS_PROFILEUPDATEIMAGEDELETE = 206 ;
26+ final public const STATUS_PROFILEUPDATEATTEMPTEDSPOOF = 207 ;
2627 final public const STATUS_PROFILEDELETE = 301 ;
2728 final public const STATUS_INVITATIONPROFILECREATED = 401 ;
2829 final public const STATUS_INVITATIONPROFILEDELETEDUSER = 402 ;
Original file line number Diff line number Diff line change 208208 'tx_femanager_domain_model_log.state.206 ' ,
209209 Log::STATUS_PROFILEUPDATEIMAGEDELETE ,
210210 ],
211+ [
212+ 'LLL:EXT:femanager/Resources/Private/Language/locallang_db.xlf: ' .
213+ 'tx_femanager_domain_model_log.state.207 ' ,
214+ Log::STATUS_PROFILEUPDATEATTEMPTEDSPOOF ,
215+ ],
211216 [
212217 'LLL:EXT:femanager/Resources/Private/Language/locallang_db.xlf: ' .
213218 'tx_femanager_domain_model_log.state.300 ' ,
Original file line number Diff line number Diff line change 162162 <trans-unit id =" tx_femanager_domain_model_log.state.206" >
163163 <source >Image deleted</source >
164164 </trans-unit >
165+ <trans-unit id =" tx_femanager_domain_model_log.state.207" >
166+ <source >Attempted to spoof profile</source >
167+ </trans-unit >
165168 <trans-unit id =" tx_femanager_domain_model_log.state.300" >
166169 <source >Delete</source >
167170 </trans-unit >
Original file line number Diff line number Diff line change 174174 <trans-unit id =" tx_femanager_domain_model_log.state.206" >
175175 <source >Image deleted</source >
176176 </trans-unit >
177+ <trans-unit id =" tx_femanager_domain_model_log.state.207" >
178+ <source >Attempted to spoof profile</source >
179+ </trans-unit >
177180 <trans-unit id =" tx_femanager_domain_model_log.state.300" >
178181 <source >Delete</source >
179182 </trans-unit >
You can’t perform that action at this time.
0 commit comments