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
a8d4e67a
Commit
a8d4e67a
authored
14 years ago
by
SNA
Browse files
Options
Downloads
Patches
Plain Diff
Fix : security where clauses are checked in usergroups administration
parent
772ad1da
No related branches found
No related tags found
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/trunk/core/class/SecurityControler.php
+22
-20
22 additions, 20 deletions
core/trunk/core/class/SecurityControler.php
core/trunk/core/class/usergroups_controler.php
+405
-233
405 additions, 233 deletions
core/trunk/core/class/usergroups_controler.php
with
427 additions
and
253 deletions
core/trunk/core/class/SecurityControler.php
+
22
−
20
View file @
a8d4e67a
...
...
@@ -58,7 +58,7 @@ try {
* <li>Get an security object from an id</li>
* <li>Save in the database a security</li>
* <li>Manage the operation on the security table in the database
*
(insert, select, update, delete)</li>
*
(insert, select, update, delete)</li>
*</ul>
* @ingroup core
*/
...
...
@@ -349,39 +349,41 @@ class SecurityControler
}
// TO DO : USE TO CHECK WHERE CLAUSE
public
function
check_where_clause
(
$coll_id
,
$target
,
$where_clause
,
$view
,
$user_id
)
public
function
check_where_clause
(
$coll_id
,
$target
,
$where_clause
,
$view
,
$user_id
)
{
$res
=
array
(
'RESULT'
=>
false
,
'TXT'
=>
''
);
$res
=
array
(
'RESULT'
=>
false
,
'TXT'
=>
''
);
if
(
empty
(
$coll_id
)
||
empty
(
$target
)
||
empty
(
$where
))
{
if
(
empty
(
$coll_id
)
||
empty
(
$target
)
||
empty
(
$where_clause
))
{
$res
[
'TXT'
]
=
_ERROR_PARAMETERS_FUNCTION
;
return
$res
;
}
$where
=
" "
.
$where_clause
;
$where
=
str_replace
(
"
\\
"
,
""
,
$where
);
$where
=
' '
.
$where_clause
;
$where
=
str_replace
(
'
\\
'
,
''
,
$where
);
$where
=
self
::
process_security_where_clause
(
$where
,
$user_id
);
if
(
str_replace
(
" "
,
""
,
$where
)
==
""
)
{
$where
=
""
;
if
(
str_replace
(
' '
,
''
,
$where
)
==
''
){
$where
=
''
;
}
$where
=
str_replace
(
"
where
"
,
" "
,
$where
);
$where
=
str_replace
(
'
where
'
,
' '
,
$where
);
self
::
connect
();
if
(
$target
==
'ALL'
||
$target
==
'DOC'
)
$query
=
"select res_id from "
.
$view
.
" where "
.
$where
;
if
(
$target
==
'ALL'
||
$target
==
'CLASS'
)
$query
=
"select mr_aggregation_id from "
.
$view
.
" where "
.
$where
;
if
(
$target
==
'ALL'
||
$target
==
'DOC'
)
{
$query
=
'select res_id from '
.
$view
.
' where '
.
$where
;
}
if
(
$target
==
'ALL'
||
$target
==
'CLASS'
){
$query
=
'select mr_aggregation_id from '
.
$view
.
' where '
.
$where
;
}
$ok
=
self
::
$db
->
query
(
$query
,
true
);
if
(
!
$ok
)
{
if
(
!
$ok
)
{
$res
[
'TXT'
]
=
_SYNTAX_ERROR_WHERE_CLAUSE
;
return
$res
;
}
else
{
}
else
{
$res
[
'TXT'
]
=
_SYNTAX_OK
;
$res
[
'RESULT'
]
=
true
;
}
...
...
This diff is collapsed.
Click to expand it.
core/trunk/core/class/usergroups_controler.php
+
405
−
233
View file @
a8d4e67a
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