Hide email address by default

Hide email address by default

by Martin O'Mahony -
Number of replies: 3
Due to privacy considerations we would like to set "email display" to "Hide my email address from everyone" by default on users imported via LDAP. How can we achieve that?
Average of ratings: -
In reply to Martin O'Mahony

Re: Hide email address by default

by Martin O'Mahony -
As I haven't received any reply I am tempted to assume that this feature is not implemented. Should I, maybe, suggest it on the tracker? What do you think?
In reply to Martin O'Mahony

Re: Hide email address by default

by Alec Wade -
Using version 1.9.7 I did come up with a workaround that seems to have solved the problem - so far. It's not elegant but it worked.

Open: user/editlib.php

Go to lines 111 to 116 which read

$choices = array();
$choices['0'] = get_string('emaildisplayno');
$choices['1'] = get_string('emaildisplayyes');
$choices['2'] = get_string('emaildisplaycourse');
$mform->addElement('select', 'maildisplay', get_string('emaildisplay'), $choices);
$mform->setDefault('maildisplay', 2);

All I did was swap 0 for 'emaildisplayno' with 2 for 'emaildisplaycourse'

The result looked like:

$choices = array();
$choices['2'] = get_string('emaildisplayno');
$choices['1'] = get_string('emaildisplayyes');
$choices['0'] = get_string('emaildisplaycourse');
$mform->addElement('select', 'maildisplay', get_string('emaildisplay'), $choices);
$mform->setDefault('maildisplay', 2);

Now $mform->setDefault('maildisplay', 2); shows 'emaildisplayno' instead of 'emaildisplaycourse'

Like I said, it's not elegant but it seemed to have worked. Let me know if it works for you.






Average of ratings: Useful (1)
In reply to Alec Wade

Re: Hide email address by default

by Daniel meanock -

Thank You ! For once a simple fix that worked!!!

Thats all i wanted it to do!!! smile