Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
vtigercrm
Manage
Activity
Members
Labels
Plan
Issues
517
Issue boards
Milestones
Wiki
Code
Merge requests
84
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Welcome to Vtiger Community. To gain access for account, please contact [ community @ vtiger.com ]
Show more breadcrumbs
vtiger
vtigercrm
Commits
2d49bde7
Commit
2d49bde7
authored
11 months ago
by
Prasad
Browse files
Options
Downloads
Patches
Plain Diff
Fix to send neutral response for forgotpassword
parent
ad9f6faf
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/vtiger/modules/CustomerPortal/modules/CustomerPortal/apis/ForgotPassword.php
+8
-3
8 additions, 3 deletions
...omerPortal/modules/CustomerPortal/apis/ForgotPassword.php
with
8 additions
and
3 deletions
pkg/vtiger/modules/CustomerPortal/modules/CustomerPortal/apis/ForgotPassword.php
+
8
−
3
View file @
2d49bde7
...
@@ -16,6 +16,10 @@ class CustomerPortal_ForgotPassword extends CustomerPortal_API_Abstract {
...
@@ -16,6 +16,10 @@ class CustomerPortal_ForgotPassword extends CustomerPortal_API_Abstract {
$user
=
new
Users
();
$user
=
new
Users
();
$current_user
=
$user
->
retrieveCurrentUserInfoFromFile
(
$userId
);
$current_user
=
$user
->
retrieveCurrentUserInfoFromFile
(
$userId
);
// send back neutral response to avoid CRM system state or user enumeration attacks.
$neutralResponse
=
new
CustomerPortal_API_Response
();
// set this to false in case you need specific response.
$neutralResponse
->
setResult
(
vtranslate
(
'LBL_MAIL_SENT'
,
'HelpDesk'
));
$response
=
new
CustomerPortal_API_Response
();
$response
=
new
CustomerPortal_API_Response
();
$mailid
=
$request
->
get
(
'email'
);
$mailid
=
$request
->
get
(
'email'
);
$current_date
=
date
(
"Y-m-d"
);
$current_date
=
date
(
"Y-m-d"
);
...
@@ -68,14 +72,15 @@ class CustomerPortal_ForgotPassword extends CustomerPortal_API_Abstract {
...
@@ -68,14 +72,15 @@ class CustomerPortal_ForgotPassword extends CustomerPortal_API_Abstract {
}
}
$response
->
setResult
(
$ret_msg
);
$response
->
setResult
(
$ret_msg
);
}
else
if
(
$isActive
&&
$support_end_date
<=
$current_date
)
{
}
else
if
(
$isActive
&&
$support_end_date
<=
$current_date
)
{
throw
new
Exception
(
'Access to the portal was disabled on '
.
$support_end_date
,
1413
);
if
(
!
$neutralResponse
)
throw
new
Exception
(
'Access to the portal was disabled on '
.
$support_end_date
,
1413
);
}
else
if
(
$isActive
==
0
)
{
}
else
if
(
$isActive
==
0
)
{
throw
new
Exception
(
'Portal access has not been enabled for this account.'
,
1414
);
if
(
!
$neutralResponse
)
throw
new
Exception
(
'Portal access has not been enabled for this account.'
,
1414
);
}
}
}
else
{
}
else
{
$response
->
setError
(
'1412'
,
'Invalid email'
);
$response
->
setError
(
'1412'
,
'Invalid email'
);
}
}
return
$response
;
return
$neutralResponse
?
$neturalResponse
:
$response
;
}
}
function
authenticatePortalUser
(
$username
,
$password
)
{
function
authenticatePortalUser
(
$username
,
$password
)
{
...
...
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