[Fusionforge-commits] r11695 - trunk/src/plugins/oslc/include/oslc-zend/application/controllers

Sabri LABBENE labbenes at libremir.placard.fr.eu.org
Fri Dec 3 14:34:08 CET 2010


Author: labbenes
Date: 2010-12-03 14:34:08 +0100 (Fri, 03 Dec 2010)
New Revision: 11695

Modified:
   trunk/src/plugins/oslc/include/oslc-zend/application/controllers/CodendiOSLCConnector.php
Log:
check if user is athenticated before serving codendi  projects list.

Modified: trunk/src/plugins/oslc/include/oslc-zend/application/controllers/CodendiOSLCConnector.php
===================================================================
--- trunk/src/plugins/oslc/include/oslc-zend/application/controllers/CodendiOSLCConnector.php	2010-12-03 13:33:48 UTC (rev 11694)
+++ trunk/src/plugins/oslc/include/oslc-zend/application/controllers/CodendiOSLCConnector.php	2010-12-03 13:34:08 UTC (rev 11695)
@@ -273,10 +273,15 @@
         $uM = UserManager::instance();
         $pM = ProjectManager::instance();
         $user = $uM->getCurrentUser();
-        $project_ids = $user->getProjects();
+        if($user->getId() != 0) {
+            $project_ids = $user->getProjects();
+        } else {
+            return $this->createProjectsArray($pM->getAllPublicProjects()); 
+        }
         foreach($project_ids as $id) {
-            $projects[$id] = $pm->getProject($id);
-        } 
+            $projects[$id] = $pM->getProject($id);
+        }
+        $uM->logout(); 
         return $this->createProjectsArray($projects);
 	}
 	




More information about the Fusionforge-commits mailing list