[Fusionforge-commits] r15944 - branches/Branch_5_2/src/www/search/include/renderers

Olivier Meunier musicoliv at fusionforge.org
Wed Jul 4 19:13:44 CEST 2012


Author: musicoliv
Date: 2012-07-04 19:13:43 +0200 (Wed, 04 Jul 2012)
New Revision: 15944

Modified:
   branches/Branch_5_2/src/www/search/include/renderers/DocsAllHtmlSearchRenderer.class.php
Log:
DocsAllHtmlSearchRenderer ctor: puts permission checks related to the current user inside session_loggedin scope (fixes a php notice)



Modified: branches/Branch_5_2/src/www/search/include/renderers/DocsAllHtmlSearchRenderer.class.php
===================================================================
--- branches/Branch_5_2/src/www/search/include/renderers/DocsAllHtmlSearchRenderer.class.php	2012-07-04 16:53:03 UTC (rev 15943)
+++ branches/Branch_5_2/src/www/search/include/renderers/DocsAllHtmlSearchRenderer.class.php	2012-07-04 17:13:43 UTC (rev 15944)
@@ -38,21 +38,17 @@
 	 *
 	 */
 	function DocsAllHtmlSearchRenderer($words, $offset, $isExact, $sections = SEARCH__ALL_SECTIONS) {
-		$nbGroups 		= 0;
 		$parametersValues 	= array();
 
 		if (session_loggedin()) {
 			$u =& session_get_user();
 			$listGroups = $u->getGroups();
-		}
-
-		if (count($listGroups) > 0) {
-			foreach ($listGroups as $group) {
-				$userIsGroupMember = forge_check_perm('docman', $group->getID(), 'read');
-				$parametersValues[$group->getID()]=$userIsGroupMember;
+			if (count($listGroups) > 0) {
+				foreach ($listGroups as $group) {
+					$userIsGroupMember = forge_check_perm('docman', $group->getID(), 'read');
+					$parametersValues[$group->getID()]=$userIsGroupMember;
+				}
 			}
-		} else {
-			$parametersValues = array();
 		}
 
 		$searchQuery = new DocsAllSearchQuery($words, $offset, $isExact , $sections, $parametersValues);




More information about the Fusionforge-commits mailing list