<table cellpadding=9 cellspacing=0 >
<tr valign=top>
- <td align=right><p>lang:</td>
- <td>
+ <td align=right><p>lang:</td>
+ <td>
<?php choose_from_menu (get_list_of_languages(), "lang", $config->lang, "", "", ""); ?>
</td>
<td>
</td>
</tr>
<tr valign=top>
- <td align=right><p>langmenu:</td>
- <td>
+ <td align=right><p>langmenu:</td>
+ <td>
<?php
unset($options);
$options[0] = get_string("no");
</td>
</tr>
<tr valign=top>
- <td align=right><p>langlist:</td>
- <td>
+ <td align=right><p>langlist:</td>
+ <td>
<input name=langlist type=text size=40 value="<?php p($config->langlist) ?>">
</td>
<td>
</td>
</tr>
<tr valign=top>
- <td align=right><p>locale:</td>
- <td>
+ <td align=right><p>locale:</td>
+ <td>
<input name=locale type=text size=10 value="<?php p($config->locale) ?>">
</td>
<td>
</td>
</tr>
<tr valign=top>
- <td align=right><p>timezone:</td>
+ <td align=right><p>timezone:</td>
<td><?php
if (abs($config->timezone) > 13) {
$config->timezone = 99;
</td>
</tr>
<tr valign=top>
- <td align=right><p>country:</td>
- <td><?php choose_from_menu (get_list_of_countries(), "country", $config->country, get_string("selectacountry"), "") ?>
- </td>
+ <td align=right><p>country:</td>
+ <td><?php choose_from_menu (get_list_of_countries(), "country", $config->country, get_string("selectacountry"), "") ?>
+ </td>
<td>
<?php print_string("configcountry") ?>
</td>
</tr>
<tr valign=top>
- <td align=right><p>smtphosts:</td>
- <td>
+ <td align=right><p>smtphosts:</td>
+ <td>
<input name=smtphosts type=text size=30 value="<?php p($config->smtphosts)?>">
</td>
<td>
</td>
</tr>
<tr valign=top>
- <td align=right><p>smtpuser:</td>
- <td>
+ <td align=right><p>smtpuser:</td>
+ <td>
<input name=smtpuser type=text size=10 value="<?php p($config->smtpuser)?>">
</td>
<td rowspan=2>
</td>
</tr>
<tr valign=top>
- <td align=right><p>smtppass:</td>
- <td>
+ <td align=right><p>smtppass:</td>
+ <td>
<input name=smtppass type=text size=10 value="<?php p($config->smtppass)?>">
</td>
-</TR>
+</tr>
<tr valign=top>
- <td align=right><p>gdversion:</td>
- <td>
+ <td align=right><p>noreplyaddress:</td>
+ <td>
+ <input name=noreplyaddress type=text size=30 value="<?php p($config->noreplyaddress)?>">
+ </td>
+ <td>
+ <?php print_string("confignoreplyaddress") ?>
+ </td>
+</tr>
+<tr valign=top>
+ <td align=right><p>gdversion:</td>
+ <td>
<?php
unset($options);
$options[0] = get_string("gdnot");
</td>
</tr>
<tr valign=top>
- <td align=right><p>maxeditingtime:</td>
- <td>
+ <td align=right><p>maxeditingtime:</td>
+ <td>
<?php
unset($options);
$options[3600] = get_string("numminutes", "", 60);
</td>
</tr>
<tr valign=top>
- <td align=right><p>longtimenosee:</td>
- <td>
+ <td align=right><p>longtimenosee:</td>
+ <td>
<?php
unset($options);
$options[1000] = get_string("numdays", "", 1000);
</td>
</tr>
<tr valign=top>
- <td align=right><p>deleteunconfirmed:</td>
- <td>
+ <td align=right><p>deleteunconfirmed:</td>
+ <td>
<?php
unset($options);
$options[0] = get_string("never");
</td>
</tr>
<tr valign=top>
- <td align=right><p>loglifetime:</td>
- <td>
+ <td align=right><p>loglifetime:</td>
+ <td>
<?php
unset($options);
$options[0] = get_string("neverdeletelogs");
</td>
</tr>
<tr valign=top>
- <td align=right><p>sessiontimeout:</td>
- <td>
+ <td align=right><p>sessiontimeout:</td>
+ <td>
<?php
unset($options);
$options[14400] = get_string("numhours", "", 4);
</td>
</tr>
<tr valign=top>
- <td align=right><p>sessioncookie:</td>
- <td>
+ <td align=right><p>sessioncookie:</td>
+ <td>
<input name=sessioncookie type=text size=10 value="<?php p($config->sessioncookie)?>">
</td>
<td>
</td>
</tr>
<tr valign=top>
- <td align=right><p>zip:</td>
- <td>
+ <td align=right><p>zip:</td>
+ <td>
<input name=zip type=text size=30 value="<?php p($config->zip) ?>">
</td>
<td>
</td>
</tr>
<tr valign=top>
- <td align=right><p>unzip:</td>
- <td>
+ <td align=right><p>unzip:</td>
+ <td>
<input name=unzip type=text size=30 value="<?php p($config->unzip) ?>">
</td>
<td>
</td>
</tr>
<tr valign=top>
- <td align=right><p>slasharguments:</td>
- <td>
+ <td align=right><p>slasharguments:</td>
+ <td>
<?php unset($options);
$options[0] = "file.php?file=/pic.jpg";
$options[1] = "file.php/pic.jpg";
</td>
</tr>
<tr valign=top>
- <td align=right><p>proxyhost:</td>
- <td>
+ <td align=right><p>proxyhost:</td>
+ <td>
<input name=proxyhost type=text size=30 value="<?php p($config->proxyhost) ?>">
</td>
<td rowspan=2>
</td>
</TR>
<tr valign=top>
- <td align=right><p>proxyport:</td>
- <td>
+ <td align=right><p>proxyport:</td>
+ <td>
<input name=proxyport type=text size=5 value="<?php p($config->proxyport) ?>">
</td>
</tr>
<tr valign=top>
- <td align=right><p>debug:</td>
- <td>
+ <td align=right><p>debug:</td>
+ <td>
<?php
unset($options);
$options[7] = get_string("no");
</td>
</tr>
<tr valign=top>
- <td align=right><p>framename:</td>
- <td>
+ <td align=right><p>framename:</td>
+ <td>
<?php
if (empty($config->framename)) {
$config->framename = "_top";
</td>
</tr>
<tr valign=top>
- <td align=right><p>secureforms:</td>
- <td>
+ <td align=right><p>secureforms:</td>
+ <td>
<?php
unset($options);
$options[0] = get_string("no");
</td>
</tr>
<tr valign=top>
- <td align=right><p>teacherassignteachers:</td>
- <td>
+ <td align=right><p>teacherassignteachers:</td>
+ <td>
<?php
unset($options);
$options[0] = get_string("no");
</td>
</tr>
<tr valign=top>
- <td align=right><p>allowunenroll:</td>
- <td>
+ <td align=right><p>allowunenroll:</td>
+ <td>
<?php
unset($options);
$options[0] = get_string("no");
</td>
</tr>
<tr valign=top>
- <td align=right><p>maxbytes:</td>
- <td>
+ <td align=right><p>maxbytes:</td>
+ <td>
<?php
$options = get_max_upload_sizes();
choose_from_menu ($options, "maxbytes", $config->maxbytes, "");
</td>
</tr>
<tr valign=top>
- <td align=right><p>fullnamedisplay:</td>
- <td>
+ <td align=right><p>fullnamedisplay:</td>
+ <td>
<?php
unset($options);
$options['language'] = get_string('language');
</td>
</tr>
<tr valign=top>
- <td align=right><p>extendedusernamechars:</td>
- <td>
+ <td align=right><p>extendedusernamechars:</td>
+ <td>
<?php
unset($options);
$options[0] = get_string("no");
</td>
</tr>
<tr valign=top>
- <td align=right><p>forcelogin:</td>
- <td>
+ <td align=right><p>forcelogin:</td>
+ <td>
<?php
unset($options);
$options[0] = get_string('no');
</td>
</tr>
<tr valign=top>
- <td align=right><p>forceloginforprofiles:</td>
- <td>
+ <td align=right><p>forceloginforprofiles:</td>
+ <td>
<?php
unset($options);
$options[0] = get_string('no');
</td>
</tr>
<tr valign=top>
- <td align=right><p>opentogoogle:</td>
- <td>
+ <td align=right><p>opentogoogle:</td>
+ <td>
<?php
unset($options);
$options[0] = get_string("no");
<td align=right><p>digestmailtime:</td>
<td>
<?php
- $hours = array();
- for ($i=0; $i<=23; $i++) {
- $hours[$i] = sprintf("%02d",$i);
- }
+ $hours = array();
+ for ($i=0; $i<=23; $i++) {
+ $hours[$i] = sprintf("%02d",$i);
+ }
choose_from_menu($hours, 'digestmailtime', $config->digestmailtime, "");
?>
</td>
<tr>
<td colspan=3 align=center>
- <input type="submit" value="<?php print_string("savechanges") ?>"></td>
+ <input type="submit" value="<?php print_string("savechanges") ?>"></td>
</tr>
</table>
$string['configlongpost'] = 'Any post over this length (not including HTML) is considered long.';
$string['configmanydiscussions'] = 'Maximum number of discussions shown in a forum per page';
$string['configmaxbytes'] = 'Default maximum size for all forum attachments on the site (subject to course limits and other local settings)';
+$string['configreplytouser'] = 'When a forum post is mailed out, should it contain the user\'s email address so that recipients can reply personally rather than via the forum? Even if set to \'Yes\' users can choose in their profile to keep their email address secret.';
$string['configshortpost'] = 'Any post under this length (not including HTML) is considered short.';
$string['couldnotadd'] = 'Could not add your post due to an unknown error';
$string['couldnotdeleteratings'] = 'Sorry, that cannot be deleted as people have already rated it';
$string['nonews'] = 'No news has been posted yet';
$string['noposts'] = 'No posts';
$string['nopostscontaining'] = 'No posts containing \'$a\' were found';
+$string['noreply'] = '';
$string['nosubscribers'] = 'There are no subscribers yet for this forum';
$string['notingroup'] = 'Sorry, but you need to be part of a group to see this forum.';
$string['nownotsubscribed'] = '$a->name will NOT receive copies of \'$a->forum\' by email.';
$string['configlongtimenosee'] = 'If students haven\'t logged in for a very long time, then they are automatically unsubscribed from courses. This parameter specifies that time limit.';
$string['configmaxbytes'] = 'This specifies a maximum size that uploaded files can be throughout the whole site. This setting is limited by the PHP setting upload_max_filesize and the Apache setting LimitRequestBody. In turn, maxbytes limits the range of sizes that can be chosen at course level or module level.';
$string['configmaxeditingtime'] = 'This specifies the amount of time people have to re-edit forum postings, journal feedback etc. Usually 30 minutes is a good value.';
+$string['confignoreplyaddress'] = 'When Moodle sends out emails on behalf of a user then this address is used as the return address in cases where the recipients should not reply to the user directly.';
$string['configopentogoogle'] = 'If you enable this setting, then Google will be allowed to enter your site as a Guest. In addition, people coming in to your site via a Google search will automatically be logged in as a Guest. Note that this only provides transparent access to courses that already allow guest access.';
$string['configproxyhost'] = 'If this <B>server</B> needs to use a proxy computer (eg a firewall) to access the Internet, then provide the proxy hostname and port here. Otherwise leave it blank.';
$string['configsecureforms'] = 'Moodle can use an additional level of security when accepting data from web forms. If this is enabled, then the browser\'s HTTP_REFERER variable is checked against the current form address. In a very few cases this can cause problems if the user is using a firewall (eg Zonealarm) configured to strip HTTP_REFERER from their web traffic. Symptoms are getting \'stuck\' on a form. If your users are having problems with the login page (for example) you might want to disable this setting, although it might leave your site more open to brute-force password attacks. If in doubt, leave this set to \'Yes\'.';
"longtimenosee" => 100,
"maxbytes" => 0,
"maxeditingtime" => 1800,
+ "noreplyaddress" => 'noreply@'.$_SERVER['HTTP_HOST'],
"opentogoogle" => false,
"prefix" => "",
"proxyhost" => "",
/// CORRESPONDENCE ////////////////////////////////////////////////
-function email_to_user($user, $from, $subject, $messagetext, $messagehtml="", $attachment="", $attachname="") {
+function email_to_user($user, $from, $subject, $messagetext, $messagehtml="", $attachment="", $attachname="", $usetrueaddress=true) {
/// user - a user record as an object
/// from - a user record as an object
/// subject - plain text subject line of the email
/// messagehtml - complete html version of the message (optional)
/// attachment - a file on the filesystem, relative to $CFG->dataroot
/// attachname - the name of the file (extension indicates MIME)
+/// usetrueaddress - determines whether $from email address should be sent out.
+/// Will be overruled by user profile setting for maildisplay
global $CFG, $_SERVER;
$mail->Sender = "$adminuser->email";
- $mail->From = "$from->email";
- $mail->FromName = fullname($from);
+ if ($usetrueaddress and $from->maildisplay) {
+ $mail->From = "$from->email";
+ $mail->FromName = fullname($from);
+ } else {
+ $mail->From = "$CFG->noreplyaddress";
+ $mail->FromName = fullname($from).' '.get_string('noreply', 'forum');
+ }
$mail->Subject = stripslashes($subject);
$mail->AddAddress("$user->email", fullname($user) );
<table cellpadding=9 cellspacing=0 >
<tr valign=top>
- <td align=right><p>forum_displaymode:</td>
- <td>
+ <td align=right><p>forum_displaymode:</td>
+ <td>
<?php choose_from_menu ($FORUM_LAYOUT_MODES, "forum_displaymode", $CFG->forum_displaymode, "", "", ""); ?>
</td>
<td>
</td>
</tr>
<tr valign=top>
- <td align=right><p>forum_shortpost:</td>
- <td>
+ <td align=right><p>forum_replytouser:</td>
+ <td>
+ <?php
+ unset($options);
+ $options[0] = get_string("no");
+ $options[1] = get_string("yes");
+ choose_from_menu ($options, "forum_replytouser", $CFG->forum_replytouser, "", "", "");
+ ?>
+ </td>
+ <td>
+ <?php print_string("configreplytouser", "forum") ?>
+ </td>
+</tr>
+<tr valign=top>
+ <td align=right><p>forum_shortpost:</td>
+ <td>
<input name=forum_shortpost type=text size=5 value="<?php p($CFG->forum_shortpost) ?>">
</td>
<td>
</td>
</tr>
<tr valign=top>
- <td align=right><p>forum_longpost:</td>
- <td>
+ <td align=right><p>forum_longpost:</td>
+ <td>
<input name=forum_longpost type=text size=5 value="<?php p($CFG->forum_longpost) ?>">
</td>
<td>
</td>
</tr>
<tr valign=top>
- <td align=right><p>forum_manydiscussions:</td>
- <td>
+ <td align=right><p>forum_manydiscussions:</td>
+ <td>
<input name=forum_manydiscussions type=text size=5 value="<?php p($CFG->forum_manydiscussions) ?>">
</td>
<td>
</td>
</tr>
<tr valign=top>
- <td align=right><p>forum_maxbytes:</td>
+ <td align=right><p>forum_maxbytes:</td>
<td><?php
$choices = get_max_upload_sizes($CFG->maxbytes);
choose_from_menu ($choices, "forum_maxbytes", $CFG->forum_maxbytes, "");
<tr>
<td colspan=3 align=center>
- <input type="submit" value="<?php print_string("savechanges") ?>"></td>
+ <input type="submit" value="<?php print_string("savechanges") ?>"></td>
</tr>
</table>
$posttext = forum_make_mail_text($course, $forum, $discussion, $post, $userfrom, $userto);
$posthtml = forum_make_mail_html($course, $forum, $discussion, $post, $userfrom, $userto);
- if (! email_to_user($userto, $userfrom, $postsubject, $posttext, $posthtml)) {
+ if (! email_to_user($userto, $userfrom, $postsubject, $posttext, $posthtml, '', '', $CFG->forum_replytouser)) {
echo "Error: mod/forum/cron.php: Could not send out mail for id $post->id to user $userto->id ($userto->email) .. not trying again.\n";
add_to_log($course->id, 'forum', 'mail error', "discuss.php?d=$discussion->id#$post->id", substr($post->subject,0,15), $cm->id, $userto->id);
$errorcount++;
$posthtml .= '<hr size="1" noshade="noshade" /></p>';
}
- if (! email_to_user($userto, $userfrom, $postsubject, $posttext, $posthtml)) {
+ if (! email_to_user($userto, $userfrom, $postsubject, $posttext, $posthtml, '', '', $CFG->forum_replytouser)) {
echo "ERROR!\n";
echo "Error: mod/forum/cron.php: Could not send out digest mail to user $userto->id ($userto->email)... not trying again.\n";
add_to_log($course->id, 'forum', 'mail digest error', '', '', $cm->id, $userto->id);