Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'wip-MDL-20627-MOODLE_19_STABLE' of git://github.com/abg…

…reeve/moodle into MOODLE_19_STABLE
  • Loading branch information...
commit fdcc0f46cc228cc7bb9c566ffe65c385b651cb9f 2 parents 51c6d45 + 8f83cfb
Eloy Lafuente (stronk7) stronk7 authored
1  lang/en_utf8/moodle.php
@@ -503,6 +503,7 @@
503 503 $string['emaildisableclick'] = 'Click here to disable all email from being sent to this address';
504 504 $string['emaildisplay'] = 'Email display';
505 505 $string['emaildisplaycourse'] = 'Allow only other course members to see my email address';
  506 +$string['emaildisplayhidden'] = 'Email hidden';
506 507 $string['emaildisplayno'] = 'Hide my email address from everyone';
507 508 $string['emaildisplayyes'] = 'Allow everyone to see my email address';
508 509 $string['emailenable'] = 'This email address is enabled';
8 user/message.html
@@ -56,7 +56,13 @@
56 56 $course->teacher = get_string('defaultcourseteacher');
57 57 }
58 58 foreach ($SESSION->emailto[$id] as $user) {
59   - echo '<tr><td>'.fullname($user,true).'</td><td>'.$user->email.'</td><td>';
  59 + echo '<tr><td>'.fullname($user,true).'</td>';
  60 + // Check to see if we should be showing the email address.
  61 + if ($user->maildisplay == 0 ) { // 0 = don't display my email to anyone.
  62 + echo '<td>' . get_string('emaildisplayhidden') . '</td><td>';
  63 + } else {
  64 + echo '<td>'.$user->email.'</td><td>';
  65 + }
60 66 if ($user->teacher) {
61 67 echo '<img src="'.$CFG->pixpath.'/t/user.gif" alt="'.$course->teacher.'" title="'.$course->teacher.'"/>';
62 68 }
2  user/messageselect.php
@@ -46,7 +46,7 @@
46 46 foreach ($_POST as $k => $v) {
47 47 if (preg_match('/^(user|teacher)(\d+)$/',$k,$m)) {
48 48 if (!array_key_exists($m[2],$SESSION->emailto[$id])) {
49   - if ($user = get_record_select('user','id = '.$m[2],'id,firstname,lastname,idnumber,email,emailstop,mailformat,lastaccess')) {
  49 + if ($user = get_record_select('user','id = '.$m[2],'id,firstname,lastname,idnumber,email,emailstop,mailformat,lastaccess,maildisplay')) {
50 50 $SESSION->emailto[$id][$m[2]] = $user;
51 51 $SESSION->emailto[$id][$m[2]]->teacher = ($m[1] == 'teacher');
52 52 $count++;

0 comments on commit fdcc0f4

Please sign in to comment.
Something went wrong with that request. Please try again.