This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".
The branch, 6.1 has been updated
via f41f03cec5ec0e927e5dfb055cceaa1199ce9bbc (commit)
from e3c4d374c61afde78f3e0b52f10b276404cebc25 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=f41f03cec5ec0e927e5dfb055cceaa1199ce9bbc
commit f41f03cec5ec0e927e5dfb055cceaa1199ce9bbc
Author: Franck Villaume <[email protected]>
Date: Sat Dec 30 18:23:04 2017 +0100
docman, limit visibility on nb of docs & directories to active when user
has no approve permissions
diff --git a/src/common/docman/DocumentManager.class.php
b/src/common/docman/DocumentManager.class.php
index d9dac55..9a72395 100644
--- a/src/common/docman/DocumentManager.class.php
+++ b/src/common/docman/DocumentManager.class.php
@@ -460,12 +460,20 @@ class DocumentManager extends FFError {
}
function getNbDocs() {
- $res = db_query_params('SELECT count(docid) as docs FROM
doc_data WHERE group_id = $1', array($this->Group->getID()));
+ $qpa = db_construct_qpa(false, 'SELECT count(docid) as docs
FROM doc_data WHERE group_id = $1', array($this->Group->getID()));
+ if (!forge_check_perm('docman', $this->Group->getID(),
'approve')) {
+ $qpa = db_construct_qpa($qpa, ' AND stateid = $1',
array(1));
+ }
+ $res = db_query_qpa($qpa);
return db_result($res, 0, 0);
}
function getNbFolders() {
- $res = db_query_params('SELECT count(doc_group) as folders FROM
doc_groups WHERE group_id = $1', array($this->Group->getID()));
+ $qpa = db_construct_qpa(false, 'SELECT count(doc_group) as
folders FROM doc_groups WHERE group_id = $1', array($this->Group->getID()));
+ if (!forge_check_perm('docman', $this->Group->getID(),
'approve')) {
+ $qpa = db_construct_qpa($qpa, ' AND stateid = $1',
array(1));
+ }
+ $res = db_query_qpa($qpa);
return db_result($res, 0, 0);
}
}
-----------------------------------------------------------------------
Summary of changes:
src/common/docman/DocumentManager.class.php | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits