Pagina 1 din 1

[1.0.4.1] ONE CLICK BAN !

Scris: 13-Iul-2013, 20:12:47
de Gotyc
Salut va prezint un one click ban editat de mine.

Noutati:
- refresh statsitici forum dupa ban
- ban username
- ban ip
- ban email
- stergere user din baza de date , dar banul ramane

Daca nu vrei sa dai ban ip / email etc editeaza: (pune false in loc de true)

Cod: Selectaţi tot

// Interzicem utilizatorul?
$ban_username = true;
// Interzicem ip-ul?
$ban_ip = true;
// Interzicem email-ul?
$ban_email = true;
// Delete the user's posts?
$delete_posts = true;
// motiv
$motive = "SPAM DETECT";
// refresh statistici forum ?
$refresh = true;

Cod: Selectaţi tot

<?php
/**
* START CONFIG
* @version: 1.0.4.1
* @author: Stefan
*/

//  Interzicem utilizatorul?
$ban_username = true;
//  Interzicem ip-ul?
$ban_ip = true;
//  Interzicem email-ul?
$ban_email = true;
// Delete the user's posts?
$delete_posts = true;
//  motiv
$motive = "SPAM DETECT";
// refresh statistici forum ?
$refresh = true;

define('IN_PHPBB', true);
define('ADMIN_START', true);
define('NEED_SID', true);

// Include files
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
require($phpbb_root_path . 'common.' . $phpEx);
require($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
require($phpbb_root_path . 'includes/functions_user.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup(array('acp/common', 'acp/users', 'mods/ocban'));
// End session management

// Do this user have ban permissions.
if (!$auth->acl_get('a_ban') && !$auth->acl_get('m_ban'))
{
	trigger_error('CANT_USE_BAN');
}

$user_id = request_var('u', 0);

if (!$user_id)
{
	trigger_error('NO_USER');
}

$sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . $user_id;
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);

if (!$row)
{
	trigger_error('NO_USER');
}

$username = $row['username'];
$user_ip = $row['user_ip'];
$user_email = $row['user_email'];

if ($row['user_type'] == USER_FOUNDER)
{
	trigger_error('CANT_BAN_FOUNDER');
}


if (confirm_box(true))
{
	if ($ban_username) { user_ban('user', $username, 0, '', 0, $motive);	}
    if ($ban_ip) { user_ban('ip', $user_ip, 0, '', 0, $motive);}
	if ($ban_email) { user_ban('email', $user_email, 0, '', 0, $motive);  }
	if ($delete_posts) { delete_posts('poster_id', $user_id); }
    if($delete_posts) { $db->sql_query('DELETE FROM ' . USERS_TABLE . ' WHERE user_id = ' . $user_id); }
	
if ($refresh) {
						$sql = 'SELECT COUNT(post_id) AS stat 	FROM ' . POSTS_TABLE . ' 	WHERE post_approved = 1';
						$result = $db->sql_query($sql);
						set_config('num_posts', (int) $db->sql_fetchfield('stat'), true);
						$db->sql_freeresult($result);

						$sql = 'SELECT COUNT(topic_id) AS stat FROM ' . TOPICS_TABLE . '	WHERE topic_approved = 1';
						$result = $db->sql_query($sql);
						set_config('num_topics', (int) $db->sql_fetchfield('stat'), true);
						$db->sql_freeresult($result);

						$sql = 'SELECT COUNT(user_id) AS stat 	FROM ' . USERS_TABLE . '	WHERE user_type IN (' . USER_NORMAL . ',' . USER_FOUNDER . ')';
						$result = $db->sql_query($sql);
						set_config('num_users', (int) $db->sql_fetchfield('stat'), true);
						$db->sql_freeresult($result);

						$sql = 'SELECT COUNT(attach_id) as stat 	FROM ' . ATTACHMENTS_TABLE . ' 	WHERE is_orphan = 0';
						$result = $db->sql_query($sql);
						set_config('num_files', (int) $db->sql_fetchfield('stat'), true);
						$db->sql_freeresult($result);

						$sql = 'SELECT SUM(filesize) as stat FROM ' . ATTACHMENTS_TABLE . ' WHERE is_orphan = 0';
						$result = $db->sql_query($sql);
						set_config('upload_dir_size', (float) $db->sql_fetchfield('stat'), true);
						$db->sql_freeresult($result);

	if (!function_exists('update_last_username'))
	{
						include($phpbb_root_path . "includes/functions_user.$phpEx");
	}
	update_last_username();
	add_log('admin', 'LOG_RESYNC_STATS');
}
trigger_error(sprintf("Utilizator restrictionat pe acest forum, baza de date a fost reimprospatita", $message, append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&u=$user_id")));

}else { 
		confirm_box(false,'Urmatorul utilizator (<font color="red"><b>'.$username.'</b></font>) primeste: 
		<br /> Restrictie la nume 
		<br /> Email restrictionat 
		<br /> Ip interzis 
	    <br /> Si cont sters ,
	    <br /> Motivul restrictionarii este (<font color="green"><b>'.$motive.'</b></font>)
	    Esti de acord? '); 
}

?>

Re: [1.0.4.1] ONE CLICK BAN !

Scris: 30-Oct-2013, 17:10:36
de BogdanWoOw
La ce foloseste ? l am cautat si pe net in en , dar nu prea am inteles mare lucru

Re: [1.0.4.1] ONE CLICK BAN !

Scris: 15-Dec-2013, 12:36:23
de Gotyc
TE ajuta mult sa dai ban instant din profilul celui vizat.. stergi tot ce are pe acel cont ... ii interzice email , ip , username

Re: [1.0.4.1] ONE CLICK BAN !

Scris: 18-Aug-2016, 23:55:22
de FlorinHG
E bun dar nu are rost,de ce sa dai asa ? Din panel poti sa te informezi mai usor si mai mult decat sa dai un ban gresit doar asa,printr-un simplu click,nu prea e okey.

Re: [1.0.4.1] ONE CLICK BAN !

Scris: 15-Ian-2017, 15:58:41
de dorin
Sa intelegem ca tu ai editat o extensie existenta ? Ai adus unele modificari ?

Re: [1.0.4.1] ONE CLICK BAN !

Scris: 20-Ian-2017, 16:59:31
de Sylver Cheetah 53
Nu prea văd rostu' acestei MODificări. :?

Re: [1.0.4.1] ONE CLICK BAN !

Scris: 22-Ian-2017, 14:46:12
de Dragosvr92
Exista extensia Ban Hammer