Browse Source

Fixing login button see #6768

Julio Montoya 10 years ago
parent
commit
f57467a900
2 changed files with 8 additions and 5 deletions
  1. 6 4
      main/inc/lib/main_api.lib.php
  2. 2 1
      main/template/default/layout/menu.tpl

+ 6 - 4
main/inc/lib/main_api.lib.php

@@ -3044,11 +3044,11 @@ function api_not_allowed($print_headers = false, $message = null)
 
     global $this_section;
 
-    //if (empty($user_id)) {
+    if (empty($user_id)) {
 
-    // Why the CustomPages::enabled() need to be to set the request_uri
-    $_SESSION['request_uri'] = $_SERVER['REQUEST_URI'];
-    //}
+        // Why the CustomPages::enabled() need to be to set the request_uri
+        $_SESSION['request_uri'] = $_SERVER['REQUEST_URI'];
+    }
 
     if (CustomPages::enabled() && !isset($user_id)) {
         CustomPages::display(CustomPages::INDEX_UNLOGGED);
@@ -3073,6 +3073,8 @@ function api_not_allowed($print_headers = false, $message = null)
 
     $tpl = new Template(null, $show_headers, $show_headers);
 
+    $tpl->assign('hide_login_link', 1);
+
     $tpl->assign('content', $msg);
     if (($user_id!=0 && !api_is_anonymous()) && (!isset($course) || $course == -1) && empty($_GET['cidReq'])) {
         // if the access is not authorized and there is some login information

+ 2 - 1
main/template/default/layout/menu.tpl

@@ -45,8 +45,9 @@
                     </li>
                 </ul>
                 {% else %}
+
                     {# Direct login to course - no visible if logged and on the index page #}
-                    {% if course_code != "" %}
+                    {% if course_code != "" and hide_login_link is null %}
                         <ul class="nav pull-right">
                             <li class="dropdown" style="color:white;">
                                 <a href='{{ _p.web }}main/auth/gotocourse.php?firstpage={{ course_code }}'>