From: Franck Villaume Date: Wed, 6 Mar 2013 19:48:48 +0000 (+0100) Subject: merge Branch_5_2 X-Git-Tag: v5.3-rc1~1526 X-Git-Url: https://scm.fusionforge.org/anonscm/gitweb?p=fusionforge%2Ffusionforge.git;a=commitdiff_plain;h=93fd7e8d254da0bba78a0fd60cc6b24da980bce9;hp=a83105370f6ae6959bff4f35fd37dc959a531e1e merge Branch_5_2 --- diff --git a/src/common/include/session.php b/src/common/include/session.php index f1274752e2..c07b036325 100644 --- a/src/common/include/session.php +++ b/src/common/include/session.php @@ -5,6 +5,7 @@ * Copyright 1999-2001, VA Linux Systems, Inc. * Copyright 2001-2002, 2009, Roland Mas * Copyright 2004-2005, GForge, LLC + * Copyright 2013, Franck Villaume - TrivialDev * * This file is part of FusionForge. FusionForge is free software; * you can redistribute it and/or modify it under the terms of the @@ -432,9 +433,9 @@ function session_require($req, $reason='') { * fails checks. * */ -function session_require_perm ($section, $reference, $action = NULL, $reason='') { - if (!forge_check_perm ($section, $reference, $action)) { - exit_permission_denied ($reason,''); +function session_require_perm($section, $reference, $action = NULL, $reason='') { + if (!forge_check_perm($section, $reference, $action)) { + exit_permission_denied($reason, $section); } } @@ -445,13 +446,13 @@ function session_require_perm ($section, $reference, $action = NULL, $reason='') * fails checks. * */ -function session_require_global_perm ($section, $action = NULL, $reason='') { - if (!forge_check_global_perm ($section, $action)) { +function session_require_global_perm($section, $action = NULL, $reason='') { + if (!forge_check_global_perm($section, $action)) { if (!$reason) { - $reason = sprintf (_('Permission denied. The %s administrators will have to grant you permission to view this page.'), + $reason = sprintf(_('Permission denied. The %s administrators will have to grant you permission to view this page.'), forge_get_config ('forge_name')) ; } - exit_permission_denied ($reason,''); + exit_permission_denied($reason, $section); } } diff --git a/src/www/scm/index.php b/src/www/scm/index.php index 9647dd70a1..9a928d8b2e 100644 --- a/src/www/scm/index.php +++ b/src/www/scm/index.php @@ -3,6 +3,7 @@ * SCM Frontend * * Copyright 2004 (c) Roland Mas, Tim Perdue -GForge LLC + * Copyright 2013, Franck Villaume - TrivialDev * * This file is part of FusionForge. FusionForge is free software; * you can redistribute it and/or modify it under the terms of the @@ -30,6 +31,8 @@ if (!$group || !is_object($group)) { exit_no_group(); } +session_require_perm('scm', $group_id, 'read'); + // Check if there is an associated scm plugin and issue a warning if none. $scm_plugin = ''; foreach (PluginManager::instance()->GetPlugins() as $p) {