]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15021 Deleted not fully setup separate admin settings; merged from MOODLE_18_STAB...
authorskodak <skodak>
Thu, 3 Jul 2008 14:09:27 +0000 (14:09 +0000)
committerskodak <skodak>
Thu, 3 Jul 2008 14:09:27 +0000 (14:09 +0000)
admin/cron.php
admin/settings/server.php
lang/en_utf8/admin.php

index 3ace8d8f1833cabae8fe509534636ffad6dc99dc..a1ef00456927a9a713162eefd4c776e32d76be1b 100644 (file)
 
         /// Delete users who haven't completed profile within required period
 
-        if (!empty($CFG->deleteunconfirmed)) {
-            $cuttime = $timenow - ($CFG->deleteunconfirmed * 3600);
+        if (!empty($CFG->deleteincompleteusers)) {
+            $cuttime = $timenow - ($CFG->deleteincompleteusers * 3600);
             $rs = $DB->get_recordset_sql ("SELECT id, username
                                              FROM {user}
                                             WHERE confirmed = 1 AND lastaccess > 0
                                                   AND (lastname = '' OR firstname = '' OR email = '')",
                                           array($cuttime));
             foreach ($rs as $user) {
-                if ($DB->delete_records('user', array('id'=>$user->id))) {
+                if (delete_user($user)) {
                     mtrace("Deleted not fully setup user $user->username ($user->id)");
                 }
             }
index 472f106e87402b038eb426fb705b6517b5d2e4a7..7e7b79901e0559cfce5a3d17d436208a8f64ecd0 100644 (file)
@@ -187,6 +187,15 @@ $temp->add(new admin_setting_configselect('deleteunconfirmed', get_string('delet
                                                                                                                                                                     6 => get_string('numhours', '', 6),
                                                                                                                                                                     1 => get_string('numhours', '', 1))));
 
+$temp->add(new admin_setting_configselect('deleteincompleteusers', get_string('deleteincompleteusers', 'admin'), get_string('configdeleteincompleteusers', 'admin'), 0, array(0 => get_string('never'),
+                                                                                                                                                                    168 => get_string('numdays', '', 7),
+                                                                                                                                                                    144 => get_string('numdays', '', 6),
+                                                                                                                                                                    120 => get_string('numdays', '', 5),
+                                                                                                                                                                    96 => get_string('numdays', '', 4),
+                                                                                                                                                                    72 => get_string('numdays', '', 3),
+                                                                                                                                                                    48 => get_string('numdays', '', 2),
+                                                                                                                                                                    24 => get_string('numdays', '', 1))));
+
 $temp->add(new admin_setting_configselect('loglifetime', get_string('loglifetime', 'admin'), get_string('configloglifetime', 'admin'), 0, array(0 => get_string('neverdeletelogs'),
                                                                                                                                                 1000 => get_string('numdays', '', 1000),
                                                                                                                                                 365 => get_string('numdays', '', 365),
index f5c4dff00f3215d2143551513e319952658dcd9e..dc27e8a95962069333d8f059888f4b0a2a2bbc8a 100644 (file)
@@ -88,6 +88,7 @@ $string['configdefaultcourseroleid'] = 'Users who enrol in a course will be auto
 $string['configdefaultrequestcategory'] = 'Courses requested by users will be automatically placed in this category.';
 $string['configdefaultrequestedcategory'] = 'Default category to put courses that were requested into, if they\'re approved.';
 $string['configdefaultuserroleid'] = 'All logged in users will be given the capabilities of the role you specify here, at the site level, in ADDITION to any other roles they may have been given.  The default is the Authenticated user role (or Guest role in older versions).  Note that this will not conflict with other roles they have, it just ensures that all users have capabilities that are not assignable at the course level (eg post blog entries, manage own calendar, etc).';
+$string['configdeleteincompleteusers'] = 'After this period, old not fully setup accounts are deleted.';
 $string['configdeleteunconfirmed'] = 'If you are using email authentication, this is the period within which a response will be accepted from users.  After this period, old unconfirmed accounts are deleted.';
 $string['configdenyemailaddresses'] = 'To deny email addresses from particular domains list them here in the same way.  All other domains will be accepted. To deny subdomains add the domain with a preceding \'.\'. eg <strong>hotmail.com yahoo.co.uk .live.com</strong>';
 $string['configdigestmailtime'] = 'People who choose to have emails sent to them in digest form will be emailed the digest daily. This setting controls which time of day the daily mail will be sent (the next cron that runs after this hour will send it).';
@@ -292,7 +293,8 @@ $string['defaultsettinginfo'] = 'Default: $a';
 $string['defaultuserroleid'] = 'Default role for all users';
 $string['defaultvalues'] = 'Default values';
 $string['deleteerrors'] = 'Delete errors';
-$string['deleteunconfirmed'] = 'Delete unconfirmed users after';
+$string['deleteincompleteusers'] = 'Delete incomplete users after';
+$string['deleteunconfirmed'] = 'Delete not fully setup users after';
 $string['deleteuser'] = 'Delete user';
 $string['density'] = 'Density';
 $string['denyemailaddresses'] = 'Denied email domains';