예제 #1
0
    $EditSummary[] = 'IRC privileges ' . ($DisableIRC ? 'disabled' : 'enabled');
    $HeavyUpdates['DisableIRC'] = $DisableIRC;
    if (!empty($UserReason)) {
        Misc::send_pm($UserID, 0, 'Your IRC privileges have been disabled', "Your IRC privileges have been disabled. The reason given was: [quote]{$UserReason}[/quote] If you would like to discuss this, please join " . BOT_DISABLED_CHAN . ' on our IRC network. Instructions can be found [url=' . site_url() . 'wiki.php?action=article&name=IRC+-+How+to+join]here[/url]. This loss of privileges does not affect the ability to join and talk to staff in ' . BOT_DISABLED_CHAN . '.');
    }
}
if ($DisableRequests != $Cur['DisableRequests'] && check_perms('users_disable_any')) {
    $UpdateSet[] = "DisableRequests = '{$DisableRequests}'";
    $EditSummary[] = 'request privileges ' . ($DisableRequests ? 'disabled' : 'enabled');
    $HeavyUpdates['DisableRequests'] = $DisableRequests;
    if (!empty($UserReason)) {
        Misc::send_pm($UserID, 0, 'Your request privileges have been disabled', "Your request privileges have been disabled. The reason given was: [quote]{$UserReason}[/quote] If you would like to discuss this, please join " . BOT_DISABLED_CHAN . ' on our IRC network. Instructions can be found [url=' . site_url() . 'wiki.php?action=article&name=IRC+-+How+to+join]here[/url].');
    }
}
if ($EnableUser != $Cur['Enabled'] && check_perms('users_disable_users')) {
    $EnableStr = 'account ' . translateUserStatus($Cur['Enabled']) . '->' . translateUserStatus($EnableUser);
    if ($EnableUser == '2') {
        Tools::disable_users($UserID, '', 1);
        $TrackerUserUpdates = array();
    } elseif ($EnableUser == '1') {
        $Cache->increment('stats_user_count');
        $VisibleTrIP = $Visible && $Cur['IP'] != '127.0.0.1' ? '1' : '0';
        Tracker::update_tracker('add_user', array('id' => $UserID, 'passkey' => $Cur['torrent_pass'], 'visible' => $VisibleTrIP));
        if ($Cur['Downloaded'] == 0 || $Cur['Uploaded'] / $Cur['Downloaded'] >= $Cur['RequiredRatio']) {
            $UpdateSet[] = "i.RatioWatchEnds = '0000-00-00 00:00:00'";
            $CanLeech = 1;
            $UpdateSet[] = "m.can_leech = '1'";
            $UpdateSet[] = "i.RatioWatchDownload = '0'";
        } else {
            $EnableStr .= ' (Ratio: ' . Format::get_ratio_html($Cur['Uploaded'], $Cur['Downloaded'], false) . ', RR: ' . number_format($Cur['RequiredRatio'], 2) . ')';
            if ($Cur['RatioWatchEnds'] != '0000-00-00 00:00:00') {
예제 #2
0
	}
}

if ($DisableWiki!=$Cur['DisableWiki'] && check_perms('users_disable_any')) {
	$UpdateSet[]="DisableWiki='$DisableWiki'";
	$EditSummary[]="wiki status changed";	
	$HeavyUpdates['DisableWiki']=$DisableWiki;
	$HeavyUpdates['site_edit_wiki']=0;
	
}

if ($EnableUser!=$Cur['Enabled'] && check_perms('users_disable_users')) {
	$UpdateSet[]="Enabled='$EnableUser'";
	$CanLeech = ($EnableUser == 1) ? 1 : 0;
	$UpdateSet[]="m.can_leech='$CanLeech'";
	$EditSummary[]='account '.translateUserStatus($Cur['Enabled']).'->'.translateUserStatus($EnableUser);
	if($EnableUser == '2') {
		$Cache->decrement('stats_user_count');
		$UpdateSet[]="i.BanDate='".sqltime()."'";
		$UpdateSet[]="i.BanReason='1'";
	} elseif($EnableUser == '1') {
		$Cache->increment('stats_user_count');
		$UpdateSet[]="i.RatioWatchDownload='0'";
		$UpdateSet[]="i.RatioWatchEnds='0000-00-00 00:00:00'";
	}
	$Cache->replace_value('enabled_'.$UserID, $EnableUser, 0);
	$LightUpdates['Enabled'] = $EnableUser;
}

if ($ResetPasskey == 1 && check_perms('users_edit_reset_keys')) {
	$Passkey = db_string(make_secret());