35
35
You should customize the ToS notice at :file:`/var/lib/ivle/notices/tos.html`.
37
... delete a user from IVLE?
38
----------------------------
40
This is usually a bad idea since it requires all the references to that user
41
to be removed from IVLE. This may have unintended consequences particularly
42
with groups or projects but might be required in installations where an
43
existing login conflict with a new login (typically encountered when usernames
46
The steps to completely remove a user would be:
48
1. Disable the users account
49
2. Unmount the users jailmount directory (typically
50
:file:`/var/lib/ivle/jailmounts/LOGIN`)
51
3. Backup the user's files (typically :file:`/var/lib/ivle/jails/LOGIN`) and
52
remove this directory.
53
4. Backup the user's repository (typically
54
:file:`/var/lib/ivle/svn/repositories/users/LOGIN` on the subversion
55
server) and remove this directory.
56
5. Make a backup of the IVLE database (``sudo -u postgres pg_dump ivle >
58
6. Either change the users login (``UPDATE login SET login='NEWLOGIN' WHERE
59
login='LOGIN'``) or remove all references to this login in the database
61
The following lines of SQL should remove all traces of a user ``LOGIN`` from
65
DELETE FROM exercise_save USING login WHERE
66
exercise_save.loginid = login.loginid AND login.login = 'LOGIN';
67
DELETE FROM exercise_attempt USING login WHERE
68
exercise_attempt.loginid = login.loginid AND login.login = 'LOGIN';
69
DELETE FROM project_mark USING login WHERE marker = login.loginid AND
70
login.login = 'LOGIN';
71
DELETE FROM project_submission USING login WHERE
72
submitter = login.loginid AND login.login = 'LOGIN';
73
DELETE FROM project_extension USING login WHERE
74
approver = login.loginid AND login.login = 'LOGIN';
75
DELETE FROM assessed USING login WHERE
76
assessed.loginid = login.loginid AND login.login = 'LOGIN';
77
DELETE FROM enrolment USING login WHERE
78
enrolment.loginid = login.loginid AND login.login = 'LOGIN';
79
DELETE FROM group_member USING login WHERE
80
group_member.loginid = login.loginid AND login.login = 'LOGIN';
81
DELETE FROM group_invitation USING login WHERE
82
(group_invitation.loginid = login.loginid OR
83
inviter = login.loginid) AND login.login = 'LOGIN';
84
DELETE FROM project_group USING login WHERE createdby = login.loginid AND
85
login.login = 'LOGIN';
86
DELETE FROM login WHERE login='LOGIN';
89
If you do not want to lose group data, a better option may be to reassign the
90
user ``LOGIN``'s groups to ``NEWLOGIN`` (one possible option would be to
91
create and use a 'nobody' account)::
94
DELETE FROM exercise_save USING login WHERE
95
exercise_save.loginid = login.loginid AND login.login = 'LOGIN';
96
DELETE FROM exercise_attempt USING login WHERE
97
exercise_attempt.loginid = login.loginid AND login.login = 'LOGIN';
98
UPDATE project_mark SET marker = l2.loginid FROM login AS l1, login AS l2
99
WHERE marker = l1.loginid AND l1.login = 'LOGIN' AND l2.login =
101
DELETE FROM project_submission USING login WHERE
102
submitter = login.loginid AND login.login = 'LOGIN';
103
UPDATE project_extension SET approver = l2.loginid FROM
104
login AS l1, login AS l2 WHERE approver = l1.loginid AND
105
l1.login = 'LOGIN' AND l2.login='NEWLOGIN';
106
DELETE FROM assessed USING login WHERE
107
assessed.loginid = login.loginid AND login.login = 'LOGIN';
108
DELETE FROM enrolment USING login WHERE
109
enrolment.loginid = login.loginid AND login.login = 'LOGIN';
110
DELETE FROM group_member USING login WHERE
111
group_member.loginid = login.loginid AND login.login = 'LOGIN';
112
DELETE FROM group_invitation USING login WHERE
113
group_invitation.loginid = login.loginid AND login.login = 'LOGIN';
114
UPDATE group_invitation SET inviter = l2.loginid FROM
115
login AS l1, login AS l2 WHERE inviter = l1.loginid AND
116
l1.login = 'LOGIN' AND l2.login='NEWLOGIN';
117
UPDATE project_group SET createdby = l2.loginid FROM
118
login AS l1, login AS l2 WHERE createdby = l1.loginid AND
119
l1.login = 'LOGIN' AND l2.login = 'NEWLOGIN';
120
DELETE FROM login WHERE login='LOGIN';