Author: david
Date: Wed Oct 12 16:43:09 2011
New Revision: 10051

Log:
Don't allow viewing or sorting by location if user is not authenticated

Modified:
   trunk/apps/qubit/modules/informationobject/actions/fileListAction.class.php
   trunk/apps/qubit/modules/informationobject/templates/fileListSuccess.php

Modified: 
trunk/apps/qubit/modules/informationobject/actions/fileListAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/fileListAction.class.php 
Wed Oct 12 16:35:18 2011        (r10050)
+++ trunk/apps/qubit/modules/informationobject/actions/fileListAction.class.php 
Wed Oct 12 16:43:09 2011        (r10051)
@@ -42,10 +42,14 @@
         $choices = array(
           'title' => $this->context->i18n->__('Title'),
           'startDate' => $this->context->i18n->__('Date (most recent first)'),
-          'locations' => $this->context->i18n->__('Location'),
-          'referenceCode' => $this->context->i18n->__('Reference code'),
+          'referenceCode' => $this->context->i18n->__('Reference code')
         );
 
+        if ($this->getUser()->isAuthenticated)
+        {
+          $choices['locations'] = $this->context->i18n->__('Location');
+        }
+
         $this->form->setDefault($name, 'title');
         $this->form->setValidator($name, new sfValidatorChoice(array('choices' 
=> array_keys($choices))));
         $this->form->setWidget($name, new sfWidgetFormChoice(array(

Modified: 
trunk/apps/qubit/modules/informationobject/templates/fileListSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/templates/fileListSuccess.php    
Wed Oct 12 16:35:18 2011        (r10050)
+++ trunk/apps/qubit/modules/informationobject/templates/fileListSuccess.php    
Wed Oct 12 16:43:09 2011        (r10051)
@@ -13,7 +13,9 @@
         <th><?php echo __('Title') ?></th>
         <th><?php echo __('Dates') ?></th>
         <th><?php echo __('Access restrictions') ?></th>
+      <?php if ($sf_user->isAuthenticated()): ?>
         <th><?php echo __('Retrival information') ?></th>
+      <?php endif; ?>
       </tr>
     </thead><tbody>
     <?php foreach ($items as $item): ?>
@@ -23,7 +25,9 @@
         <td><?php echo $item['title'] ?></td>
         <td><?php echo $item['dates'] ?></td>
         <td><?php echo isset($item['accessConditions']) ? 
$item['accessConditions'] : __('None') ?></td>
+      <?php if ($sf_user->isAuthenticated()): ?>
         <td><?php echo $item['locations'] ?></td>
+      <?php endif; ?>
       </tr>
     <?php endforeach; ?>
     </tbody>

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to