Zeile 1517 | Zeile 1517 |
---|
$plugins->run_hooks('datahandler_user_delete_start', $this);
$this->delete_uids = implode(',', $this->delete_uids);
|
$plugins->run_hooks('datahandler_user_delete_start', $this);
$this->delete_uids = implode(',', $this->delete_uids);
|
| if(empty($this->delete_uids)) { $this->deleted_users = 0; $this->return_values = array( "deleted_users" => $this->deleted_users );
return $this->return_values; }
|
$this->delete_content();
// Delete the user
| $this->delete_content();
// Delete the user
|
Zeile 1590 | Zeile 1600 |
---|
* @param array|bool $delete_uids Array of user ids, false if they're already set (eg when using the delete_user function) */ function delete_content($delete_uids=false)
|
* @param array|bool $delete_uids Array of user ids, false if they're already set (eg when using the delete_user function) */ function delete_content($delete_uids=false)
|
{ global $db, $plugins, $mybb;
if($delete_uids != false) { $this->delete_uids = array_map('intval', (array)$delete_uids); foreach($this->delete_uids as $key => $uid) { if(!$uid || is_super_admin($uid) || $uid == $mybb->user['uid']) { // Remove super admins unset($this->delete_uids[$key]); }
| { global $db, $plugins, $mybb;
if($delete_uids != false) { $this->delete_uids = array_map('intval', (array)$delete_uids); foreach($this->delete_uids as $key => $uid) { if(!$uid || is_super_admin($uid) || $uid == $mybb->user['uid']) { // Remove super admins unset($this->delete_uids[$key]); }
|
} $this->delete_uids = implode(',', $this->delete_uids);
|
} $this->delete_uids = implode(',', $this->delete_uids);
|
}
| }
|
$plugins->run_hooks('datahandler_user_delete_content', $this);
|
$plugins->run_hooks('datahandler_user_delete_content', $this);
|
| if(empty($this->delete_uids)) { return; }
|
$db->delete_query('userfields', "ufid IN({$this->delete_uids})"); $db->delete_query('privatemessages', "uid IN({$this->delete_uids})");
| $db->delete_query('userfields', "ufid IN({$this->delete_uids})"); $db->delete_query('privatemessages', "uid IN({$this->delete_uids})");
|
Zeile 1641 | Zeile 1656 |
---|
$db->update_query('reportedcontent', array('uid' => 0), "uid IN({$this->delete_uids})");
// Remove any of the user(s) uploaded avatars
|
$db->update_query('reportedcontent', array('uid' => 0), "uid IN({$this->delete_uids})");
// Remove any of the user(s) uploaded avatars
|
$query = $db->simple_select('users', 'avatar', "uid IN({$this->delete_uids}) AND avatartype='upload'"); while($avatar = $db->fetch_field($query, 'avatar'))
| require_once MYBB_ROOT.'inc/functions_upload.php'; foreach(explode(',', $this->delete_uids) as $uid)
|
{
|
{
|
$avatar = substr($avatar, 2, -20); @unlink(MYBB_ROOT.$avatar);
| remove_avatars($uid);
|
} }
| } }
|
Zeile 1655 | Zeile 1669 |
---|
* @param array|bool $delete_uids Array of user ids, false if they're already set (eg when using the delete_user function) */ function delete_posts($delete_uids=false)
|
* @param array|bool $delete_uids Array of user ids, false if they're already set (eg when using the delete_user function) */ function delete_posts($delete_uids=false)
|
{ global $db, $plugins, $mybb;
if($delete_uids != false) { $this->delete_uids = array_map('intval', (array)$delete_uids);
foreach($this->delete_uids as $key => $uid) { if(!$uid || is_super_admin($uid) || $uid == $mybb->user['uid'])
| { global $db, $plugins, $mybb;
if($delete_uids != false) { $this->delete_uids = array_map('intval', (array)$delete_uids);
foreach($this->delete_uids as $key => $uid) { if(!$uid || is_super_admin($uid) || $uid == $mybb->user['uid'])
|
{ // Remove super admins unset($this->delete_uids[$key]);
| { // Remove super admins unset($this->delete_uids[$key]);
|
Zeile 1672 | Zeile 1686 |
---|
}
$this->delete_uids = implode(',', $this->delete_uids);
|
}
$this->delete_uids = implode(',', $this->delete_uids);
|
}
| }
|
require_once MYBB_ROOT.'inc/class_moderation.php'; $moderation = new Moderation();
$plugins->run_hooks('datahandler_user_delete_posts', $this);
|
require_once MYBB_ROOT.'inc/class_moderation.php'; $moderation = new Moderation();
$plugins->run_hooks('datahandler_user_delete_posts', $this);
|
| if(empty($this->delete_uids)) { return; }
|
// Threads $query = $db->simple_select('threads', 'tid', "uid IN({$this->delete_uids})");
| // Threads $query = $db->simple_select('threads', 'tid', "uid IN({$this->delete_uids})");
|
Zeile 1688 | Zeile 1707 |
---|
// Posts $query = $db->simple_select('posts', 'pid', "uid IN({$this->delete_uids})");
|
// Posts $query = $db->simple_select('posts', 'pid', "uid IN({$this->delete_uids})");
|
while($pid = $db->fetch_field($query, 'pid')) { $moderation->delete_post($pid); } }
| while($pid = $db->fetch_field($query, 'pid')) { $moderation->delete_post($pid); } }
|
/** * Provides a method to clear an users profile *
| /** * Provides a method to clear an users profile *
|
Zeile 1748 | Zeile 1767 |
---|
}
$plugins->run_hooks('datahandler_user_clear_profile', $this);
|
}
$plugins->run_hooks('datahandler_user_clear_profile', $this);
|
| if(empty($this->delete_uids)) { return; }
|
$db->update_query("users", $update, "uid IN({$this->delete_uids})"); $db->delete_query('userfields', "ufid IN({$this->delete_uids})");
|
$db->update_query("users", $update, "uid IN({$this->delete_uids})"); $db->delete_query('userfields', "ufid IN({$this->delete_uids})");
|
| // Remove any of the user(s) uploaded avatars require_once MYBB_ROOT.'inc/functions_upload.php'; foreach(explode(',', $this->delete_uids) as $uid) { remove_avatars($uid); }
|
} }
| } }
|