Users can now choose to hide their email address. In this initial version
there are three options: 0) Hide the email address from everyone (except the teacher of their course) 1) Allow everyone to see the email address, all the time. 2) Allow only participants in the same course to see the email address Note, new field maildisplay in 'user'
This commit is contained in:
@@ -99,6 +99,10 @@ line at the top of your web browser window.
|
||||
Cheers from the '\$a->sitename' administrator,
|
||||
\$a->admin";
|
||||
|
||||
$string[emaildisplay] = "Email display";
|
||||
$string[emaildisplayno] = "Hide my real email address from everyone";
|
||||
$string[emaildisplayyes] = "Allow everyone to see my email address";
|
||||
$string[emaildisplaycourse] = "Allow only other course members to see my email address";
|
||||
$string[emailexists] = "This email address is already registered.";
|
||||
$string[emailmustbereal] = "Note: your email address must be a real one";
|
||||
$string[enrolmentkey] = "Enrolment key";
|
||||
|
||||
@@ -66,6 +66,15 @@ if (isadmin()) {
|
||||
choose_from_menu ($choices, "mailformat", $user->mailformat, "") ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td><P><? print_string("emaildisplay") ?>:</td>
|
||||
<td><?
|
||||
$choices["0"] = get_string("emaildisplayno");
|
||||
$choices["1"] = get_string("emaildisplayyes");
|
||||
$choices["2"] = get_string("emaildisplaycourse");
|
||||
choose_from_menu ($choices, "maildisplay", $user->maildisplay, "") ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td><P><? print_string("webpage") ?>:</td>
|
||||
<td><input type="text" name="url" size=30 value="<? p($user->url) ?>">
|
||||
|
||||
+3
-1
@@ -58,7 +58,9 @@ function print_user($user, $course, $string) {
|
||||
echo "<FONT SIZE=-1>";
|
||||
echo "<FONT SIZE=3><B>$user->firstname $user->lastname</B></FONT>";
|
||||
echo "<P>";
|
||||
echo "$string->email: <A HREF=\"mailto:$user->email\">$user->email</A><BR>";
|
||||
if ($user->maildisplay == 1 or ($user->maildisplay == 2 and $course->category) or isteacher($course->id)) {
|
||||
echo "$string->email: <A HREF=\"mailto:$user->email\">$user->email</A><BR>";
|
||||
}
|
||||
echo "$string->location: $user->city, ".$COUNTRIES["$user->country"]."<BR>";
|
||||
echo "$string->lastaccess: ".userdate($user->lastaccess);
|
||||
echo "  (".format_time(time() - $user->lastaccess).")";
|
||||
|
||||
+3
-1
@@ -94,7 +94,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
print_row(get_string("email").":", "<A HREF=\"mailto:$user->email\">$user->email</A>");
|
||||
if ($user->maildisplay == 1 or ($user->maildisplay == 2 and $course->category) or isteacher($course->id)) {
|
||||
print_row(get_string("email").":", "<A HREF=\"mailto:$user->email\">$user->email</A>");
|
||||
}
|
||||
|
||||
if ($user->url) {
|
||||
print_row(get_string("webpage").":", "<A HREF=\"$user->url\">$user->url</A>");
|
||||
|
||||
+5
-1
@@ -17,7 +17,7 @@
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
|
||||
$version = 2002082100;
|
||||
$version = 2002082101;
|
||||
|
||||
function upgrade_moodle($oldversion=0) {
|
||||
|
||||
@@ -51,6 +51,10 @@ function upgrade_moodle($oldversion=0) {
|
||||
execute_sql(" ALTER TABLE `course` CHANGE `guest` `guest` TINYINT(2) UNSIGNED DEFAULT '0' NOT NULL ");
|
||||
}
|
||||
|
||||
if ($oldversion < 2002082101) {
|
||||
execute_sql(" ALTER TABLE `user` ADD `maildisplay` TINYINT(2) UNSIGNED DEFAULT '2' NOT NULL AFTER `mailformat` ");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user