Переглянути джерело

Remove page link when out of course context - see BT#12212

Yannick Warnier 8 роки тому
батько
коміт
c9c9dab49a
2 змінених файлів з 10 додано та 4 видалено
  1. 1 1
      main/mySpace/access_details.php
  2. 9 3
      main/mySpace/myStudents.php

+ 1 - 1
main/mySpace/access_details.php

@@ -27,7 +27,7 @@ $session_id = intval($_GET['id_session']);
 $type = isset($_REQUEST['type']) ? Security::remove_XSS($_REQUEST['type']) : '';
 $course_code = isset($_REQUEST['course']) ? Security::remove_XSS($_REQUEST['course']) : '';
 $courseInfo = api_get_course_info($course_code);
-$courseId = $courseInfo['real_id'];
+$courseId = (!empty($courseInfo['real_id'])?$courseInfo['real_id']:null);
 $connections = MySpace::get_connections_to_course($user_id, $courseId, $session_id);
 $quote_simple = "'";
 

+ 9 - 3
main/mySpace/myStudents.php

@@ -534,10 +534,16 @@ if (!empty($student_id)) {
             <tr>
                 <td><?php echo get_lang('OnLine') . ' : '.$online; ?> </td>
             </tr>
-            <tr>
-                <td><a href="access_details.php?student=<?php echo $student_id; ?>&course=<?php echo $course_code; ?>&origin=<?php echo $origin; ?>&cidReq=<?php echo $course_code; ?>&id_session=<?php echo $sessionId; ?>"><?php echo get_lang('SeeAccesses'); ?></a></td>
-            </tr>
             <?php
+            if (!empty($course_code)) {
+            ?>
+                <tr>
+                    <td>
+                        <a href="access_details.php?student=<?php echo $student_id; ?>&course=<?php echo $course_code; ?>&origin=<?php echo $origin; ?>&cidReq=<?php echo $course_code; ?>&id_session=<?php echo $sessionId; ?>"><?php echo get_lang('SeeAccesses'); ?></a>
+                    </td>
+                </tr>
+            <?php
+            }
 
             // Display timezone if the user selected one and if the admin allows the use of user's timezone
             $timezone = null;