Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
vtigercrm
Manage
Activity
Members
Labels
Plan
Issues
514
Issue boards
Milestones
Wiki
Code
Merge requests
83
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
1e64f796
Commit
1e64f796
authored
5 years ago
by
Prasad
Browse files
Options
Downloads
Patches
Plain Diff
Pushing security fixes for 7.1.0
parent
30829c48
No related branches found
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
includes/http/Request.php
+1
-0
1 addition, 0 deletions
includes/http/Request.php
modules/Users/actions/Save.php
+18
-3
18 additions, 3 deletions
modules/Users/actions/Save.php
modules/Users/actions/SaveAjax.php
+2
-3
2 additions, 3 deletions
modules/Users/actions/SaveAjax.php
with
21 additions
and
6 deletions
includes/http/Request.php
+
1
−
0
View file @
1e64f796
...
...
@@ -19,6 +19,7 @@ class Vtiger_Request {
* Default constructor
*/
function
__construct
(
$values
,
$rawvalues
=
array
(),
$stripifgpc
=
true
)
{
Vtiger_Functions
::
validateRequestParameters
(
$values
);
$this
->
valuemap
=
$values
;
$this
->
rawvaluemap
=
$rawvalues
;
if
(
$stripifgpc
&&
!
empty
(
$this
->
valuemap
)
&&
get_magic_quotes_gpc
())
{
...
...
This diff is collapsed.
Click to expand it.
modules/Users/actions/Save.php
+
18
−
3
View file @
1e64f796
...
...
@@ -15,9 +15,20 @@ class Users_Save_Action extends Vtiger_Save_Action {
$record
=
$request
->
get
(
'record'
);
$recordModel
=
Vtiger_Record_Model
::
getInstanceById
(
$record
,
$moduleName
);
$currentUserModel
=
Users_Record_Model
::
getCurrentUserModel
();
if
(
!
Users_Privileges_Model
::
isPermitted
(
$moduleName
,
'Save'
,
$record
)
||
(
$recordModel
->
isAccountOwner
()
&&
$currentUserModel
->
get
(
'id'
)
!=
$recordModel
->
getId
()
&&
!
$currentUserModel
->
isAdminUser
()))
{
throw
new
AppException
(
vtranslate
(
'LBL_PERMISSION_DENIED'
));
// Check for operation access.
$allowed
=
Users_Privileges_Model
::
isPermitted
(
$moduleName
,
'Save'
,
$record
);
if
(
$allowed
)
{
// Deny access if not administrator or account-owner or self
if
(
!
$currentUserModel
->
isAdminUser
())
{
if
(
empty
(
$record
))
{
$allowed
=
false
;
}
else
if
((
$currentUserModel
->
get
(
'id'
)
!=
$recordModel
->
getId
()))
{
$allowed
=
false
;
}
}
}
if
(
!
$allowed
)
{
throw
new
AppException
(
'LBL_PERMISSION_DENIED'
);
}
}
...
...
@@ -58,6 +69,10 @@ class Users_Save_Action extends Vtiger_Save_Action {
if
(
$fieldName
==
'is_owner'
)
{
$fieldValue
=
null
;
}
if
(
$fieldName
==
'roleid'
&&
!
(
$currentUserModel
->
isAdminUser
()))
{
$fieldValue
=
null
;
}
if
(
$fieldValue
!==
null
)
{
if
(
!
is_array
(
$fieldValue
))
{
$fieldValue
=
trim
(
$fieldValue
);
...
...
This diff is collapsed.
Click to expand it.
modules/Users/actions/SaveAjax.php
+
2
−
3
View file @
1e64f796
...
...
@@ -86,7 +86,7 @@ class Users_SaveAjax_Action extends Vtiger_SaveAjax_Action {
$recordModel
->
set
(
$fieldName
,
'off'
);
}
if
(
$fieldName
==
"is_owner"
)
{
if
(
$fieldName
==
"is_owner"
||
$fieldName
==
"roleid"
)
{
$recordId
=
$request
->
get
(
'record'
);
$moduleName
=
$request
->
getModule
();
if
(
!
empty
(
$recordId
))
{
...
...
@@ -137,7 +137,6 @@ class Users_SaveAjax_Action extends Vtiger_SaveAjax_Action {
$recordModel
->
set
(
'status'
,
'Active'
);
$recordModel
->
set
(
'id'
,
$record
);
$recordModel
->
set
(
'mode'
,
'edit'
);
$recordModel
->
set
(
'user_hash'
,
$recordModel
->
getUserHash
());
$recordModel
->
save
();
$db
=
PearDatabase
::
getInstance
();
...
...
@@ -213,4 +212,4 @@ class Users_SaveAjax_Action extends Vtiger_SaveAjax_Action {
}
$response
->
emit
();
}
}
\ No newline at end of file
}
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