[Fusionforge-commits] FusionForge branch master updated. bd0a1a73e7be6b2a60e26bc200b16bac5c58722d

Franck VILLAUME nerville at fusionforge.org
Fri Aug 30 16:06:06 CEST 2013


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  bd0a1a73e7be6b2a60e26bc200b16bac5c58722d (commit)
      from  02baf9a2243cda5424b6781fb74cefef4f54d9c8 (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 bd0a1a73e7be6b2a60e26bc200b16bac5c58722d
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Fri Aug 30 16:05:32 2013 +0200

    search : merge patch #549 : return no match found when project is private

diff --git a/src/www/search/include/renderers/ProjectHtmlSearchRenderer.class.php b/src/www/search/include/renderers/ProjectHtmlSearchRenderer.class.php
index 97e052d..62a1f08 100644
--- a/src/www/search/include/renderers/ProjectHtmlSearchRenderer.class.php
+++ b/src/www/search/include/renderers/ProjectHtmlSearchRenderer.class.php
@@ -4,6 +4,7 @@
  *
  * Copyright 1999-2001 (c) VA Linux Systems
  * Copyright 2004 (c) Guillaume Smet / Open Wide
+ * Copyright 2013, French Ministry of National Education
  * http://fusionforge.org
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -103,7 +104,15 @@ class ProjectHtmlSearchRenderer extends HtmlSearchRenderer {
 		if ($this->getResultId('type') == 2) {
 			session_redirect('/foundry/'.$project_name.'/');
 		} else {
-			header('Location: '.util_make_url_g($project_name,$project_id));
+			if (forge_check_perm ('project_read', $project_id)) {
+				header('Location: '.util_make_url_g($project_name,$project_id));
+			} else {
+				$this->writeHeader();
+				$html = '<h2>'.sprintf(_('Search results for <em>%1$s</em>'), $project_name).'</h2>';
+				$html .= '<p><strong>'.sprintf(_('No matches found for <em>%1$s</em>'), $project_name).'</strong></p>';
+				echo $html;
+				$this->writeFooter();
+			}
 		}
 		exit();
 	}

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

Summary of changes:
 .../include/renderers/ProjectHtmlSearchRenderer.class.php   |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list