Issue Details (XML | Word | Printable)

Key: MDL-15021
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Petr Skoda
Reporter: Petr Skoda
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Delete not fully setup users - separate admin setting

Created: 27/May/08 10:42 PM   Updated: 03/Jul/08 10:09 PM
Return to search
Component/s: General
Affects Version/s: 1.8, 1.9
Fix Version/s: 1.8.6, 1.9.2

Participants: Martin Dougiamas and Petr Skoda
Security Level: None
Resolved date: 03/Jul/08
Affected Branches: MOODLE_18_STABLE, MOODLE_19_STABLE
Fixed Branches: MOODLE_18_STABLE, MOODLE_19_STABLE


 Description  « Hide
 if (!empty($CFG->deleteunconfirmed)) {
            $cuttime = $timenow - ($CFG->deleteunconfirmed * 3600);
            $rs = get_recordset_sql ("SELECT id, username
                                        FROM {$CFG->prefix}user
                                       WHERE confirmed = *********1***********//this seems wrong
                                         AND lastaccess > 0
                                         AND lastaccess < $cuttime
                                         AND deleted = 0
                                         AND (lastname = '' OR firstname = '' OR email = '')");
            while ($user = rs_fetch_next_record($rs)) {
                if (delete_records('user', 'id', $user->id)) {
                    mtrace("Deleted not fully setup user $user->username ($user->id)");
                }
            }
            rs_close($rs);
        }


 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Petr Skoda added a comment - 27/May/08 10:43 PM
We need to evaluate this more, but this definitely seems wrong and may result in major data loss.

Petr Skoda added a comment - 27/May/08 10:48 PM
imo it should do normal delete, because data might already exist in system
also it should not abuse the $CFG->deleteunconfirmed and have own setting

Martin Dougiamas added a comment - 27/May/08 11:04 PM - edited
Yes it needs a new setting (deleteincompleteusers default 0) and yes I agree it should do a normal delete.

confirmed is probably correct as 1


Petr Skoda added a comment - 03/Jul/08 06:00 PM
working on this...

Petr Skoda added a comment - 03/Jul/08 10:09 PM
fixed in cvs