History | Log In     View a printable version of the current page.  
We are currently focused especially on Moodle 2.0, Moodle 1.9.x bugs and Moodle 1.9.x testing.    Confused? Lost? Please read this introduction to the Tracker.
Issue Details (XML | Word | Printable)

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

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
Component/s: General
Affects Version/s: 1.8, 1.9
Fix Version/s: 1.8.6, 1.9.2

Participants: Martin Dougiamas and Petr Škoda
Security Level: None


 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 Škoda - 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 Škoda - 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 - 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 Škoda - 03/Jul/08 06:00 PM
working on this...

Petr Škoda - 03/Jul/08 10:09 PM
fixed in cvs