Browse Source

Hiding document quota for students

Julio Montoya 12 years ago
parent
commit
906fca1e23
2 changed files with 7 additions and 1 deletions
  1. 3 1
      main/document/document.php
  2. 4 0
      main/document/document_quota.php

+ 3 - 1
main/document/document.php

@@ -1163,7 +1163,9 @@ if ($image_present && !isset($_GET['keyword'])) {
     echo '<a href="slideshow.php?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpathurl . '">' . Display::return_icon('slideshow.png', get_lang('ViewSlideshow'), '', ICON_SIZE_MEDIUM) . '</a>';
 }
 
-echo '<a href="document_quota.php?' . api_get_cidreq() . '">' . Display::return_icon('percentage.png', get_lang('DocumentQuota'), '', ICON_SIZE_MEDIUM) . '</a>';
+if (api_is_allowed_to_edit(null, true)) {
+    echo '<a href="document_quota.php?' . api_get_cidreq() . '">' . Display::return_icon('percentage.png', get_lang('DocumentQuota'), '', ICON_SIZE_MEDIUM) . '</a>';
+}
 
 echo '</div>'; //end actions
 

+ 4 - 0
main/document/document_quota.php

@@ -6,6 +6,10 @@ require_once '../inc/global.inc.php';
 
 require_once api_get_path(LIBRARY_PATH).'fileDisplay.lib.php';
 
+if (!api_is_allowed_to_edit(null, true)) {
+    api_not_allowed(true);
+}
+
 $current_course_tool = TOOL_DOCUMENT;
 $this_section = SECTION_COURSES;