summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-03-15 15:08:16 -0700
committerBrion Vibber <brion@pobox.com>2010-03-15 16:08:00 -0700
commit441e52718e4db4eb45bd5c76c5af446496f56f96 (patch)
treecc64045cb8368ecdf05ab8dcc87ef252965c3805 /classes
parent9ec24f59ca61bbbb45667b548a872e724f31ab3e (diff)
Background deletion of user accounts. Notices are deleted in chunks, then the user itself when they're all gone.
While deletion is in progress, the account is locked with the 'deleted' role, which disables all actions with rights control. Todo: * Pretty up the notice on the profile page about the pending delete. Show status? * Possibly more thorough account disabling, such as disallowing all use for login and access. * Improve error recovery; worst case is that an account gets left locked in 'deleted' state but the queue jobs have gotten dropped out. This would leave the username in use and any undeleted notices in place.
Diffstat (limited to 'classes')
-rw-r--r--classes/Profile.php3
-rw-r--r--classes/Profile_role.php1
2 files changed, 4 insertions, 0 deletions
diff --git a/classes/Profile.php b/classes/Profile.php
index 91f6e4692..eded1ff71 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -732,6 +732,9 @@ class Profile extends Memcached_DataObject
function hasRight($right)
{
$result = false;
+ if ($this->hasRole(Profile_role::DELETED)) {
+ return false;
+ }
if (Event::handle('UserRightsCheck', array($this, $right, &$result))) {
switch ($right)
{
diff --git a/classes/Profile_role.php b/classes/Profile_role.php
index d0a0b31f0..e7aa1f0f0 100644
--- a/classes/Profile_role.php
+++ b/classes/Profile_role.php
@@ -53,6 +53,7 @@ class Profile_role extends Memcached_DataObject
const ADMINISTRATOR = 'administrator';
const SANDBOXED = 'sandboxed';
const SILENCED = 'silenced';
+ const DELETED = 'deleted'; // Pending final deletion of notices...
public static function isValid($role)
{