diff --git a/admin/settings/security.php b/admin/settings/security.php index 4f2a0388496..58a233d3011 100644 --- a/admin/settings/security.php +++ b/admin/settings/security.php @@ -8,6 +8,7 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page $temp->add(new admin_setting_configcheckbox('protectusernames', get_string('protectusernames', 'admin'), get_string('configprotectusernames', 'admin'), 1)); $temp->add(new admin_setting_configcheckbox('forcelogin', get_string('forcelogin', 'admin'), get_string('configforcelogin', 'admin'), 0)); $temp->add(new admin_setting_configcheckbox('forceloginforprofiles', get_string('forceloginforprofiles', 'admin'), get_string('configforceloginforprofiles', 'admin'), 1)); + $temp->add(new admin_setting_configcheckbox('forceloginforprofileimage', get_string('forceloginforprofileimage', 'admin'), get_string('forceloginforprofileimage_help', 'admin'), 0)); $temp->add(new admin_setting_configcheckbox('opentogoogle', get_string('opentogoogle', 'admin'), get_string('configopentogoogle', 'admin'), 0)); $max_upload_choices = get_max_upload_sizes(); diff --git a/lang/en_utf8/admin.php b/lang/en_utf8/admin.php index 915064e1247..6f88a9960a1 100644 --- a/lang/en_utf8/admin.php +++ b/lang/en_utf8/admin.php @@ -396,6 +396,8 @@ $string['filtersettings'] = 'Manage filters'; $string['filtersettingsgeneral'] = 'General filter settings'; $string['filteruploadedfiles'] = 'Filter uploaded files'; $string['forcelogin'] = 'Force users to login'; +$string['forceloginforprofileimage'] = 'Force users to login to view user pictures'; +$string['forceloginforprofileimage_help'] = 'If enabled, users must login in order to view user profile pictures and the default user picture will be used in all notification emails.'; $string['forceloginforprofiles'] = 'Force users to login for profiles'; $string['forcetimezone'] = 'Force default timezone'; $string['framename'] = 'Frame name'; diff --git a/user/pix.php b/user/pix.php index d37d18b0939..fa0365c5c0e 100644 --- a/user/pix.php +++ b/user/pix.php @@ -6,8 +6,10 @@ require_once('../config.php'); require_once($CFG->libdir.'/filelib.php'); - if (!empty($CFG->forcelogin) and !isloggedin()) { + if ((!empty($CFG->forcelogin) and !isloggedin()) || + (!empty($CFG->forceloginforprofileimage) && (!isloggedin() || isguestuser()))) { // protect images if login required and not logged in; + // also if login is required for profile images and is not logged in or guest // do not use require_login() because it is expensive and not suitable here anyway redirect($CFG->pixpath.'/u/f1.png'); } diff --git a/version.php b/version.php index 483f667f607..948d626e4c7 100644 --- a/version.php +++ b/version.php @@ -6,7 +6,7 @@ // This is compared against the values stored in the database to determine // whether upgrades should be performed (see lib/db/*.php) - $version = 2007101591.08; // YYYYMMDD = date of the 1.9 branch (don't change) + $version = 2007101591.09; // YYYYMMDD = date of the 1.9 branch (don't change) // X = release number 1.9.[0,1,2,3,4,5...] // Y.YY = micro-increments between releases