Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
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
Show more breadcrumbs
justinfreeman (Agileware)
Core
Commits
351669b0
Commit
351669b0
authored
11 years ago
by
Kurund Jalmi
Browse files
Options
Downloads
Plain Diff
Merge pull request #2466 from totten/4.4-dashboard-api-fix
CRM-13889 - api_v3_DashboardContact - Fix validation
parents
5dc21dd8
ee117e9c
Branches
Branches containing commit
Tags
4.4.4
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CRM/Core/BAO/Dashboard.php
+3
-2
3 additions, 2 deletions
CRM/Core/BAO/Dashboard.php
api/v3/DashboardContact.php
+2
-2
2 additions, 2 deletions
api/v3/DashboardContact.php
with
5 additions
and
4 deletions
CRM/Core/BAO/Dashboard.php
+
3
−
2
View file @
351669b0
...
...
@@ -42,12 +42,13 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard {
* Get the list of dashlets enabled by admin
*
* @param boolean $all all or only active
* @param boolean $checkPermission all or only authorized for the current user
*
* @return array $widgets array of dashlets
* @access public
* @static
*/
static
function
getDashlets
(
$all
=
TRUE
)
{
static
function
getDashlets
(
$all
=
TRUE
,
$checkPermission
=
TRUE
)
{
$dashlets
=
array
();
$dao
=
new
CRM_Core_DAO_Dashboard
();
...
...
@@ -59,7 +60,7 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard {
$dao
->
find
();
while
(
$dao
->
fetch
())
{
if
(
!
self
::
checkPermission
(
$dao
->
permission
,
$dao
->
permission_operator
))
{
if
(
$checkPermission
&&
!
self
::
checkPermission
(
$dao
->
permission
,
$dao
->
permission_operator
))
{
continue
;
}
...
...
This diff is collapsed.
Click to expand it.
api/v3/DashboardContact.php
+
2
−
2
View file @
351669b0
...
...
@@ -86,9 +86,9 @@ function _civicrm_api3_dashboard_contact_create_spec(&$params) {
function
_civicrm_api3_dashboard_contact_check_params
(
&
$params
)
{
$dashboard_id
=
CRM_Utils_Array
::
value
(
'dashboard_id'
,
$params
);
if
(
$dashboard_id
)
{
$allDashlets
=
CRM_Core_BAO_Dashboard
::
getDashlets
();
$allDashlets
=
CRM_Core_BAO_Dashboard
::
getDashlets
(
TRUE
,
CRM_Utils_Array
::
value
(
'check_permissions'
,
$params
,
0
)
);
if
(
!
isset
(
$allDashlets
[
$dashboard_id
]))
{
return
civicrm_api3_create_error
(
'Invalid
D
ashboard ID'
);
return
civicrm_api3_create_error
(
'Invalid
or inaccessible d
ashboard ID'
);
}
}
return
NULL
;
...
...
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