Skip to content
Browse files

MDL-29844 Administration: Added new config for users to login for vie…

…wing profile image
  • Loading branch information...
1 parent ea5534f commit 4ed11995247b47033d4cd58eb75bc7101a431ef5 Rajesh Taneja committed Jan 3, 2012
Showing with 7 additions and 2 deletions.
  1. +1 −0 admin/settings/security.php
  2. +2 −0 lang/en_utf8/admin.php
  3. +3 −1 user/pix.php
  4. +1 −1 version.php
View
1 admin/settings/security.php
@@ -8,6 +8,7 @@
$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();
View
2 lang/en_utf8/admin.php
@@ -396,6 +396,8 @@
$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';
View
4 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');
}
View
2 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

0 comments on commit 4ed1199

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