diff --git a/blocks/admin/block_admin.php b/blocks/admin/block_admin.php
index 71100875f32..069e5d28d1f 100644
--- a/blocks/admin/block_admin.php
+++ b/blocks/admin/block_admin.php
@@ -89,6 +89,17 @@ class block_admin extends block_base {
} else {
$this->content->items[]=''.get_string('turneditingon').'';
}
+
+ if (!$course->student) {
+ $course->student = get_string('defaultcoursestudent');
+ }
+
+ if (!isset($USER->realuser) and
+ $student = get_field_sql('SELECT userid FROM '.$CFG->prefix.'user_students WHERE course = '.$course->id.' LIMIT 1')) {
+ $this->content->icons[]='
';
+ $this->content->items[]=''.get_string('loginas').' '.$course->student.'';
+ }
+
$this->content->items[]=''.get_string('settings').'...';
$this->content->icons[]='
';