]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16365 domain restrictions are now optional when changing email address; merged...
authorskodak <skodak>
Wed, 24 Sep 2008 17:00:49 +0000 (17:00 +0000)
committerskodak <skodak>
Wed, 24 Sep 2008 17:00:49 +0000 (17:00 +0000)
admin/settings/users.php
lang/en_utf8/admin.php
user/edit_form.php
version.php

index 2ac82ab6d2d6580c6b691fbf16eb8f89ad112984..af666a44f70da786fdb624f4d52a1b78cad2fdd8 100644 (file)
@@ -27,6 +27,7 @@ if ($hassiteconfig
                                                 get_string('authinstructions', 'auth'), ''));
     $temp->add(new admin_setting_configtext('allowemailaddresses', get_string('allowemailaddresses', 'admin'), get_string('configallowemailaddresses', 'admin'), '', PARAM_NOTAGS));
     $temp->add(new admin_setting_configtext('denyemailaddresses', get_string('denyemailaddresses', 'admin'), get_string('configdenyemailaddresses', 'admin'), '', PARAM_NOTAGS));
+    $temp->add(new admin_setting_configcheckbox('verifychangedemail', get_string('verifychangedemail', 'admin'), get_string('configverifychangedemail', 'admin'), 1));
     
     $temp->add(new admin_setting_configtext('recaptchapublickey', get_string('recaptchapublickey', 'admin'), get_string('configrecaptchapublickey', 'admin'), '', PARAM_NOTAGS));
     $temp->add(new admin_setting_configtext('recaptchaprivatekey', get_string('recaptchaprivatekey', 'admin'), get_string('configrecaptchaprivatekey', 'admin'), '', PARAM_NOTAGS));
index 30de215f860a324c0a75d04f4a82b513d454dcbc..c73841bd44b645e1db755287a0f82ecd0cce30a5 100644 (file)
@@ -255,6 +255,7 @@ $string['configunzip'] = 'Indicate the location of your unzip program (Unix only
 $string['configuseexternalyui'] = 'Instead of using local files, use online files available on Yahoo&#145;s servers. WARNING: This requires an internet connection, or no AJAX will work on your site.';
 $string['configusetags'] = 'Should tags functionality across the site be enabled?';
 $string['configvariables'] = 'Variables';
+$string['configverifychangedemail'] = 'Enables verification of changed email addresses using allowed and denied email domains settings. If this setting is disabled the domains are enforced only when creating new users.';
 $string['configwarning'] = 'Be careful modifying these settings - strange values could cause problems.';
 $string['configxmlstrictheaders'] = 'Set to on, each page will be generated using XML http headers and prolog, so browsers will show XHTML errors inline. This is only useful for developers.';
 $string['configzip'] = 'Indicate the location of your zip program (Unix only, optional).  If specified, this will be used to create zip archives on the server.  If you leave this blank, then Moodle will use internal routines.';
@@ -808,6 +809,7 @@ $string['uuupdatefromfile'] = 'Override with file';
 $string['uuupdatemissing'] = 'Fill in missing from file and defaults';
 $string['uuupdatetype'] = 'Existing user details';
 $string['validateerror'] = 'This value was not valid:';
+$string['verifychangedemail'] = 'Restrict domains when changing email';
 $string['warningcurrentsetting'] = 'Invalid current value: $a';
 $string['webproxy'] = 'Web proxy';
 $string['webproxyinfo'] = 'Fill in following options if your Moodle server can not access internet directly. Internet access is required for download of environment data, language packs, RSS feeds, timezones, etc.<br /><em>PHP cURL extension is highly recommended.</em>';
index 8d849aa6687ad5f191e46c70950fe36192c7e2ec..b18528d2e03061e539ac8650e9793a699d574b99 100644 (file)
@@ -109,6 +109,13 @@ class user_edit_form extends moodleform {
             $errors['email'] = get_string('toomanybounces');
         }
 
+        if (!empty($CFG->verifychangedemail) and !isset($errors['email']) and !has_capability('moodle/user:update', get_context_instance(CONTEXT_SYSTEM))) {
+            $errorstr = email_is_not_allowed($usernew->email);
+            if ($errorstr !== false) {
+                $errors['email'] = $errorstr;
+            }
+        }
+
         /// Next the customisable profile fields
         $errors += profile_validation($usernew, $files);
 
index 7e1fb701dd1195a848e5317b984755b4c0256819..81b54f702220a7e9cd8f722b9546068cd982279e 100644 (file)
@@ -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 = 2008092300;  // YYYYMMDD   = date of the last version bump
+    $version = 2008092400;  // YYYYMMDD   = date of the last version bump
                             //         XX = daily increments
 
     $release = '2.0 dev (Build: 20080924)';  // Human-friendly version name