From 7d93be786bec1ed57cbd8e614ab1f3bc2f190b7d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 24 Jun 2010 21:27:19 +0000 Subject: [PATCH] Fix: Permission on projects --- .project | 11 ----------- htdocs/lib/project.lib.php | 2 +- htdocs/projet/index.php | 2 +- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/.project b/.project index 0bbeded6231..395c327ceb0 100644 --- a/.project +++ b/.project @@ -5,16 +5,6 @@ - - org.eclipse.mylyn.wikitext.ui.wikiTextValidationBuilder - - - - - org.eclipse.dltk.core.scriptbuilder - - - org.eclipse.php.core.PhpIncrementalProjectBuilder @@ -28,6 +18,5 @@ org.eclipse.php.core.PHPNature - org.eclipse.mylyn.wikitext.ui.wikiTextNature diff --git a/htdocs/lib/project.lib.php b/htdocs/lib/project.lib.php index 15e0ff8e64c..ca7bdf6fac5 100644 --- a/htdocs/lib/project.lib.php +++ b/htdocs/lib/project.lib.php @@ -626,7 +626,7 @@ function print_projecttasks_array($db,$mine,$socid,$projectsListId) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t ON p.rowid = t.fk_projet"; $sql.= " WHERE p.entity = ".$conf->entity; if ($mine) $sql.= " AND p.rowid IN (".$projectsListId.")"; - if ($socid) $sql.= " AND p.fk_soc = ".$socid; + if ($socid || ! $user->rights->societe->client->voir) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; $sql.= " GROUP BY p.rowid, p.ref, p.title, p.fk_user_creat, p.public, p.fk_statut"; $var=true; diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index c215dfdfd3e..a61fcda47f6 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -84,7 +84,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; $sql.= " WHERE p.entity = ".$conf->entity; if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; -if ($socid) $sql.= " AND s.rowid = ".$socid; +if ($socid || ! $user->rights->societe->client->voir) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; $sql.= " GROUP BY s.nom, s.rowid"; $var=true;