Vergleich inc/datahandlers/user.php - 1.8.1 - 1.8.4

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 507Zeile 507
					$profilefield['editableby'] = -1;
}


					$profilefield['editableby'] = -1;
}


				if(empty($profilefield['editableby']) || ($profilefield['editableby'] != -1 && !is_member($profilefield['editableby'], array('usergroup' => $user['usergroup'], 'additionalgroups' => $user['additionalgroups']))))

				if(!is_member($profilefield['editableby'], array('usergroup' => $user['usergroup'], 'additionalgroups' => $user['additionalgroups'])))

				{
continue;
}

				{
continue;
}

Zeile 1446Zeile 1446

$plugins->run_hooks('datahandler_user_delete_start', $this);



$plugins->run_hooks('datahandler_user_delete_start', $this);


		$this->delete_uids = '\''.implode('\',\'', $this->delete_uids).'\'';

		$this->delete_uids = implode(',', $this->delete_uids);

		
$this->delete_content();

// Delete the user

		
$this->delete_content();

// Delete the user

		$query = $db->delete_query('users', 'uid IN('.$this->delete_uids.')');
$this->deleted_users = (int)$db->affected_rows($query);

		$query = $db->delete_query('users', "uid IN({$this->delete_uids})");
$this->deleted_users = $db->affected_rows($query);


// Are we removing the posts/threads of a user?
if((int)$prunecontent == 1)


// Are we removing the posts/threads of a user?
if((int)$prunecontent == 1)

Zeile 1462Zeile 1462
		else
{
// We're just updating the UID

		else
{
// We're just updating the UID

			$db->update_query('posts', array('uid' => 0), 'uid IN('.$this->delete_uids.')');
$db->update_query('threads', array('uid' => 0), 'uid IN('.$this->delete_uids.')');

			$db->update_query('posts', array('uid' => 0), "uid IN({$this->delete_uids})");
$db->update_query('threads', array('uid' => 0), "uid IN({$this->delete_uids})");

		}

// Update thread ratings

		}

// Update thread ratings

Zeile 1482Zeile 1482
			$db->update_query("threads", $update_thread, "tid='{$rating['tid']}'");
}


			$db->update_query("threads", $update_thread, "tid='{$rating['tid']}'");
}


		$db->delete_query('threadratings', 'uid IN('.$this->delete_uids.')');

		$db->delete_query('threadratings', "uid IN({$this->delete_uids})");


// Update forums & threads if user is the lastposter


// Update forums & threads if user is the lastposter

		$db->update_query('forums', array('lastposteruid' => 0), 'lastposteruid IN('.$this->delete_uids.')');
$db->update_query('threads', array('lastposteruid' => 0), 'lastposteruid IN('.$this->delete_uids.')');

		$db->update_query('forums', array('lastposteruid' => 0), "lastposteruid IN({$this->delete_uids})");
$db->update_query('threads', array('lastposteruid' => 0), "lastposteruid IN({$this->delete_uids})");


$cache->update_banned();
$cache->update_moderators();

// Update forum stats


$cache->update_banned();
$cache->update_moderators();

// Update forum stats

		update_stats(array('numusers' => '-'.(int)$this->deleted_users));

		update_stats(array('numusers' => '-'.$this->deleted_users));


$this->return_values = array(
"deleted_users" => $this->deleted_users


$this->return_values = array(
"deleted_users" => $this->deleted_users

Zeile 1509Zeile 1509
	}

/**

	}

/**

	 * Provides a method to delete an users content

	 * Provides a method to delete users' content

	 *
* @param array Array of user ids, false if they're already set (eg when using the delete_user function)
*/

	 *
* @param array Array of user ids, false if they're already set (eg when using the delete_user function)
*/

Zeile 1530Zeile 1530
				}
}


				}
}


			$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);


		$db->delete_query('userfields', 'ufid IN('.$this->delete_uids.')');
$db->delete_query('privatemessages', 'uid IN('.$this->delete_uids.')');
$db->delete_query('events', 'uid IN('.$this->delete_uids.')');
$db->delete_query('moderators', 'id IN('.$this->delete_uids.') AND isgroup=\'0\'');
$db->delete_query('forumsubscriptions', 'uid IN('.$this->delete_uids.')');
$db->delete_query('threadsubscriptions', 'uid IN('.$this->delete_uids.')');
$db->delete_query('sessions', 'uid IN('.$this->delete_uids.')');
$db->delete_query('banned', 'uid IN('.$this->delete_uids.')');
$db->delete_query('joinrequests', 'uid IN('.$this->delete_uids.')');
$db->delete_query('awaitingactivation', 'uid IN('.$this->delete_uids.')');
$db->delete_query('warnings', 'uid IN('.$this->delete_uids.')');
$db->delete_query('reputation', 'uid IN('.$this->delete_uids.') OR adduid IN('.$this->delete_uids.')');
$db->delete_query('posts', 'uid IN('.$this->delete_uids.') AND visible=\'-2\'');
$db->delete_query('threads', 'uid IN('.$this->delete_uids.') AND visible=\'-2\'');
$db->delete_query('moderators', 'id IN('.$this->delete_uids.') AND isgroup=\'0\'');







		$db->delete_query('userfields', "ufid IN({$this->delete_uids})");
$db->delete_query('privatemessages', "uid IN({$this->delete_uids})");
$db->delete_query('events', "uid IN({$this->delete_uids})");
$db->delete_query('moderators', "id IN({$this->delete_uids}) AND isgroup = 0");
$db->delete_query('forumsubscriptions', "uid IN({$this->delete_uids})");
$db->delete_query('threadsubscriptions', "uid IN({$this->delete_uids})");
$db->delete_query('forumsread', "uid IN({$this->delete_uids})");
$db->delete_query('threadsread', "uid IN({$this->delete_uids})");
$db->delete_query('adminviews', "uid IN({$this->delete_uids})");
$db->delete_query('adminoptions', "uid IN({$this->delete_uids})");
$db->delete_query('adminsessions', "uid IN({$this->delete_uids})");
$db->delete_query('sessions', "uid IN({$this->delete_uids})");
$db->delete_query('banned', "uid IN({$this->delete_uids})");
$db->delete_query('joinrequests', "uid IN({$this->delete_uids})");
$db->delete_query('groupleaders', "uid IN({$this->delete_uids})");
$db->delete_query('awaitingactivation', "uid IN({$this->delete_uids})");
$db->delete_query('warnings', "uid IN({$this->delete_uids})");
$db->delete_query('reputation', "uid IN({$this->delete_uids}) OR adduid IN({$this->delete_uids})");
$db->delete_query('buddyrequests', "uid IN({$this->delete_uids}) OR touid IN({$this->delete_uids})");
$db->delete_query('posts', "uid IN({$this->delete_uids}) AND visible = -2");
$db->delete_query('threads', "uid IN({$this->delete_uids}) AND visible = -2");


// Delete reports made to the profile or reputation of the deleted users (i.e. made by them)


// Delete reports made to the profile or reputation of the deleted users (i.e. made by them)

		$db->delete_query('reportedcontent', 'type=\'reputation\' AND id3 IN('.$this->delete_uids.') OR type=\'reputation\' AND id2 IN('.$this->delete_uids.')');
$db->delete_query('reportedcontent', 'type=\'profile\' AND id IN('.$this->delete_uids.')');

		$db->delete_query('reportedcontent', "type='reputation' AND id3 IN({$this->delete_uids}) OR type='reputation' AND id2 IN({$this->delete_uids})");
$db->delete_query('reportedcontent', "type='profile' AND id IN({$this->delete_uids})");


// Update the reports made by the deleted users by setting the uid to 0


// Update the reports made by the deleted users by setting the uid to 0

		$db->update_query('reportedcontent', array('uid' => 0), 'uid IN('.$this->delete_uids.')');

		$db->update_query('reportedcontent', array('uid' => 0), "uid IN({$this->delete_uids})");


// Remove any of the user(s) uploaded avatars


// Remove any of the user(s) uploaded avatars

		$query = $db->simple_select('users', 'avatar', 'uid IN ('.$this->delete_uids.') AND avatartype=\'upload\'');

		$query = $db->simple_select('users', 'avatar', "uid IN({$this->delete_uids}) AND avatartype='upload'");

		while($avatar = $db->fetch_field($query, 'avatar'))
{
$avatar = substr($avatar, 2, -20);

		while($avatar = $db->fetch_field($query, 'avatar'))
{
$avatar = substr($avatar, 2, -20);

Zeile 1590Zeile 1596
				}
}


				}
}


			$this->delete_uids = '\''.implode('\',\'', $this->delete_uids).'\'';

			$this->delete_uids = implode(',', $this->delete_uids);

		}

require_once MYBB_ROOT.'inc/class_moderation.php';

		}

require_once MYBB_ROOT.'inc/class_moderation.php';

Zeile 1599Zeile 1605
		$plugins->run_hooks('datahandler_user_delete_posts', $this);

// Threads

		$plugins->run_hooks('datahandler_user_delete_posts', $this);

// Threads

		$query = $db->simple_select('threads', 'tid', 'uid IN('.$this->delete_uids.')');

		$query = $db->simple_select('threads', 'tid', "uid IN({$this->delete_uids})");

		while($tid = $db->fetch_field($query, 'tid'))
{
$moderation->delete_thread($tid);

		while($tid = $db->fetch_field($query, 'tid'))
{
$moderation->delete_thread($tid);

Zeile 1607Zeile 1613

// Posts
$pids = array();


// Posts
$pids = array();

		$query = $db->simple_select('posts', 'pid', 'uid IN('.$this->delete_uids.')');

		$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);

Zeile 1617Zeile 1623
		// Delete Reports made to users's posts/threads
if(!empty($pids))
{

		// Delete Reports made to users's posts/threads
if(!empty($pids))
{

			$db->delete_query('reportedcontent', 'type=\'posts\' AND id IN('.implode(',', $pids).')');

			$db->delete_query('reportedcontent', "type='posts' AND id IN(".implode(',', $pids).")");

		}
}

/**

		}
}

/**

	 * Provides a method to clear an users profile (note that this doesn't delete the custom profilefields)

	 * Provides a method to clear an users profile

	 *
* @param array Array of user ids, false if they're already set (eg when using the delete_user function)
* @param int The new usergroup if the users should be moved (additional usergroups are always removed)

	 *
* @param array Array of user ids, false if they're already set (eg when using the delete_user function)
* @param int The new usergroup if the users should be moved (additional usergroups are always removed)

Zeile 1645Zeile 1651
				}
}


				}
}


			$this->delete_uids = '\''.implode('\',\'', $this->delete_uids).'\'';

			$this->delete_uids = implode(',', $this->delete_uids);

		}

$update = array(

		}

$update = array(

Zeile 1664Zeile 1670
			"additionalgroups" => "",
"displaygroup" => 0,
"signature" => "",

			"additionalgroups" => "",
"displaygroup" => 0,
"signature" => "",

			"avatar" => ""



			"avatar" => "",
'avatardimensions' => '',
'avatartype' => ''

		);

if($gid > 0)
{
$update["usergroup"] = (int)$gid;

		);

if($gid > 0)
{
$update["usergroup"] = (int)$gid;



 
		}

$plugins->run_hooks('datahandler_user_clear_profile', $this);


		}

$plugins->run_hooks('datahandler_user_clear_profile', $this);


		$db->update_query("users", $update, 'uid IN('.$this->delete_uids.')');


		$db->update_query("users", $update, "uid IN({$this->delete_uids})");
$db->delete_query('userfields', "ufid IN({$this->delete_uids})");

	}
}

	}
}