[Fusionforge-commits] FusionForge branch master updated. c8076f69969b8e94d6c5b99f94cc5f1dbe3f109e

Franck Villaume nerville at fusionforge.org
Fri May 23 17:10:29 CEST 2014


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, master has been updated
       via  c8076f69969b8e94d6c5b99f94cc5f1dbe3f109e (commit)
      from  623a4938aa69a03274de2e1225673817a892e6e7 (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 -----------------------------------------------------------------
commit c8076f69969b8e94d6c5b99f94cc5f1dbe3f109e
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Fri May 23 17:09:08 2014 +0200

    frs: add standard validation

diff --git a/src/www/frs/index.php b/src/www/frs/index.php
index ead6d34..eb6e5ac 100644
--- a/src/www/frs/index.php
+++ b/src/www/frs/index.php
@@ -30,8 +30,28 @@ require_once $gfcommon.'frs/include/frs_utils.php';
 require_once $gfcommon.'frs/FRSPackageFactory.class.php';
 
 global $HTML;
+/* are we using frs ? */
+if (!forge_get_config('use_frs'))
+	exit_disabled('home');
 
 $group_id = getIntFromRequest('group_id');
+/* validate group */
+if (!$group_id)
+	exit_no_group();
+
+$g = group_get_object($group_id);
+if (!$g || !is_object($g))
+	exit_no_group();
+
+/* is this group using FRS ? */
+if (!$g->usesFRS())
+	exit_disabled();
+
+if ($g->isError())
+	exit_error($g->getErrorMessage(), 'frs');
+
+session_require_perm('frs', $group_id, 'read_public');
+
 $release_id = getIntFromRequest('release_id');
 
 // Allow alternate content-type rendering by hook
@@ -57,13 +77,8 @@ if($content_type != $default_content_type) {
 	exit(0);
 }
 
-$cur_group = group_get_object($group_id);
-
-if (!$cur_group) {
-	exit_no_group();
-}
 
-$fpFactory = new FRSPackageFactory($cur_group);
+$fpFactory = new FRSPackageFactory($g);
 if (!$fpFactory || !is_object($fpFactory)) {
 	exit_error(_('Could Not Get FRSPackageFactory'), 'frs');
 } elseif ($fpFactory->isError()) {

-----------------------------------------------------------------------

Summary of changes:
 src/www/frs/index.php |   27 +++++++++++++++++++++------
 1 file changed, 21 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list