コード例 #1
0
ファイル: takemoderate.php プロジェクト: morilo/ptpimg
    if (!empty($UserReason)) {
        send_pm($UserID, 0, db_string('Your IRC privileges have been disabled'), db_string("Your IRC privileges have been disabled. The reason given was: {$UserReason}. If you would like to discuss this please join " . BOT_DISABLED_CHAN . " on our IRC network. Instructions can be found [url=http://" . NONSSL_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 #what.cd-disabled."));
    }
}
if ($DisableRequests != $Cur['DisableRequests'] && check_perms('users_disable_any')) {
    $UpdateSet[] = "DisableRequests='{$DisableRequests}'";
    $EditSummary[] = "request status changed";
    $HeavyUpdates['DisableRequests'] = $DisableRequests;
    if (!empty($UserReason)) {
        send_pm($UserID, 0, db_string('Your request privileges have been disabled'), db_string("Your request privileges have been disabled. The reason given was: {$UserReason}. If you would like to discuss this please join " . BOT_DISABLED_CHAN . " on our IRC network. Instructions can be found [url=http://" . NONSSL_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 #what.cd-disabled."));
    }
}
if ($EnableUser != $Cur['Enabled'] && check_perms('users_disable_users')) {
    $EnableStr = 'account ' . translateUserStatus($Cur['Enabled']) . '->' . translateUserStatus($EnableUser);
    if ($EnableUser == '2') {
        disable_users($UserID, '', 1);
    } elseif ($EnableUser == '1') {
        $Cache->increment('stats_user_count');
        update_tracker('add_user', array('id' => $UserID, 'passkey' => $Cur['torrent_pass']));
        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: ' . number_format($Cur['Uploaded'] / $Cur['Downloaded'], 2) . ', RR: ' . number_format($Cur['RequiredRatio'], 2) . ')';
            if ($Cur['RatioWatchEnds'] != '0000-00-00 00:00:00') {
                $UpdateSet[] = "i.RatioWatchEnds=NOW()";
                $UpdateSet[] = "i.RatioWatchDownload=m.Downloaded";
                $CanLeech = 0;
            }
コード例 #2
0
ファイル: index.php プロジェクト: 4play/gazelle2
		AND um.LastAccess>'".time_minus(3600*24*111, true)."'
		AND um.LastAccess!='0000-00-00 00:00:00'
		AND ui.Donor='0'
		AND um.Enabled!='2'");
	while(list($Username, $Email) = $DB->next_record()) {
		$Body = "Hi $Username, \n\nIt has been almost 4 months since you used your account at http://".NONSSL_SITE_URL.". This is an automated email to inform you that your account will be disabled in 10 days if you do not sign in. ";
		send_email($Email, 'Your '.SITE_NAME.' account is about to be disabled', $Body);
	}
	
	$DB->query("SELECT um.ID FROM  users_info AS ui JOIN users_main AS um ON um.ID=ui.UserID
		WHERE um.PermissionID IN ('".USER."', '".MEMBER	."')
		AND um.LastAccess<'".time_minus(3600*24*30*4)."'
		AND um.LastAccess!='0000-00-00 00:00:00'
		AND ui.Donor='0'
		AND um.Enabled!='2'");
	disable_users($DB->collect('ID'));
	
	echo 'set cache';
	
	$DB->query("UPDATE users_info AS ui JOIN users_main AS um ON um.ID=ui.UserID
		SET um.Enabled='2',
		ui.BanDate='$sqltime',
		ui.BanReason='3',
		ui.AdminComment=CONCAT('$sqltime - Disabled for inactivity

', ui.AdminComment)
		WHERE um.PermissionID IN ('".USER."', '".MEMBER	."')
		AND um.LastAccess<'".time_minus(3600*24*30*4)."'
		AND um.LastAccess!='0000-00-00 00:00:00'
		AND ui.Donor='0'
		AND um.Enabled!='2'");