Merge branch 'wip-mdl-35883' of git://github.com/rajeshtaneja/moodle
authorDan Poltawski <dan@moodle.com>
Wed, 10 Apr 2013 04:16:23 +0000 (12:16 +0800)
committerDan Poltawski <dan@moodle.com>
Wed, 10 Apr 2013 04:16:23 +0000 (12:16 +0800)
1  2 
lib/outputrenderers.php

diff --combined lib/outputrenderers.php
@@@ -563,7 -563,9 +563,9 @@@ class core_renderer extends renderer_ba
              $realuser = session_get_realuser();
              $fullname = fullname($realuser, true);
              if ($withlinks) {
-                 $realuserinfo = " [<a href=\"$CFG->wwwroot/course/loginas.php?id=$course->id&amp;sesskey=".sesskey()."\">$fullname</a>] ";
+                 $loginastitle = get_string('loginas');
+                 $realuserinfo = " [<a href=\"$CFG->wwwroot/course/loginas.php?id=$course->id&amp;sesskey=".sesskey()."\"";
+                 $realuserinfo .= "title =\"".$loginastitle."\">$fullname</a>] ";
              } else {
                  $realuserinfo = " [$fullname] ";
              }
              $fullname = fullname($USER, true);
              // Since Moodle 2.0 this link always goes to the public profile page (not the course profile page)
              if ($withlinks) {
-                 $username = "<a href=\"$CFG->wwwroot/user/profile.php?id=$USER->id\">$fullname</a>";
+                 $linktitle = get_string('viewprofile');
+                 $username = "<a href=\"$CFG->wwwroot/user/profile.php?id=$USER->id\" title=\"$linktitle\">$fullname</a>";
              } else {
                  $username = $fullname;
              }
              }
              error_reporting($CFG->debug);
  
 -            // Header not yet printed
 -            if (isset($_SERVER['SERVER_PROTOCOL'])) {
 -                // server protocol should be always present, because this render
 -                // can not be used from command line or when outputting custom XML
 -                @header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');
 +            // Output not yet started.
 +            $protocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0');
 +            if (empty($_SERVER['HTTP_RANGE'])) {
 +                @header($protocol . ' 404 Not Found');
 +            } else {
 +                // Must stop byteserving attempts somehow,
 +                // this is weird but Chrome PDF viewer can be stopped only with 407!
 +                @header($protocol . ' 407 Proxy Authentication Required');
              }
 +
              $this->page->set_context(null); // ugly hack - make sure page context is set to something, we do not want bogus warnings here
              $this->page->set_url('/'); // no url
              //$this->page->set_pagelayout('base'); //TODO: MDL-20676 blocks on error pages are weird, unfortunately it somehow detect the pagelayout from URL :-(