1357 lines
46 KiB
PHP
1357 lines
46 KiB
PHP
<?php
|
|
|
|
/*
|
|
+--------------------------------------------------------------------------
|
|
| Invision Power Board 2.2.2
|
|
| =============================================
|
|
| by Matthew Mecham
|
|
| (c) 2001 - 2006 Invision Power Services, Inc.
|
|
| http://www.invisionpower.com
|
|
| =============================================
|
|
| Web: http://www.invisionboard.com
|
|
| http://www.ibresource.ru/products/invisionpowerboard/
|
|
| Time: Monday 05th of March 2007 10:10:54 PM
|
|
| Release: e3790216629e5a2aaf37070b32237f06
|
|
| Licence Info: http://www.invisionboard.com/?license
|
|
| http://www.ibresource.ru/license
|
|
+---------------------------------------------------------------------------
|
|
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
|
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
|
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
|
+---------------------------------------------------------------------------
|
|
| > $Date: 2006-11-27 17:07:12 -0600 (Mon, 27 Nov 2006) $
|
|
| > $Revision: 741 $
|
|
| > $Author: bfarber $
|
|
+---------------------------------------------------------------------------
|
|
|
|
|
| > Admin Member Tool functions
|
|
| > Module written by Matt Mecham
|
|
| > Date started: 17th September 2003
|
|
|
|
|
| > Module Version Number: 1.0.0
|
|
| > DBA Checked: Tue 25th May 2004
|
|
+--------------------------------------------------------------------------
|
|
*/
|
|
|
|
if ( ! defined( 'IN_ACP' ) )
|
|
{
|
|
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
|
|
exit();
|
|
}
|
|
|
|
$root_path = "";
|
|
|
|
class ad_member_tools
|
|
{
|
|
|
|
var $base_url;
|
|
var $modules = "";
|
|
var $html;
|
|
|
|
/**
|
|
* Section title name
|
|
*
|
|
* @var string
|
|
*/
|
|
var $perm_main = "content";
|
|
|
|
/**
|
|
* Section title name
|
|
*
|
|
* @var string
|
|
*/
|
|
var $perm_child = "mtools";
|
|
|
|
function auto_run()
|
|
{
|
|
$this->ipsclass->admin->nav[] = array( $this->ipsclass->form_code, 'Èíñòðóìåíòû' );
|
|
|
|
//-----------------------------------------
|
|
// Load HTML
|
|
//-----------------------------------------
|
|
|
|
$this->html = $this->ipsclass->acp_load_template('cp_skin_member');
|
|
|
|
//-----------------------------------------
|
|
// Get the sync module
|
|
//-----------------------------------------
|
|
|
|
if ( USE_MODULES == 1 )
|
|
{
|
|
require ROOT_PATH."modules/ipb_member_sync.php";
|
|
|
|
$this->modules = new ipb_member_sync();
|
|
$this->modules->ipsclass =& $this->ipsclass;
|
|
}
|
|
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->admin->page_title = "Èíñòðóìåíòû IP";
|
|
$this->ipsclass->admin->page_detail = 'Ýòà ñåêöèÿ ïîçâîëÿåò âàì áûñòðî è ïðîñòî îïåðèðîâàòü ñ IP-àäðåñàìè ïîëüçîâàòåëåé.';
|
|
|
|
switch($this->ipsclass->input['code'])
|
|
{
|
|
case 'showallips':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':view' );
|
|
$this->show_ips();
|
|
break;
|
|
|
|
case 'learnip':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':view' );
|
|
$this->learn_ip();
|
|
break;
|
|
|
|
//-----------------------------------------
|
|
case 'mod':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':mod' );
|
|
$this->member_view_moderation_queue();
|
|
break;
|
|
case 'domod':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':mod' );
|
|
$this->member_do_moderation_queue();
|
|
break;
|
|
case 'unappemail':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':mod' );
|
|
$this->member_do_email_unapprove();
|
|
break;
|
|
case 'lock':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':mod' );
|
|
$this->member_view_locked_queue();
|
|
break;
|
|
case 'unlock':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':mod' );
|
|
$this->member_do_unlock();
|
|
break;
|
|
|
|
|
|
//-----------------------------------------
|
|
default:
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':view' );
|
|
$this->show_index();
|
|
break;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
//-----------------------------------------
|
|
//
|
|
// LEARN ABOUT THE IP. It's very good.
|
|
//
|
|
//-----------------------------------------
|
|
|
|
|
|
function learn_ip()
|
|
{
|
|
if ( $this->ipsclass->input['ip'] == "" )
|
|
{
|
|
$this->show_index("Âû äîëæíû ââåñòè IP-àäðåñ äëÿ ïîèñêà");
|
|
}
|
|
|
|
$ip = trim($this->ipsclass->input['ip']);
|
|
|
|
$resolved = 'Íåäîñòóïíî (÷àñòè÷íûé IP-àäðåñ)';
|
|
$exact = 0;
|
|
|
|
if ( substr_count( $ip, '.' ) == 3 )
|
|
{
|
|
$exact = 1;
|
|
}
|
|
|
|
if ( strstr( $ip, '*' ) )
|
|
{
|
|
$exact = 0;
|
|
$ip = str_replace( "*", "", $ip );
|
|
}
|
|
|
|
if ( $exact != 0 )
|
|
{
|
|
$resolved = @gethostbyaddr($ip);
|
|
$query = "='".$ip."'";
|
|
}
|
|
else
|
|
{
|
|
$query = " LIKE '".$ip."%'";
|
|
}
|
|
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "40%" );
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "60%" );
|
|
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Õîñò {$this->ipsclass->input['ip']}" );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>IP-àäðåñ îïðåäåëÿåòñÿ êàê</b>" ,
|
|
$resolved
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
//-----------------------------------------
|
|
// Find registered members
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->adskin->td_header[] = array( "Ïîëüçîâàòåëü" , "30%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "E-mail" , "20%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "Ñîîáùåíèé" , "10%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "IP-àäðåñ" , "20%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "Çàðåãèñòðèðîâàí" , "20%" );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Ïîëüçîâàòåëè, èñïîëüçîâàâøèå ýòîò IP ïðè ÐÅÃÈÑÒÐÀÖÈÈ" );
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => 'id, members_display_name, email, posts, ip_address, joined',
|
|
'from' => 'members',
|
|
'where' => "ip_address{$query}",
|
|
'order' => 'joined DESC',
|
|
'limit' => array( 0,250) ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
if ( ! $this->ipsclass->DB->get_num_rows() )
|
|
{
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( "Çàïèñåé íå íàéäåíî", "center");
|
|
}
|
|
else
|
|
{
|
|
while ( $m = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( $m['members_display_name'] ,
|
|
$m['email'],
|
|
$m['posts'],
|
|
$m['ip_address'],
|
|
$this->ipsclass->get_date( $m['joined'], 'SHORT' )
|
|
) );
|
|
}
|
|
}
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
//-----------------------------------------
|
|
// Find Names posted under
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->adskin->td_header[] = array( "Ïîëüçîâàòåëü" , "20%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "E-mail" , "20%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "IP-àäðåñ" , "15%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "Âïåðâûå èñïîëüçîâàí" , "20%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "Ñîîáùåíèå" , "15%" );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Ïîëüçîâàòåëè èñïîëüçîâàâøèå ýòîò IP ïðè ÍÀÏÈÑÀÍÈÈ ÑÎÎÁÙÅÍÈß" );
|
|
|
|
$this->ipsclass->DB->cache_add_query( 'member_tools_learn_ip_one', array( 'query' => $query) );
|
|
$this->ipsclass->DB->cache_exec_query();
|
|
|
|
if ( ! $this->ipsclass->DB->get_num_rows() )
|
|
{
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( "Çàïèñåé íå íàéäåíî", "center");
|
|
}
|
|
else
|
|
{
|
|
while ( $m = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$m['name'] = $m['name'] ? $m['name'] : "Ãîñòü";
|
|
$m['email'] = $m['email'] ? $m['email'] : "<i>Íåäîñòóïíî</i>";
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( $m['name'] ,
|
|
$m['email'],
|
|
$m['ip_address'],
|
|
$this->ipsclass->get_date( $m['post_date'], 'SHORT' ),
|
|
"<center><a href='{$this->ipsclass->vars['board_url']}/index.php?showtopic={$m['topic_id']}&view=findpost&p={$m['pid']}' target='_blank'>Ïðîñìîòð ñîîáùåíèé</a></center>",
|
|
) );
|
|
}
|
|
}
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
//-----------------------------------------
|
|
// Find Names VOTED under
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->adskin->td_header[] = array( "Ïîëüçîâàòåëü" , "20%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "E-mail" , "20%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "IP-àäðåñ" , "15%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "Âïåðâûå èñïîëüçîâàí" , "20%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "Ãîëîñîâàíèå" , "15%" );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Ïîëüçîâàòåëè èñïîëüçîâàâøèå ýòîò IP ïðè ÃÎËÎÑÎÂÀÍÈÈ" );
|
|
|
|
$this->ipsclass->DB->cache_add_query( 'member_tools_learn_ip_two', array( 'query' => $query) );
|
|
$this->ipsclass->DB->cache_exec_query();
|
|
|
|
if ( ! $this->ipsclass->DB->get_num_rows() )
|
|
{
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( "Çàïèñåé íå íàéäåíî", "center");
|
|
}
|
|
else
|
|
{
|
|
while ( $m = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( $m['name'] ,
|
|
$m['email'],
|
|
$m['ip_address'],
|
|
$this->ipsclass->get_date( $m['vote_date'], 'SHORT' ),
|
|
"<center><a href='{$this->ipsclass->vars['board_url']}/index.php?showtopic={$m['tid']}' target='_blank'>Ïðîñìîòð îïðîñîâ</a></center>",
|
|
) );
|
|
}
|
|
}
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
//-----------------------------------------
|
|
// Find Names EMAILING under
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->adskin->td_header[] = array( "Ïîëüçîâàòåëü" , "20%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "E-mail" , "20%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "IP-àäðåñ" , "15%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "Âïåðâûå èñïîëüçîâàí" , "20%" );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Ïîëüçîâàòåëè èñïîëüçîâàâøèå ýòîò IP ïðè ÎÒÏÐÀÂÊÅ EMAIL" );
|
|
|
|
$this->ipsclass->DB->cache_add_query( 'member_tools_learn_ip_three', array( 'query' => $query) );
|
|
$this->ipsclass->DB->cache_exec_query();
|
|
|
|
if ( ! $this->ipsclass->DB->get_num_rows() )
|
|
{
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( "Çàïèñåé íå íàéäåíî", "center");
|
|
}
|
|
else
|
|
{
|
|
while ( $m = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( $m['name'] ,
|
|
$m['email'],
|
|
$m['from_ip_address'],
|
|
$this->ipsclass->get_date( $m['email_date'], 'SHORT' ),
|
|
) );
|
|
}
|
|
}
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
|
|
//-----------------------------------------
|
|
// Find Names VALIDATING under
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->adskin->td_header[] = array( "Ïîëüçîâàòåëü" , "20%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "E-mail" , "20%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "IP-àäðåñ" , "15%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "Âïåðâûå èñïîëüçîâàí" , "20%" );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Ïîëüçîâàòåëè èñïîëüçîâàâøèå ýòîò IP ïðè ÀÊÒÈÂÀÖÈÈ Ó×ÅÒÍÎÉ ÇÀÏÈÑÈ" );
|
|
|
|
$this->ipsclass->DB->cache_add_query( 'member_tools_learn_ip_four', array( 'query' => $query) );
|
|
$this->ipsclass->DB->cache_exec_query();
|
|
|
|
if ( ! $this->ipsclass->DB->get_num_rows() )
|
|
{
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( "Çàïèñåé íå íàéäåíî", "center");
|
|
}
|
|
else
|
|
{
|
|
while ( $m = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( $m['name'] ,
|
|
$m['email'],
|
|
$m['ip_address'],
|
|
$this->ipsclass->get_date( $m['entry_date'], 'SHORT' ),
|
|
) );
|
|
}
|
|
}
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
$this->ipsclass->admin->output();
|
|
}
|
|
|
|
//-----------------------------------------
|
|
//
|
|
// SHOW ALL IPs
|
|
//
|
|
//-----------------------------------------
|
|
|
|
|
|
function show_ips()
|
|
{
|
|
if ( $this->ipsclass->input['name'] == "" and $this->ipsclass->input['member_id'] == "" )
|
|
{
|
|
$this->show_index("Âû äîëæíû ââåñòè èìÿ ïîëüçîâàòåëÿ äëÿ ïîèñêà");
|
|
}
|
|
|
|
if ( isset($this->ipsclass->input['member_id']) AND $this->ipsclass->input['member_id'] )
|
|
{
|
|
$id = intval($this->ipsclass->input['member_id']);
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => 'id, name, email, ip_address', 'from' => 'members', 'where' => "id=$id" ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
if ( ! $member = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$this->show_index("Íåâîçìîæíî íàéòè ïîëüçîâàòåëÿ ñ ID «{$id}».");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
$name = addslashes($this->ipsclass->input['name']);
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => 'id, members_display_name as name, email, ip_address', 'from' => 'members', 'where' => "name='{$name}' OR members_display_name='{$name}'" ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
if ( ! $member = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$this->show_index( "Íåâîçìîæíî íàéòè ïîëüçîâàòåëÿ ñ òàêèì èìåíåì, äëÿ äîïîëíèòåëüíûõ âîçìîæíîñòåé èñïîëüçóéòå ôîðìó íèæå", $name );
|
|
}
|
|
}
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => 'count(distinct(ip_address)) as cnt', 'from' => 'posts', 'where' => "author_id={$member['id']}" ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
$count = $this->ipsclass->DB->fetch_row();
|
|
|
|
$st = intval($this->ipsclass->input['st']) >=0 ? intval($this->ipsclass->input['st']) : 0;
|
|
$end = 50;
|
|
|
|
$links = $this->ipsclass->adskin->build_pagelinks( array( 'TOTAL_POSS' => $count['cnt'],
|
|
'PER_PAGE' => $end,
|
|
'CUR_ST_VAL' => $st,
|
|
'L_SINGLE' => "Îäíà ñòðàíèöà",
|
|
'L_MULTI' => "Íåñêîëüêî ñòðàíèö",
|
|
'BASE_URL' => $this->ipsclass->base_url."&".$this->ipsclass->form_code."&code=showallips&member_id={$member['id']}",
|
|
) );
|
|
|
|
$master = array();
|
|
$ips = array();
|
|
|
|
$this->ipsclass->DB->cache_add_query( 'member_tools_show_ips', array( 'mid' => $member['id'], 'st' => $st, 'end' => $end ) );
|
|
$this->ipsclass->DB->cache_exec_query();
|
|
|
|
while ( $r = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$master[] = $r;
|
|
$ips[] = "'".$r['ip_address']."'";
|
|
}
|
|
|
|
$reg = array();
|
|
|
|
if ( count($ips) > 0 )
|
|
{
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => 'id, members_display_name as name, ip_address', 'from' => 'members', 'where' => "ip_address IN (".implode(",",$ips).") AND id != {$member['id']}" ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
while ( $i = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$reg[ $i['ip_address'] ][] = $i;
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->adskin->td_header[] = array( "IP-àäðåñ" , "20%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "Âõîäîâ ñ ýòîãî IP" , "10%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "Äàòà èñïîëüçîâàíèÿ" , "25%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "Èñïîëüçîâàíî ïðè äðóãèõ ðåãèñòðàöèÿõ" , "20%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "Èíñòðóìåíò IP" , "25%" );
|
|
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Ó ïîëüçîâàòåëÿ {$member['name']} íàéäåíî ({$count['cnt']}) óíèêàëüíûõ IP-àäðåñîâ" );
|
|
|
|
foreach( $master as $r )
|
|
{
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( $r['ip_address'] ,
|
|
$r['ip'] ,
|
|
$this->ipsclass->get_date( $r['post_date'], 'SHORT' ),
|
|
"<center>". intval( count($reg[ $r['ip_address'] ]) ). "</center>",
|
|
"<center><a href='{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=learnip&ip={$r['ip_address']}'>Èíôîðìàöèÿ î IP-àäðåñå</a></center>"
|
|
) );
|
|
}
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( "$links", "center" );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
$this->ipsclass->admin->output();
|
|
}
|
|
|
|
//-----------------------------------------
|
|
//
|
|
// Default Screen
|
|
//
|
|
//-----------------------------------------
|
|
|
|
|
|
function show_index($msg="", $membername="")
|
|
{
|
|
if ($msg != "")
|
|
{
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "100%" );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Ñîîáùåíèå" );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( $msg ) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
}
|
|
|
|
$this->ipsclass->html .= "<script type='text/javascript' src='{$this->ipsclass->vars['board_url']}/jscripts/ipb_xhr_findnames.js'></script>
|
|
<div id='ipb-get-members' style='border:1px solid #000; background:#FFF; padding:2px;position:absolute;width:170px;display:none;z-index:100'></div>";
|
|
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'showallips' ),
|
|
2 => array( 'act' , 'mtools' ),
|
|
4 => array( 'section', $this->ipsclass->section_code ),
|
|
) );
|
|
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "40%" );
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "60%" );
|
|
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Ïîêàçàòü âñå IP-àäðåñà, êîòîðûå áûëè ó ýòîãî ïîëüçîâàòåëÿ â ìîìåíò äîáàâëåíèÿ ñîîáùåíèé" );
|
|
|
|
if ( $membername == "" )
|
|
{
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ââåäèòå èìÿ ïîëüçîâàòåëÿ:</b>" ,
|
|
$this->ipsclass->adskin->form_input( "name", isset($_POST['name']) ? $this->ipsclass->txt_stripslashes($_POST['name']) : '', 'text', "id='name'" )
|
|
) );
|
|
}
|
|
else
|
|
{
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => 'id, name', 'from' => 'members', 'where' => "members_l_username LIKE '{$membername}%'" ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
if ( ! $this->ipsclass->DB->get_num_rows() )
|
|
{
|
|
$this->show_index("Íå íàéäåíî ïîëüçîâàòåëåé, ó êîòîðûõ èìÿ íà÷èíàåòñÿ ñ '$membername'.");
|
|
}
|
|
|
|
$mem_array = array();
|
|
|
|
while ( $m = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$mem_array[] = array( $m['id'], $m['name'] );
|
|
}
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Âûáåðèòå ïîëüçîâàòåëÿ:</b>" ,
|
|
$this->ipsclass->adskin->form_dropdown( "member_id", $mem_array )
|
|
) );
|
|
}
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_form("Íàéòè IP-àäðåñà ýòîãî ïîëüçîâàòåëÿ");
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
$this->ipsclass->html .= "<script type='text/javascript'>
|
|
// INIT find names
|
|
init_js( 'theAdminForm', 'name');
|
|
// Run main loop
|
|
var tmp = setTimeout( 'main_loop()', 10 );
|
|
</script>";
|
|
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'learnip' ),
|
|
2 => array( 'act' , 'mtools' ),
|
|
4 => array( 'section', $this->ipsclass->section_code ),
|
|
) );
|
|
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "40%" );
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "60%" );
|
|
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Èíôîðìàöèÿ îá IP-àäðåñå" );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Âûâåñòè âñþ èíôîðìàöèþ îá IP:</b>" ,
|
|
$this->ipsclass->adskin->form_input( "ip", isset($_POST['ip']) ? $this->ipsclass->txt_stripslashes($_POST['ip']) : '' )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_form("Âûâåñòè!");
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
$this->ipsclass->admin->output();
|
|
}
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
// Process Moderation queue
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function member_do_moderation_queue()
|
|
{
|
|
//-----------------------------------------
|
|
// INIT
|
|
//-----------------------------------------
|
|
|
|
$ids = array();
|
|
|
|
//-----------------------------------------
|
|
// GET checkboxes
|
|
//-----------------------------------------
|
|
|
|
foreach ($this->ipsclass->input as $k => $v)
|
|
{
|
|
if ( preg_match( "/^mid_(\d+)$/", $k, $match ) )
|
|
{
|
|
if ($this->ipsclass->input[ $match[0] ])
|
|
{
|
|
$ids[] = $match[1];
|
|
}
|
|
}
|
|
}
|
|
|
|
$ids = $this->ipsclass->clean_int_array( $ids );
|
|
|
|
//-----------------------------------------
|
|
// Check
|
|
//-----------------------------------------
|
|
|
|
if ( count($ids) < 1 )
|
|
{
|
|
$this->ipsclass->admin->error("Âû íå âûáðàëè ïîëüçîâàòåëåé äëÿ àêòèâàöèè, óäàëåíèÿ èëè ïîâòîðíîé îòïðàâêè ïèñüìà.");
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// APPROVE
|
|
//-----------------------------------------
|
|
|
|
if ($this->ipsclass->input['type'] == 'approve')
|
|
{
|
|
//-----------------------------------------
|
|
// Get email class
|
|
//-----------------------------------------
|
|
|
|
require ROOT_PATH."sources/classes/class_email.php";
|
|
|
|
$email = new emailer( ROOT_PATH );
|
|
$email->ipsclass =& $this->ipsclass;
|
|
$email->email_init();
|
|
|
|
$email->get_template("complete_reg");
|
|
|
|
$email->build_message( "" );
|
|
|
|
$approved = array();
|
|
|
|
//-----------------------------------------
|
|
// Get members
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->cache_add_query( 'member_domod', array( 'ids' => $ids ) );
|
|
$main = $this->ipsclass->DB->cache_exec_query();
|
|
|
|
while( $row = $this->ipsclass->DB->fetch_row( $main ) )
|
|
{
|
|
$approved[] = $row['name'];
|
|
|
|
if ($row['mgroup'] != $this->ipsclass->vars['auth_group'])
|
|
{
|
|
continue;
|
|
}
|
|
|
|
if ($row['real_group'] == "")
|
|
{
|
|
$row['real_group'] = $this->ipsclass->vars['member_group'];
|
|
}
|
|
|
|
$this->ipsclass->DB->do_update( 'members', array( 'mgroup' => $row['real_group'] ), "id=".$row['id'] );
|
|
|
|
$email->subject = "Àêòèâàöèÿ ó÷åòíîé çàïèñè «{$row['name']}» íà «{$this->ipsclass->vars['board_name']}»";
|
|
$email->to = $row['email'];
|
|
|
|
$email->send_mail();
|
|
|
|
if ( USE_MODULES == 1 )
|
|
{
|
|
$this->modules->register_class($this);
|
|
$this->modules->on_group_change($row['id'], $row['real_group']);
|
|
}
|
|
}
|
|
|
|
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'validating', 'where' => "member_id IN(".implode( ",",$ids ).")" ) );
|
|
|
|
$this->ipsclass->admin->save_log( count($ids)." ó÷åòíûõ çàïèñåé àêòèâèðîâàíî: ".implode( ", ", $approved ) );
|
|
|
|
//-----------------------------------------
|
|
// Stats to Update?
|
|
//-----------------------------------------
|
|
|
|
$stats = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'cache_store', 'where' => "cs_key='stats'" ) );
|
|
|
|
$stats = unserialize($this->ipsclass->txt_stripslashes($stats['cs_value']));
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => 'count(id) as members', 'from' => 'members', 'where' => "mgroup <> '".$this->ipsclass->vars['auth_group']."'" ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
$r = $this->ipsclass->DB->fetch_row();
|
|
$stats['mem_count'] = intval($r['members']);
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => 'id, name, members_display_name',
|
|
'from' => 'members',
|
|
'where' => "mgroup <> '".$this->ipsclass->vars['auth_group']."'",
|
|
'order' => "id DESC",
|
|
'limit' => array(0,1) ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
$r = $this->ipsclass->DB->fetch_row();
|
|
$stats['last_mem_name'] = $r['members_display_name'] ? $r['members_display_name'] : $r['name'];
|
|
$stats['last_mem_id'] = $r['id'];
|
|
|
|
if ( count($stats) > 0 )
|
|
{
|
|
$this->ipsclass->cache['stats'] =& $stats;
|
|
$this->ipsclass->update_cache( array( 'name' => 'stats', 'array' => 1, 'deletefirst' => 1 ) );
|
|
}
|
|
|
|
$this->ipsclass->main_msg = count($ids)." ó÷åòíûõ çàïèñåé àêòèâèðîâàíî.";
|
|
$this->member_view_moderation_queue();
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Resend validation email
|
|
//-----------------------------------------
|
|
|
|
else if ($this->ipsclass->input['type'] == 'resend')
|
|
{
|
|
//-----------------------------------------
|
|
// Get email class
|
|
//-----------------------------------------
|
|
|
|
require ROOT_PATH."sources/classes/class_email.php";
|
|
|
|
$email = new emailer( ROOT_PATH );
|
|
$email->ipsclass =& $this->ipsclass;
|
|
$email->email_init();
|
|
|
|
$reset = array();
|
|
$cant = array();
|
|
$main_msgs = array();
|
|
|
|
//-----------------------------------------
|
|
// Get members
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->cache_add_query( 'member_domod', array( 'ids' => $ids ) );
|
|
$main = $this->ipsclass->DB->cache_exec_query();
|
|
|
|
while( $row = $this->ipsclass->DB->fetch_row( $main ) )
|
|
{
|
|
if ($row['mgroup'] != $this->ipsclass->vars['auth_group'])
|
|
{
|
|
continue;
|
|
}
|
|
|
|
if ( $row['lost_pass'] == 1 )
|
|
{
|
|
$email->get_template("lost_pass");
|
|
|
|
$email->build_message( array(
|
|
'NAME' => $row['members_display_name'],
|
|
'THE_LINK' => $this->ipsclass->vars['board_url']."/index.php?act=Reg&CODE=lostpassform&uid=".$row['id']."&aid=".$val['vid'],
|
|
'MAN_LINK' => $this->ipsclass->vars['board_url']."/index.php?act=Reg&CODE=lostpassform",
|
|
'EMAIL' => $row['email'],
|
|
'ID' => $row['id'],
|
|
'CODE' => $row['vid'],
|
|
'IP_ADDRESS' => $row['ip_address'],
|
|
)
|
|
);
|
|
|
|
$email->subject = "Èíôîðìàöèÿ î âîññòàíîâëåíèå ïàðîëÿ íà «{$this->ipsclass->vars['board_name']}»";
|
|
$email->to = $row['email'];
|
|
|
|
$email->send_mail();
|
|
}
|
|
else if ( $row['new_reg'] == 1 )
|
|
{
|
|
if( $row['user_verified'] )
|
|
{
|
|
$cant[] = $row['members_display_name'];
|
|
continue;
|
|
}
|
|
|
|
$email->get_template("reg_validate");
|
|
|
|
$email->build_message( array(
|
|
'THE_LINK' => $this->ipsclass->vars['board_url']."/index.php?act=Reg&CODE=03&uid=".$row['id']."&aid=".$row['vid'],
|
|
'NAME' => $row['members_display_name'],
|
|
'MAN_LINK' => $this->ipsclass->vars['board_url']."/index.php?act=Reg&CODE=05",
|
|
'EMAIL' => $row['email'],
|
|
'ID' => $row['id'],
|
|
'CODE' => $row['vid'],
|
|
)
|
|
);
|
|
|
|
$email->subject = "Ðåãèñòðàöèÿ íà ".$this->ipsclass->vars['board_name'];
|
|
$email->to = $row['email'];
|
|
|
|
$email->send_mail();
|
|
}
|
|
else if ( $row['email_chg'] == 1 )
|
|
{
|
|
$email->get_template("newemail");
|
|
|
|
$email->build_message( array(
|
|
'NAME' => $row['members_display_name'],
|
|
'THE_LINK' => $this->ipsclass->vars['board_url']."/index.php?act=Reg&CODE=03&type=newemail&uid=".$row['id']."&aid=".$row['vid'],
|
|
'ID' => $row['id'],
|
|
'MAN_LINK' => $this->ipsclass->vars['board_url']."/index.php?act=Reg&CODE=07",
|
|
'CODE' => $row['vid'],
|
|
)
|
|
);
|
|
|
|
$email->subject = "Çàïðîñ íà èçìåíåíèå E-mail íà ".$this->ipsclass->vars['board_name'];
|
|
$email->to = $row['email'];
|
|
|
|
$email->send_mail();
|
|
}
|
|
|
|
$resent[] = $row['members_display_name'];
|
|
}
|
|
|
|
if( count($resent) )
|
|
{
|
|
$this->ipsclass->admin->save_log( count($ids)." ïèñåì àêòèâàöèè îòïðàâëåíî: ".implode( ", ", $resent) );
|
|
$main_msgs[] = count($ids)." ïèñåì àêòèâàöèè îòïðàâëåíî: ".implode( ", ", $resent);
|
|
}
|
|
|
|
if( count($cant) )
|
|
{
|
|
$main_msgs[] = "Íåâîçìîæíî îòïðàâèòü ïèñüìî àêòèâàöèè ïîëüçîâàòåëÿì, êîòîðûå îæèäàþò àêòèâàöèþ àäìèíèñòðàòîðîì: ".implode( ", ", $cant);
|
|
}
|
|
|
|
$this->ipsclass->main_msg = count($main_msgs) ? implode( "<br />", $main_msgs ) : '';
|
|
|
|
$this->member_view_moderation_queue();
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// DELETE
|
|
//-----------------------------------------
|
|
|
|
else
|
|
{
|
|
$denied = array();
|
|
|
|
$this->ipsclass->DB->build_query( array( 'select' => 'name', 'from' => 'members', 'where' => "id IN(".implode( ",",$ids ).")" ) );
|
|
$this->ipsclass->DB->exec_query();
|
|
|
|
while( $r = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$denied[] = $r['name'];
|
|
}
|
|
|
|
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'members' , 'where' => "id IN(".implode( ",",$ids ).")" ) );
|
|
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'member_extra' , 'where' => "id IN(".implode( ",",$ids ).")" ) );
|
|
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'message_text' , 'where' => "msg_author_id IN(".implode( ",",$ids ).")" ) );
|
|
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'message_topics' , 'where' => "mt_owner_id IN(".implode( ",",$ids ).")" ) );
|
|
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'contacts' , 'where' => "member_id IN(".implode( ",",$ids ).") or contact_id IN(".implode( ",",$ids ).")" ) );
|
|
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'validating' , 'where' => "member_id IN(".implode( ",",$ids ).")" ) );
|
|
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'pfields_content' , 'where' => "member_id IN(".implode( ",",$ids ).")" ) );
|
|
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'warn_logs' , 'where' => "wlog_mid IN(".implode( ",",$ids ).")" ) );
|
|
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'members_converge', 'where' => "converge_id IN(".implode( ",",$ids ).")" ) );
|
|
|
|
$this->ipsclass->DB->do_update( 'posts' , array( 'author_id' => 0 ), "author_id IN(".implode( ",",$ids ).")" );
|
|
$this->ipsclass->DB->do_update( 'topics', array( 'starter_id' => 0 ), "starter_id IN(".implode( ",",$ids ).")" );
|
|
|
|
if ( USE_MODULES == 1 )
|
|
{
|
|
$this->modules->register_class($this);
|
|
$this->modules->on_delete($ids);
|
|
}
|
|
|
|
$this->ipsclass->admin->save_log( count($ids)." ðåãèñòðàöèé ïîëüçîâàòåëåé íå áûëî îäîáðåíî: ".implode( ", ", $denied) );
|
|
|
|
$this->ipsclass->main_msg = count($ids)." ïîëüçîâàòåëåé óäàëåíî.";
|
|
$this->member_view_moderation_queue();
|
|
}
|
|
}
|
|
|
|
|
|
function member_do_email_unapprove()
|
|
{
|
|
//-----------------------------------------
|
|
// GET member
|
|
//-----------------------------------------
|
|
|
|
if( !isset($this->ipsclass->input['mid']) )
|
|
{
|
|
$this->ipsclass->admin->error("Âû íå óêàçàëè ID ïîëüçîâàòåëÿ.");
|
|
}
|
|
|
|
$id = intval($this->ipsclass->input['mid']);
|
|
|
|
$member = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*', 'from' => 'validating', 'where' => 'member_id='.$id ) );
|
|
|
|
if( !isset($member['vid']) OR !$member['vid'] )
|
|
{
|
|
$this->ipsclass->admin->error("Íåâîçìîæíî íàéòè ïîëüçîâàòåëÿ ñ óêàçàííûì ID â íåàêòèâèðîâàííûõ ïîëüçîâàòåëÿõ.");
|
|
}
|
|
|
|
if( !$member['email_chg'] )
|
|
{
|
|
$this->ipsclass->admin->error("You can only unapprove email change requests");
|
|
}
|
|
|
|
$this->ipsclass->DB->do_update( "members", array( 'email' => $member['prev_email'], 'mgroup' => $member['real_group'] ), "id=".$id );
|
|
|
|
$this->ipsclass->DB->do_update( "members_converge", array( 'converge_email' => $member['prev_email'] ), "converge_id=".$id );
|
|
|
|
$this->ipsclass->DB->do_delete( "validating", "vid='{$member['vid']}'" );
|
|
|
|
|
|
if ( USE_MODULES == 1 )
|
|
{
|
|
$this->modules->register_class($this);
|
|
$this->modules->on_group_change($member['member_id'], $member['real_group']);
|
|
}
|
|
|
|
$this->ipsclass->admin->save_log( "Èçìåíåíèå e-mail àäðåñà ïîëüçîâàòåëåì {$id} íå îäîáðåíî.");
|
|
|
|
|
|
$this->ipsclass->main_msg = "Èçìåíåíèå e-mail àäðåñà ïîëüçîâàòåëåì {$id} íå îäîáðåíî.";
|
|
$this->member_view_moderation_queue();
|
|
}
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
// View locked user accounts due to failed login
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function member_view_locked_queue()
|
|
{
|
|
//-----------------------------------------
|
|
// INIT
|
|
//-----------------------------------------
|
|
|
|
$st = intval($this->ipsclass->input['st']) >=0 ? intval($this->ipsclass->input['st']) : 0;
|
|
$content = "";
|
|
|
|
//-----------------------------------------
|
|
// SET PAGE TITLE
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->admin->page_title = "Óïðàâëåíèå çàáëîêèðîâàííûìè ó÷åòíûìè çàïèñÿìè";
|
|
$this->ipsclass->admin->page_detail = " ýòîé ñåêöèè âû ìîæåòå ðàçáëîêèðîâàòü ïîëüçîâàòåëåé, êîòîðûå èñ÷åðïàëè êîëè÷åñòâî äîïóñòèìûõ ïîïûòîê àâòîðèçàöèè íà ôîðóìå.<br />Åñëè íåîáõîäèìî, âû òàê æå ìîæåòå îêîí÷àòåëüíî çàáëîêèðîâàòü ó÷åòíûå çàïèñè ïîëüçîâàòåëåé, âûáðàâ ñîîòâåòñâóþùóþ îïöèþ â âûïàäàþùåì ìåíþ.";
|
|
$this->ipsclass->admin->nav[] = array( '', 'Çàáëîêèðîâàííûå ó÷åòíûå çàïèñè' );
|
|
|
|
//-----------------------------------------
|
|
// Get count
|
|
//-----------------------------------------
|
|
|
|
if( $this->ipsclass->vars['ipb_bruteforce_attempts'] == 0 )
|
|
{
|
|
$content = $this->html->member_locked_no_rows( "Ó âàñ âûêëþ÷åíà çàùèòà îò àâòîìàòè÷åñêîãî ïåðåáîðà ïàðîëåé." );
|
|
}
|
|
else
|
|
{
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => 'COUNT(*) as mcount', 'from' => 'members', 'where' => "failed_login_count>=".$this->ipsclass->vars['ipb_bruteforce_attempts'] ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
$row = $this->ipsclass->DB->fetch_row();
|
|
$cnt = intval($row['mcount']);
|
|
|
|
//-----------------------------------------
|
|
// Pages...
|
|
//-----------------------------------------
|
|
|
|
$links = $this->ipsclass->adskin->build_pagelinks( array( 'TOTAL_POSS' => $cnt,
|
|
'PER_PAGE' => 75,
|
|
'CUR_ST_VAL' => $st,
|
|
'L_SINGLE' => "",
|
|
'L_MULTI' => "",
|
|
'BASE_URL' => $this->ipsclass->base_url."&{$this->ipsclass->form_code}&code=lock",
|
|
) );
|
|
|
|
//-----------------------------------------
|
|
// Print...
|
|
//-----------------------------------------
|
|
|
|
if ($cnt > 0)
|
|
{
|
|
$this->ipsclass->DB->build_query( array( 'select' => 'name, mgroup, members_display_name, ip_address, id, email, posts, joined, failed_logins, failed_login_count',
|
|
'from' => 'members',
|
|
'where' => "failed_login_count>={$this->ipsclass->vars['ipb_bruteforce_attempts']}",
|
|
'order' => 'members_display_name ASC',
|
|
'limit' => array( $st, 75 )
|
|
) );
|
|
|
|
$this->ipsclass->DB->exec_query();
|
|
|
|
while ( $r = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$used_ips = array();
|
|
$this_attempt = array();
|
|
$oldest = 0;
|
|
$newest = 0;
|
|
|
|
if( $r['failed_logins'] )
|
|
{
|
|
$failed_logins = explode( ",", $this->ipsclass->clean_perm_string( $r['failed_logins'] ) );
|
|
|
|
if( is_array($failed_logins) AND count($failed_logins) )
|
|
{
|
|
sort($failed_logins);
|
|
|
|
foreach( $failed_logins as $attempt )
|
|
{
|
|
$this_attempt = explode( "-", $attempt );
|
|
$used_ips[] = $this_attempt[1];
|
|
}
|
|
|
|
$oldest = array_shift($failed_logins);
|
|
$newest = array_pop($failed_logins);
|
|
}
|
|
}
|
|
|
|
$newest = explode( "-", $newest );
|
|
$oldest = explode( "-", $oldest );
|
|
|
|
$r['group_title'] = $this->ipsclass->cache['group_cache'][ $r['mgroup'] ]['g_title'];
|
|
|
|
$r['oldest_fail'] = $this->ipsclass->get_date( $oldest[0], 'SHORT' );
|
|
$r['newest_fail'] = $this->ipsclass->get_date( $newest[0], 'SHORT' );
|
|
$r['_joined'] = $this->ipsclass->get_date( $r['joined'] , 'TINY' );
|
|
|
|
$r['ip_addresses'] = "";
|
|
|
|
$used_ips = array_unique($used_ips);
|
|
|
|
foreach( $used_ips as $ip_address )
|
|
{
|
|
$r['ip_addresses'] .= "IP: <a href='{$this->ipsclass->base_url}§ion=content&act=mtools&code=learnip&ip={$ip_address}'>{$ip_address}</a><br />";
|
|
}
|
|
|
|
if ( !isset($r['name']) OR $r['name'] == "" )
|
|
{
|
|
$r['name'] = "<em>Ïîëüçîâàòåëü óäàëåí</em>";
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Print row
|
|
//-----------------------------------------
|
|
|
|
$content .= $this->html->member_locked_row( $r );
|
|
}
|
|
}
|
|
else
|
|
{
|
|
$content = $this->html->member_locked_no_rows( "Çàáëîêèðîâàííûõ ó÷åòíûõ çàïèñåé íå íàéäåíî." );
|
|
}
|
|
}
|
|
|
|
$this->ipsclass->html .= $this->html->member_locked_wrapper($content, $st, $links);
|
|
|
|
$this->ipsclass->admin->output();
|
|
}
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
// Process locked member queue
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function member_do_unlock()
|
|
{
|
|
//-----------------------------------------
|
|
// INIT
|
|
//-----------------------------------------
|
|
|
|
$ids = array();
|
|
|
|
//-----------------------------------------
|
|
// GET checkboxes
|
|
//-----------------------------------------
|
|
|
|
foreach ($this->ipsclass->input as $k => $v)
|
|
{
|
|
if ( preg_match( "/^mid_(\d+)$/", $k, $match ) )
|
|
{
|
|
if ($this->ipsclass->input[ $match[0] ])
|
|
{
|
|
$ids[] = $match[1];
|
|
}
|
|
}
|
|
}
|
|
|
|
$ids = $this->ipsclass->clean_int_array( $ids );
|
|
|
|
//-----------------------------------------
|
|
// Check
|
|
//-----------------------------------------
|
|
|
|
if ( count($ids) < 1 )
|
|
{
|
|
$this->ipsclass->admin->error("Âû íå óêàçàëè ID ïîëüçîâàòåëÿ äëÿ ðàçáëîêèðîâêè èëè áëîêèðîêè.");
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Unlock
|
|
//-----------------------------------------
|
|
|
|
if ($this->ipsclass->input['type'] == 'unlock')
|
|
{
|
|
$this->ipsclass->DB->do_update( "members", array( 'failed_logins' => '', 'failed_login_count' => 0 ), "id IN(".implode( ',', $ids ).')' );
|
|
|
|
$this->ipsclass->admin->save_log( count($ids)." ïîëüçîâàòåëåé ðàçáëîêèðîâàíî");
|
|
|
|
$this->ipsclass->main_msg = count($ids)." ïîëüçîâàòåëåé ðàçáëîêèðîâàíî";
|
|
$this->member_view_locked_queue();
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Ban
|
|
//-----------------------------------------
|
|
|
|
else if ($this->ipsclass->input['type'] == 'ban')
|
|
{
|
|
if( $this->ipsclass->member['mgroup'] != $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
// This isn't a root admin - make sure they can't ban a root admin
|
|
|
|
$this->ipsclass->DB->build_query( array( 'select' => 'mgroup', 'from' => 'members', 'where' => "id IN(".implode( ',', $ids ).')' ) );
|
|
$this->ipsclass->DB->exec_query();
|
|
|
|
while( $mem = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
if( $mem['mgroup'] == $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
$this->ipsclass->admin->error( "Âû íå ìîæåòå áëîêèðîâàòü ãëàâíûõ àäìèíèñòðàòîðîâ." );
|
|
}
|
|
}
|
|
}
|
|
|
|
$five_is_present = 0;
|
|
$banned_gid = isset( $this->ipsclass->vars['banned_group'] ) AND $this->ipsclass->vars['banned_group'] ? $this->ipsclass->vars['banned_group'] : 0;
|
|
|
|
$this->ipsclass->DB->build_query( array( 'select' => 'g_view_board,g_id', 'from' => 'groups', 'where' => 'g_view_board=0' ) );
|
|
$this->ipsclass->DB->exec_query();
|
|
|
|
if ( ! $banned_gid )
|
|
{
|
|
while( $r = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
// Default banned group is 5 - if it's here, let's use that
|
|
if( $r['g_id'] == 5 )
|
|
{
|
|
$five_is_present = 1;
|
|
}
|
|
|
|
$banned_gid = $r['g_id'];
|
|
}
|
|
|
|
if ( $five_is_present )
|
|
{
|
|
$banned_gid = 5;
|
|
}
|
|
}
|
|
|
|
if ( ! $banned_gid )
|
|
{
|
|
$this->ipsclass->admin->error( "Ó âàñ íåò ãðóïïû ïîëüçîâàòåëåé, êîòîðàÿ íå ìîæåò ïðîñìàòðèâàòü ôîðóì — íå óäàëîñü íàéòè ãðóïïó «Çàáëîêèðîâàííûå»." );
|
|
}
|
|
|
|
$this->ipsclass->DB->do_update( "members", array( 'failed_logins' => '', 'failed_login_count' => 0, 'mgroup' => $banned_gid ), "id IN(".implode( ',', $ids ).')' );
|
|
|
|
$this->ipsclass->admin->save_log( count($ids)." ïîëüçîâàòåëåé çàáëîêèðîâàíî");
|
|
|
|
$this->ipsclass->main_msg = count($ids)." ïîëüçîâàòåëåé çàáëîêèðîâàíî";
|
|
$this->member_view_locked_queue();
|
|
}
|
|
}
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
// View member moderation queue
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function member_view_moderation_queue()
|
|
{
|
|
//-----------------------------------------
|
|
// INIT
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->input['ord'] = isset($this->ipsclass->input['ord']) ? $this->ipsclass->input['ord'] : '';
|
|
$st = intval($this->ipsclass->input['st']) >=0 ? intval($this->ipsclass->input['st']) : 0;
|
|
$ord = $this->ipsclass->input['ord'] == 'asc' ? 'asc' : 'desc';
|
|
$new_ord = $ord == 'asc' ? 'desc' : 'asc';
|
|
$filter = isset($this->ipsclass->input['filter']) ? $this->ipsclass->input['filter'] : '';
|
|
$q_extra = "";
|
|
$content = "";
|
|
|
|
//-----------------------------------------
|
|
// SET PAGE TITLE
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->admin->page_title = "Óïðàâëåíèå íåàêòèâèðîâàííûìè èëè èçìåíèâøèìè e-mail ïîëüçîâàòåëÿìè";
|
|
$this->ipsclass->admin->page_detail = " ýòîé ñåêöèè âû ñìîæåòå ïðîñìîòðåòü ñïèñîê âñåõ ïîëüçîâàòåëåé, êîòîðûå åù¸ íå àêòèâèðîâàëè ñâîþ ó÷åòíóþ çàïèñü ïîñëå ðåãèñòðàöèè èëè èçìåíåíèÿ e-mail àäðåñà.<br />Íèæå âû ñìîæåòå âûáðàòü ó÷åòíûå çàïèñè äëÿ àêòèâàöèè èëè óäàëåíèÿ, à òàê æå ïîâòîðíîé îòïðàâêè ïèñüìà ñ èíñòðóêöèÿìè.";
|
|
$this->ipsclass->admin->nav[] = array( '', 'Íåàêòèâèðîâàííûå ïîëüçîâàòåëè' );
|
|
|
|
//-----------------------------------------
|
|
// Add extra query
|
|
//-----------------------------------------
|
|
|
|
switch( $filter )
|
|
{
|
|
case 'reg_user_validate':
|
|
if( $this->ipsclass->vars['reg_auth_type'] != 'admin' )
|
|
{
|
|
$q_extra = " AND v.new_reg=1 AND v.user_verified=0";
|
|
}
|
|
break;
|
|
case 'reg_admin_validate':
|
|
if( $this->ipsclass->vars['reg_auth_type'] == 'admin' )
|
|
{
|
|
$q_extra = " AND v.new_reg=1";
|
|
}
|
|
else
|
|
{
|
|
$q_extra = " AND v.new_reg=1 AND v.user_verified=1";
|
|
}
|
|
break;
|
|
case 'email_chg':
|
|
$q_extra = " AND v.email_chg=1";
|
|
break;
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Get count
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->build_query( array( 'select' => 'COUNT(*) as mcount',
|
|
'from' => array( 'validating' => 'v' ),
|
|
'where' => "v.lost_pass=0 AND m.mgroup={$this->ipsclass->vars['auth_group']}".$q_extra,
|
|
'add_join' => array(
|
|
array(
|
|
'select' => '',
|
|
'from' => array( 'members' => 'm' ),
|
|
'where' => 'm.id=v.member_id',
|
|
'type' => 'left',
|
|
),
|
|
),
|
|
) );
|
|
$this->ipsclass->DB->exec_query();
|
|
|
|
$row = $this->ipsclass->DB->fetch_row();
|
|
$cnt = intval($row['mcount']);
|
|
|
|
//-----------------------------------------
|
|
// Sorted?
|
|
//-----------------------------------------
|
|
|
|
switch ($this->ipsclass->input['sort'])
|
|
{
|
|
case 'mem':
|
|
$col = 'm.members_display_name';
|
|
break;
|
|
case 'email':
|
|
$col = 'm.email';
|
|
break;
|
|
case 'sent':
|
|
$col = 'v.entry_date';
|
|
break;
|
|
case 'posts':
|
|
$col = 'm.posts';
|
|
break;
|
|
case 'reg':
|
|
$col = 'm.joined';
|
|
break;
|
|
default:
|
|
$col = 'v.entry_date';
|
|
break;
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Pages...
|
|
//-----------------------------------------
|
|
|
|
$links = $this->ipsclass->adskin->build_pagelinks( array( 'TOTAL_POSS' => $cnt,
|
|
'PER_PAGE' => 75,
|
|
'CUR_ST_VAL' => $st,
|
|
'L_SINGLE' => "",
|
|
'L_MULTI' => "",
|
|
'BASE_URL' => $this->ipsclass->base_url."&{$this->ipsclass->form_code}&code=mod&ord={$ord}&filter={$filter}",
|
|
) );
|
|
|
|
//-----------------------------------------
|
|
// Print...
|
|
//-----------------------------------------
|
|
|
|
if ($cnt > 0)
|
|
{
|
|
$this->ipsclass->DB->build_query( array( 'select' => 'v.*',
|
|
'from' => array( 'validating' => 'v' ),
|
|
'where' => "v.lost_pass=0 AND m.mgroup={$this->ipsclass->vars['auth_group']}".$q_extra,
|
|
'order' => $col . ' ' . $ord,
|
|
'limit' => array( $st, 75 ),
|
|
'add_join' => array(
|
|
array(
|
|
'select' => 'm.name, m.mgroup, m.members_display_name, m.ip_address, m.id, m.email, m.posts, m.joined',
|
|
'from' => array( 'members' => 'm' ),
|
|
'where' => 'm.id=v.member_id',
|
|
'type' => 'left',
|
|
),
|
|
),
|
|
) );
|
|
//$this->ipsclass->DB->cache_add_query( 'member_view_mod', array( 'col' => $col, 'ord' => $ord, 'st' => $st, 'extra' => $q_extra ) );
|
|
$this->ipsclass->DB->exec_query();
|
|
|
|
while ( $r = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
if ($r['coppa_user'] == 1)
|
|
{
|
|
$r['_coppa'] = ' ( COPPA Request )';
|
|
}
|
|
else
|
|
{
|
|
$r['_coppa'] = "";
|
|
}
|
|
|
|
$r['_where'] = ( $r['lost_pass'] ? 'Âîññòàíîâëåíèå ïàðîëÿ' : ( $r['new_reg'] ? "Ðåãèñòðàöèÿ <strong>(àêòèâàöèÿ ïîëüçîâàòåëåì)</strong>" : ( $r['email_chg'] ? "Èçìåíåíèå e-mail" : 'Íåèçâåñòíî' ) ) );
|
|
|
|
if( isset($r['email_chg']) AND $r['email_chg'] )
|
|
{
|
|
$r['_where'] .= " (<a href='{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=unappemail&mid={$r['member_id']}'>Unapprove?</a>)";
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Update user_admin validation
|
|
//-----------------------------------------
|
|
|
|
if ( $r['new_reg'] AND ( $r['user_verified'] == 1 OR $this->ipsclass->vars['reg_auth_type'] == 'admin' ) )
|
|
{
|
|
$r['_where'] = "Ðåãèñòðàöèÿ: <strong>(àêòèâàöèÿ àäìèíèñòðàòîðîì)</strong>";
|
|
}
|
|
|
|
$r['_hours'] = floor( ( time() - $r['entry_date'] ) / 3600 );
|
|
$r['_days'] = intval( $r['_hours'] / 24 );
|
|
$r['_rhours'] = intval( $r['_hours'] - ($r['_days'] * 24) );
|
|
$r['_joined'] = $this->ipsclass->get_date( $r['joined'] , 'TINY' );
|
|
$r['_entry'] = $this->ipsclass->get_date( $r['entry_date'], 'TINY' );
|
|
|
|
if ( !isset($r['name']) OR $r['name'] == "" )
|
|
{
|
|
$r['name'] = "<em>Óäàëåííûé ïîëüçîâàòåëü</em>";
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Print row
|
|
//-----------------------------------------
|
|
|
|
$content .= $this->html->member_validating_row( $r );
|
|
}
|
|
}
|
|
else
|
|
{
|
|
$content = $this->html->member_locked_no_rows( "Íåò íåàêòèâèðîâàííûõ ïîëüçîâàòåëåé." );
|
|
}
|
|
|
|
$this->ipsclass->html .= $this->html->member_validating_wrapper($content, $st, $new_ord, $links);
|
|
|
|
$this->ipsclass->admin->output();
|
|
}
|
|
|
|
|
|
}
|
|
|
|
?>
|