Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
6cad2ac1
Commit
6cad2ac1
authored
15 years ago
by
Regis Houssin
Browse files
Options
Downloads
Patches
Plain Diff
Works on enhancement of project tasks
Fix: security check
parent
6d675fc8
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/projet/tasks/fiche.php
+2
-0
2 additions, 0 deletions
htdocs/projet/tasks/fiche.php
htdocs/projet/tasks/task.class.php
+9
-8
9 additions, 8 deletions
htdocs/projet/tasks/task.class.php
with
11 additions
and
8 deletions
htdocs/projet/tasks/fiche.php
+
2
−
0
View file @
6cad2ac1
...
...
@@ -270,6 +270,8 @@ else
$tasksarray
=
$task
->
getTasksArray
(
0
,
0
,
$project
->
id
,
$socid
,
0
);
// We load also tasks limited to a particular user
$tasksrole
=
(
$_REQUEST
[
"mode"
]
==
'mine'
?
$task
->
getUserRolesForProjectsOrTasks
(
0
,
$user
,
$project
->
id
,
0
)
:
''
);
//var_dump($tasksarray);
//var_dump($tasksrole);
print
'<table class="noborder" width="100%">'
;
print
'<tr class="liste_titre">'
;
...
...
This diff is collapsed.
Click to expand it.
htdocs/projet/tasks/task.class.php
+
9
−
8
View file @
6cad2ac1
...
...
@@ -442,11 +442,12 @@ class Task extends CommonObject
//print $usert.'-'.$userp.'-'.$projectid.'-'.$socid.'-'.$mode.'<br>';
// List of tasks (does not care about permissions. Filtering will be done later)
$sql
=
"SELECT p.rowid as projectid, p.ref, p.title as plabel, p.public
,
"
;
$sql
.
=
" t.rowid, t.label, t.fk_task_parent, t.duration_effective"
;
$sql
=
"SELECT p.rowid as projectid, p.ref, p.title as plabel, p.public"
;
$sql
.
=
"
,
t.rowid
as taskid
, t.label, t.fk_task_parent, t.duration_effective"
;
if
(
$mode
==
0
)
{
$sql
.
=
" FROM ("
.
MAIN_DB_PREFIX
.
"projet as p, "
.
MAIN_DB_PREFIX
.
"projet_task as t)"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"projet as p"
;
$sql
.
=
", "
.
MAIN_DB_PREFIX
.
"projet_task as t"
;
$sql
.
=
" WHERE t.fk_projet = p.rowid"
;
$sql
.
=
" AND p.entity = "
.
$conf
->
entity
;
if
(
$socid
)
$sql
.
=
" AND p.fk_soc = "
.
$socid
;
...
...
@@ -476,9 +477,9 @@ class Task extends CommonObject
$obj
=
$this
->
db
->
fetch_object
(
$resql
);
if
((
!
$obj
->
public
)
&&
(
$userp
||
$usert
))
// If not public and we ask a filter on user
if
((
!
$obj
->
public
)
&&
(
is_object
(
$userp
)
||
is_object
(
$usert
))
)
// If not public and we ask a filter on user
{
if
(
!
$this
->
getUserRolesForProjectsOrTasks
(
$userp
,
$usert
,
$obj
->
projectid
,
$obj
->
row
id
))
if
(
!
$this
->
getUserRolesForProjectsOrTasks
(
$userp
,
$usert
,
$obj
->
projectid
,
$obj
->
task
id
))
{
$error
++
;
}
...
...
@@ -486,7 +487,7 @@ class Task extends CommonObject
if
(
!
$error
)
{
$tasks
[
$i
]
->
id
=
$obj
->
row
id
;
$tasks
[
$i
]
->
id
=
$obj
->
task
id
;
$tasks
[
$i
]
->
projectid
=
$obj
->
projectid
;
$tasks
[
$i
]
->
projectref
=
$obj
->
ref
;
$tasks
[
$i
]
->
projectlabel
=
$obj
->
plabel
;
...
...
@@ -542,8 +543,8 @@ class Task extends CommonObject
$sql
.
=
" AND ec.statut = 4"
;
if
(
$projectid
)
{
if
(
$userp
)
$sql
.
=
" AND pt.fk_projet = "
.
$projectid
;
if
(
$usert
)
$sql
.
=
" AND pt.rowid = "
.
$taskid
;
if
(
$userp
||
$usert
)
$sql
.
=
" AND pt.fk_projet = "
.
$projectid
;
//
if ($usert) $sql.= " AND pt.rowid = ".$taskid;
}
if
(
$taskid
)
{
...
...
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