Browse Source

Merge branch 'master' of github.com:chamilo/chamilo-lms

Julio Montoya 12 years ago
parent
commit
f28124e490
3 changed files with 12 additions and 5 deletions
  1. 7 4
      main/inc/global.inc.php
  2. 4 1
      main/inc/lib/main_api.lib.php
  3. 1 0
      main/inc/lib/usermanager.lib.php

+ 7 - 4
main/inc/global.inc.php

@@ -209,7 +209,7 @@ $app['allowed'] = true;
 $app['template.show_header'] = true;
 $app['template.show_footer'] = true;
 $app['template.show_learnpath'] = false;
-$app['template.hide_global_chat'] = !api_is_global_chat_enabled();
+$app['template.hide_global_chat'] = true;
 $app['template.load_plugins'] = true;
 
 // Default template style
@@ -356,6 +356,9 @@ $app['this_section'] = SECTION_GLOBAL;
 // include the local (contextual) parameters of this course or section
 require $includePath.'/local.inc.php';
 
+// reconfigure templat now we know the user
+$app['template.hide_global_chat'] = !api_is_global_chat_enabled();
+
 // Setting languages
 $app['api_get_languages'] = api_get_languages();
 
@@ -533,7 +536,7 @@ if (api_get_setting('login_is_email') == 'true') {
     $default_username_length = 100;
 }
 
-define('USERNAME_MAX_LENGTH', $default_username_length);
+@define('USERNAME_MAX_LENGTH', $default_username_length);
 
 /** Silex Middlewares: */
 
@@ -650,7 +653,7 @@ if (empty($default_quota)) {
     $default_quota = 100000000;
 }
 
-define('DEFAULT_DOCUMENT_QUOTA', $default_quota);
+@define('DEFAULT_DOCUMENT_QUOTA', $default_quota);
 
 /** Setting the is_admin key */
 $app['is_admin'] = false;
@@ -662,4 +665,4 @@ require_once 'routes.php';
 $_course = api_get_course_info();
 $_cid = api_get_course_id();
 
-return $app;
+return $app;

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

@@ -6157,6 +6157,9 @@ function api_user_is_login($user_id = null) {
 function api_get_real_ip(){
     // Guess the IP if behind a reverse proxy
     global $debug;
+    if (PHP_SAPI === 'cli' && !isset($_SERVER['REMOTE_ADDR'])) {
+        $_SERVER['REMOTE_ADDR'] = 'localhost';
+    }
     $ip = trim($_SERVER['REMOTE_ADDR']);
     if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
         list($ip1,$ip2) = split(',',$_SERVER['HTTP_X_FORWARDED_FOR']);
@@ -6902,4 +6905,4 @@ function api_get_web_default_course_document()
 }
 
 function load_translations($app) {
-}
+}

+ 1 - 0
main/inc/lib/usermanager.lib.php

@@ -2432,6 +2432,7 @@ class UserManager
             // First take $row2, as it contains less data and this data is enough
             while ($row2 = Database::fetch_array($result2)) {
                 $join[] = $row2;
+                $ordered_join[] = $row2;
                 $ids[] = $row2['id'];
             }
         }