4540 lines
167 KiB
PHP
4540 lines
167 KiB
PHP
<?php
|
|
|
|
/*
|
|
+--------------------------------------------------------------------------
|
|
| Invision Power Board 2.1.7
|
|
| =============================================
|
|
| by Matthew Mecham
|
|
| (c) 2001 - 2005 Invision Power Services, Inc.
|
|
| http://www.invisionpower.com
|
|
| =============================================
|
|
| Web: http://www.invisionboard.com
|
|
| http://www.ibresource.ru/products/invisionpowerboard/
|
|
| Time: Tuesday 18th of July 2006 05:56:00 PM
|
|
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
|
|
| Licence Info: http://www.invisionboard.com/?license
|
|
| http://www.ibresource.ru/license
|
|
+---------------------------------------------------------------------------
|
|
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
|
|
+---------------------------------------------------------------------------
|
|
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
|
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
|
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
|
+---------------------------------------------------------------------------
|
|
| > $Date: 2006-02-02 17:23:13 +0000 (Thu, 02 Feb 2006) $
|
|
| > $Revision: 133 $
|
|
| > $Author: bfarber $
|
|
+---------------------------------------------------------------------------
|
|
|
|
|
| > Admin Forum functions
|
|
| > Module written by Matt Mecham
|
|
| > Date started: 1st march 2002
|
|
|
|
|
| > Module Version Number: 1.0.0
|
|
| > DBA Checked: Tue 25th May 2004
|
|
+--------------------------------------------------------------------------
|
|
*/
|
|
|
|
if ( ! defined( 'IN_ACP' ) )
|
|
{
|
|
print "<h1>Íåâåðíûé âõîä</h1> Ó Âàñ íåò äîñòóïà ê äèðåêòèâå ýòîãî ôàéëà. Åñëè Âû ïðîâîäèëè îáíîâëåíèÿ, óáåäèòåñü, ÷òî íå çàáûëè îáíîâèòü 'admin.php'.";
|
|
exit();
|
|
}
|
|
|
|
|
|
class ad_member
|
|
{
|
|
# Global
|
|
var $ipsclass;
|
|
|
|
#Html
|
|
var $html;
|
|
|
|
var $base_url;
|
|
var $modules = "";
|
|
|
|
|
|
/**
|
|
* Section title name
|
|
*
|
|
* @var string
|
|
*/
|
|
var $perm_main = "content";
|
|
|
|
/**
|
|
* Section title name
|
|
*
|
|
* @var string
|
|
*/
|
|
var $perm_child = "mem";
|
|
|
|
function auto_run()
|
|
{
|
|
//-----------------------------------------
|
|
// 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;
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Kill globals - globals bad, Homer good.
|
|
//-----------------------------------------
|
|
|
|
$tmp_in = array_merge( $_GET, $_POST, $_COOKIE );
|
|
|
|
foreach ( $tmp_in as $k => $v )
|
|
{
|
|
unset($$k);
|
|
}
|
|
|
|
$this->ipsclass->admin->nav[] = array( "{$this->ipsclass->form_code}&code=edit", 'Óïðàâëåíèå ïîëüçîâàòåëÿìè' );
|
|
|
|
//-----------------------------------------
|
|
// Load HTML
|
|
//-----------------------------------------
|
|
|
|
$this->html = $this->ipsclass->acp_load_template('cp_skin_member');
|
|
|
|
//-----------------------------------------
|
|
// Load Language
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->acp_load_language( 'acp_lang_member' );
|
|
|
|
//-----------------------------------------
|
|
// What to do...
|
|
//-----------------------------------------
|
|
|
|
switch($this->ipsclass->input['code'])
|
|
{
|
|
case 'doform':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );
|
|
$this->member_do_edit_form();
|
|
break;
|
|
case 'doedit':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );
|
|
$this->member_do_edit();
|
|
break;
|
|
//-----------------------------------------
|
|
case 'unsuspend':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':suspend' );
|
|
$this->member_unsuspend();
|
|
break;
|
|
//-----------------------------------------
|
|
case 'add':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':add' );
|
|
$this->member_add_form();
|
|
break;
|
|
case 'doadd':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':add' );
|
|
$this->member_do_add();
|
|
break;
|
|
//-----------------------------------------
|
|
case 'doprune':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':remove' );
|
|
$this->member_doprune();
|
|
break;
|
|
//-----------------------------------------
|
|
// ranks / titles
|
|
//-----------------------------------------
|
|
case 'title':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':title-view' );
|
|
$this->titles_start();
|
|
break;
|
|
case 'rank_edit':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':title-edit' );
|
|
$this->titles_rank_setup('edit');
|
|
break;
|
|
case 'rank_add':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':title-add' );
|
|
$this->titles_rank_setup('add');
|
|
break;
|
|
case 'do_add_rank':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':title-add' );
|
|
$this->titles_add_rank();
|
|
break;
|
|
case 'do_rank_edit':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':title-edit' );
|
|
$this->titles_edit_rank();
|
|
break;
|
|
case 'rank_delete':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':title-remove' );
|
|
$this->titles_delete_rank();
|
|
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 'changename':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );
|
|
$this->member_change_name_start();
|
|
break;
|
|
case 'dochangename':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );
|
|
$this->member_change_name_complete();
|
|
break;
|
|
case 'change_display_name':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );
|
|
$this->member_change_display_name();
|
|
break;
|
|
case 'change_display_name_do':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );
|
|
$this->member_change_display_name_do();
|
|
break;
|
|
case 'deleteposts':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );
|
|
$this->member_delete_posts_start();
|
|
break;
|
|
case 'deleteposts_process':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );
|
|
$this->member_delete_posts_process();
|
|
break;
|
|
//-----------------------------------------
|
|
|
|
case 'banmember':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':ban' );
|
|
$this->member_suspend_start();
|
|
break;
|
|
|
|
case 'dobanmember':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':ban' );
|
|
$this->member_suspend_complete();
|
|
break;
|
|
//-----------------------------------------
|
|
// Change Passy
|
|
//-----------------------------------------
|
|
case 'changepassword':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );
|
|
$this->member_password_start();
|
|
break;
|
|
case 'dochangepassword':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );
|
|
$this->member_password_complete();
|
|
break;
|
|
//-----------------------------------------
|
|
// Member search
|
|
//-----------------------------------------
|
|
case 'search':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );
|
|
$this->search_form();
|
|
break;
|
|
case 'searchresults':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );
|
|
$this->search_results();
|
|
break;
|
|
//-----------------------------------------
|
|
// Delete / Prune
|
|
//-----------------------------------------
|
|
case 'member_delete':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':remove' );
|
|
$this->member_delete();
|
|
break;
|
|
|
|
default:
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':' );
|
|
$this->search_form();
|
|
break;
|
|
}
|
|
|
|
}
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
// Member Delete posts, PROCESS
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function member_delete_posts_process()
|
|
{
|
|
//-----------------------------------------
|
|
// INIT
|
|
//-----------------------------------------
|
|
|
|
$member_id = intval( $this->ipsclass->input['mid'] );
|
|
$delete_posts = intval( $this->ipsclass->input['dposts'] );
|
|
$delete_topics = intval( $this->ipsclass->input['dtopics'] );
|
|
$end = intval( $this->ipsclass->input['dpergo'] ) ? intval( $this->ipsclass->input['dpergo'] ) : 50;
|
|
$init = intval( $this->ipsclass->input['init'] );
|
|
$done = 0;
|
|
$start = intval( $this->ipsclass->input['st'] );
|
|
$forums_affected = array();
|
|
$topics_affected = array();
|
|
$img = '<img src="'.$this->ipsclass->skin_url.'/images/aff_tick_small.png" border="0" alt="-" /> ';
|
|
$posts_deleted = 0;
|
|
$topics_deleted = 0;
|
|
$skipit = intval( $this->ipsclass->input['skipit'] );
|
|
|
|
//--------------------------------------------
|
|
// NOT INIT YET?
|
|
//--------------------------------------------
|
|
|
|
if ( ! $init )
|
|
{
|
|
$url = $this->ipsclass->base_url.'&'.$this->ipsclass->form_code_js."&code=deleteposts_process&dpergo={$this->ipsclass->input['dpergo']}"
|
|
."&st=0"
|
|
."&init=1"
|
|
."&dposts={$delete_posts}"
|
|
."&dtopics={$delete_topics}"
|
|
."&mid={$member_id}";
|
|
|
|
$this->ipsclass->admin->output_multiple_redirect_init( $url );
|
|
}
|
|
|
|
//--------------------------------------------
|
|
// Not loaded the func?
|
|
//--------------------------------------------
|
|
|
|
if ( ! is_object( $this->func_mod ) )
|
|
{
|
|
require_once( ROOT_PATH.'sources/lib/func_mod.php' );
|
|
$this->func_mod = new func_mod();
|
|
$this->func_mod->ipsclass =& $this->ipsclass;
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Get member
|
|
//-----------------------------------------
|
|
|
|
$member = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'members', 'where' => 'id='.$member_id ) );
|
|
|
|
//-----------------------------------------
|
|
// Non root admin attempting to edit root admin?
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->member['mgroup'] != $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
if ( $member['mgroup'] == $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
$this->ipsclass->admin->error("Âû íå ìîæåòå ðåäàêòèðîâàòü ãëàâíûõ àäìèíèñòðàòîðîâ");
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Avoid limit...
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => '*',
|
|
'from' => 'posts',
|
|
'where' => "author_id={$member_id}",
|
|
'order' => 'pid ASC',
|
|
'limit' => array( $skipit, $end + $skipit ) ) );
|
|
$outer = $this->ipsclass->DB->simple_exec();
|
|
|
|
//-----------------------------------------
|
|
// Process...
|
|
//-----------------------------------------
|
|
|
|
while( $r = $this->ipsclass->DB->fetch_row( $outer ) )
|
|
{
|
|
//-----------------------------------------
|
|
// Get topic...
|
|
//-----------------------------------------
|
|
|
|
$topic = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',
|
|
'from' => 'topics',
|
|
'where' => 'tid='.$r['topic_id'] ) );
|
|
|
|
//-----------------------------------------
|
|
// No longer a topic?
|
|
//-----------------------------------------
|
|
|
|
if ( ! $topic['tid'] )
|
|
{
|
|
continue;
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Get number of MID posters
|
|
//-----------------------------------------
|
|
|
|
$topic_i_posted = $this->ipsclass->DB->build_and_exec_query( array( 'select' => 'COUNT(*) as count',
|
|
'from' => 'posts',
|
|
'where' => 'author_id='.$member_id.' AND topic_id='.$r['topic_id'] ) );
|
|
|
|
//-----------------------------------------
|
|
// Aready deleted this topic?
|
|
//-----------------------------------------
|
|
|
|
if ( ! $topic_i_posted['count'])
|
|
{
|
|
continue;
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// First check: Our topic and no other replies?
|
|
//-----------------------------------------
|
|
|
|
if ( $topic['starter_id'] == $member_id AND $topic_i_posted['count'] == ( $topic['posts'] + 1 ) )
|
|
{
|
|
//-----------------------------------------
|
|
// Ok, deleting topics or posts?
|
|
//-----------------------------------------
|
|
|
|
if ( $delete_posts OR $delete_topics )
|
|
{
|
|
$this->ipsclass->DB->build_and_exec_query( array( 'delete' => 'posts',
|
|
'where' => 'author_id='.$member_id.' AND topic_id='.$r['topic_id'] ) );
|
|
|
|
$this->ipsclass->DB->build_and_exec_query( array( 'delete' => 'topics',
|
|
'where' => 'tid='.$r['topic_id'] ) );
|
|
|
|
$forums_affected[ $topic['forum_id'] ] = $topic['forum_id'];
|
|
$topics_deleted++;
|
|
$posts_deleted += $topic_i_posted['count'];
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Is this a topic we started?
|
|
//-----------------------------------------
|
|
|
|
else if ( $topic['starter_id'] == $member_id AND $delete_topics )
|
|
{
|
|
$this->ipsclass->DB->build_and_exec_query( array( 'delete' => 'posts',
|
|
'where' => 'topic_id='.$r['topic_id'] ) );
|
|
|
|
$this->ipsclass->DB->build_and_exec_query( array( 'delete' => 'topics',
|
|
'where' => 'tid='.$r['topic_id'] ) );
|
|
|
|
$forums_affected[ $topic['forum_id'] ] = $topic['forum_id'];
|
|
$topics_deleted++;
|
|
$posts_deleted += $topic['posts'] + 1;
|
|
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Just delete the post, then
|
|
//-----------------------------------------
|
|
|
|
else if ( $delete_posts AND ! $r['new_topic'] )
|
|
{
|
|
$this->ipsclass->DB->build_and_exec_query( array( 'delete' => 'posts',
|
|
'where' => 'pid='.$r['pid'] ) );
|
|
|
|
$forums_affected[ $topic['forum_id'] ] = $topic['forum_id'];
|
|
$topics_affected[ $topic['tid'] ] = $topic['tid'];
|
|
|
|
$posts_deleted++;
|
|
}
|
|
else
|
|
{
|
|
//-----------------------------------------
|
|
// Ignore this post...
|
|
//-----------------------------------------
|
|
|
|
$skipit++;
|
|
}
|
|
|
|
$done++;
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Rebuild topics and forums
|
|
//-----------------------------------------
|
|
|
|
if ( count( $topics_affected ) )
|
|
{
|
|
foreach( $topics_affected as $i => $tid )
|
|
{
|
|
$this->func_mod->rebuild_topic( $tid, 0 );
|
|
}
|
|
}
|
|
|
|
if ( count( $forums_affected ) )
|
|
{
|
|
foreach( $forums_affected as $i => $fid )
|
|
{
|
|
$this->func_mod->forum_recount( $fid );
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Finish - or more?...
|
|
//-----------------------------------------
|
|
|
|
if ( ! $done )
|
|
{
|
|
//-----------------------------------------
|
|
// Recount stats..
|
|
//-----------------------------------------
|
|
|
|
$this->func_mod->stats_recount();
|
|
|
|
//-----------------------------------------
|
|
// Reset member's posts
|
|
//-----------------------------------------
|
|
|
|
$forums = array();
|
|
|
|
foreach( $this->ipsclass->cache['forum_cache'] as $id => $data )
|
|
{
|
|
if ( ! $data['inc_postcount'] )
|
|
{
|
|
$forums[] = $data['id'];
|
|
}
|
|
}
|
|
|
|
|
|
if ( ! count( $forums ) )
|
|
{
|
|
$count = $this->ipsclass->DB->simple_exec_query( array( 'select' => 'count(*) as count', 'from' => 'posts', 'where' => 'queued != 1 AND author_id='.$member_id ) );
|
|
}
|
|
else
|
|
{
|
|
$this->ipsclass->DB->query( "SELECT count(p.pid) as count
|
|
FROM ".SQL_PREFIX."posts p, ".SQL_PREFIX."topics t
|
|
WHERE p.queued != 1 AND p.author_id={$member_id}
|
|
AND t.tid=p.topic_id AND t.forum_id NOT IN (".implode(",",$forums).")" );
|
|
|
|
$count = $this->ipsclass->DB->fetch_row();
|
|
}
|
|
|
|
$new_post_count = intval( $count['count'] );
|
|
|
|
$this->ipsclass->DB->do_update( 'members', array( 'posts' => $new_post_count ), 'id='.$member_id );
|
|
|
|
$this->ipsclass->admin->output_multiple_redirect_done( $this->ipsclass->acp_lang['mem_posts_process_done'] );
|
|
}
|
|
else
|
|
{
|
|
//-----------------------------------------
|
|
// More..
|
|
//-----------------------------------------
|
|
|
|
$url = $this->ipsclass->base_url.'&'.$this->ipsclass->form_code_js."&code=deleteposts_process&dpergo={$this->ipsclass->input['dpergo']}"
|
|
."&st={$end}"
|
|
."&init=1"
|
|
."&skipit={$skipit}"
|
|
."&dposts={$delete_posts}"
|
|
."&dtopics={$delete_topics}"
|
|
."&mid={$member_id}";
|
|
|
|
$text = sprintf( $this->ipsclass->acp_lang['mem_posts_process_more'], $end, $posts_deleted, $topics_deleted );
|
|
|
|
$this->ipsclass->admin->output_multiple_redirect_hit( $url, $img.' '.$text );
|
|
}
|
|
}
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
// Member Delete posts, start
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function member_delete_posts_start()
|
|
{
|
|
//-----------------------------------------
|
|
// Page set up
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->admin->page_title = $this->ipsclass->acp_lang['mem_delete_title'];
|
|
$this->ipsclass->admin->page_detail = $this->ipsclass->acp_lang['mem_delete_title_desc'];
|
|
|
|
//-----------------------------------------
|
|
// INIT
|
|
//-----------------------------------------
|
|
|
|
$member_id = intval($this->ipsclass->input['mid']);
|
|
|
|
//-----------------------------------------
|
|
// Get member
|
|
//-----------------------------------------
|
|
|
|
$member = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'members', 'where' => 'id='.$member_id ) );
|
|
|
|
//-----------------------------------------
|
|
// Non root admin attempting to edit root admin?
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->member['mgroup'] != $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
if ( $member['mgroup'] == $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
$this->ipsclass->admin->error("Âû íå ìîæåòå ðåäàêòèðîâàòü ãëàâíûõ àäìèíèñòðàòîðîâ");
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Get number of topics member has started
|
|
//-----------------------------------------
|
|
|
|
$topics = $this->ipsclass->DB->build_and_exec_query( array( 'select' => 'count(*) as count',
|
|
'from' => 'topics',
|
|
'where' => 'starter_id='.$member_id ) );
|
|
|
|
$posts = $this->ipsclass->DB->build_and_exec_query( array( 'select' => 'count(*) as count',
|
|
'from' => 'posts',
|
|
'where' => 'author_id='.$member_id ) );
|
|
|
|
//-----------------------------------------
|
|
// Got any posts?
|
|
//-----------------------------------------
|
|
|
|
if ( ! $posts['count'] )
|
|
{
|
|
$this->ipsclass->main_msg = "Íåò ñîîáùåíèé äëÿ óäàëåíèÿ!";
|
|
$this->search_results();
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Get number of topics member has started
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->acp_lang['mem_delete_delete_posts'] = sprintf( $this->ipsclass->acp_lang['mem_delete_delete_posts'] , intval($posts['count']) );
|
|
$this->ipsclass->acp_lang['mem_delete_delete_topics'] = sprintf( $this->ipsclass->acp_lang['mem_delete_delete_topics'], intval($topics['count']) );
|
|
|
|
$this->ipsclass->html .= $this->html->member_delete_posts_start( $member, intval($topics['count']), intval($posts['count']) );
|
|
|
|
$this->ipsclass->admin->output();
|
|
}
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
// PASS: COMPLETE
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function member_password_complete()
|
|
{
|
|
if ( ! $this->ipsclass->input['password'] )
|
|
{
|
|
$this->ipsclass->main_msg = "Âû äîëæíû ââåñòè ïàðîëü!";
|
|
$this->member_password_start();
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Get member
|
|
//-----------------------------------------
|
|
|
|
$member = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'members', 'where' => 'id='.$this->ipsclass->input['id'] ) );
|
|
|
|
//-----------------------------------------
|
|
// Non root admin attempting to edit root admin?
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->member['mgroup'] != $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
if ( $member['mgroup'] == $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
$this->ipsclass->admin->error("Âû íå ìîæåòå ðåäàêòèðîâàòü ãëàâíûõ àäìèíèñòðàòîðîâ");
|
|
}
|
|
}
|
|
|
|
$salt = $this->ipsclass->converge->generate_password_salt(5);
|
|
$salt = str_replace( '\\', "\\\\", $salt );
|
|
|
|
$key = $this->ipsclass->converge->generate_auto_log_in_key();
|
|
|
|
$md5_once = md5( trim($this->ipsclass->input['password']) );
|
|
|
|
$converge = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'members_converge', 'where' => 'converge_id='.$this->ipsclass->input['id'] ) );
|
|
|
|
$save_array = array();
|
|
|
|
if ( $this->ipsclass->input['newsalt'] )
|
|
{
|
|
$save_array['converge_pass_salt'] = $salt;
|
|
$save_array['converge_pass_hash'] = md5( md5($salt) . $md5_once );
|
|
}
|
|
else
|
|
{
|
|
$save_array['converge_pass_hash'] = md5( md5( $converge['converge_pass_salt'] ) . $md5_once );
|
|
}
|
|
|
|
$this->ipsclass->DB->do_update( 'members_converge', $save_array, 'converge_id='.$this->ipsclass->input['id'] );
|
|
|
|
if ( $this->ipsclass->input['newkey'] )
|
|
{
|
|
$this->ipsclass->DB->do_update( 'members', array( 'member_login_key' => $key ), 'id='.$this->ipsclass->input['id'] );
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Redirect
|
|
//-----------------------------------------
|
|
|
|
$page_query = "";
|
|
|
|
foreach( array('name','email','ip_address','aim_name','icq_number','yahoo','signature','posts','suspended', 'registered_first', 'registered_last','last_post_first', 'last_post_last', 'last_activity_first', 'last_activity_last','mgroup','namewhere','gotcount', 'fromdel') as $bit )
|
|
{
|
|
$page_query .= '&'.$bit.'='.trim($this->ipsclass->input[ $bit ]);
|
|
}
|
|
|
|
$this->ipsclass->admin->save_log("Èçìåíåí ïàðîëü ïîëüçîâàòåëÿ (ID: {$this->ipsclass->input['id']} )");
|
|
|
|
$this->ipsclass->admin->done_screen("Ïàðîëü èçìåíåí", "Ïîèñê ïîëüçîâàòåëåé", "{$this->ipsclass->form_code}".$page_query, "redirect" );
|
|
}
|
|
|
|
//-----------------------------------------
|
|
//
|
|
// PASS: START
|
|
//
|
|
//-----------------------------------------
|
|
|
|
function member_password_start()
|
|
{
|
|
//-----------------------------------------
|
|
// Redirect
|
|
//-----------------------------------------
|
|
|
|
$page_array = array( 1 => array( 'code' , 'dochangepassword' ),
|
|
2 => array( 'act' , 'mem' ),
|
|
3 => array( 'id' , $this->ipsclass->input['id'] ),
|
|
4 => array( 'section', $this->ipsclass->section_code ),
|
|
);
|
|
|
|
foreach( array('name','email','ip_address','aim_name','icq_number','yahoo','signature','posts','suspended', 'registered_first', 'registered_last','last_post_first', 'last_post_last', 'last_activity_first', 'last_activity_last','mgroup','namewhere','gotcount', 'fromdel') as $bit )
|
|
{
|
|
$page_array[] = array( $bit, trim($this->ipsclass->input[ $bit ]) );
|
|
}
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_form( $page_array );
|
|
|
|
//-----------------------------------------
|
|
// Get member
|
|
//-----------------------------------------
|
|
|
|
$member = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'members', 'where' => 'id='.$this->ipsclass->input['id'] ) );
|
|
|
|
//-----------------------------------------
|
|
// Non root admin attempting to edit root admin?
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->member['mgroup'] != $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
if ( $member['mgroup'] == $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
$this->ipsclass->admin->error("Âû íå ìîæåòå ðåäàêòèðîâàòü ãëàâíûõ àäìèíèñòðàòîðîâ");
|
|
}
|
|
}
|
|
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "40%" );
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "60%" );
|
|
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Èçìåíåíèå ïàðîëÿ ïîëüçîâàòåëÿ: {$member['members_display_name']}" );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<strong>Ââåäèòå íîâûé ïàðîëü</strong>" ,
|
|
$this->ipsclass->adskin->form_input('password' ),
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ñîçäàòü íîâûé êåø ïàðîëÿ?</b><div style='color:gray'>Ïðè âûáîðå 'Äà', áóäåò ñîçäàí íîâûé êåø ïàðîëÿ.<br />Ïîìîãàåò â òåõ ñëó÷àÿõ, êîãäà ïîëüçîâàòåëü èìååò ïðîáëåìû ñî âõîäîì â ñèñòåìó.</div>" ,
|
|
$this->ipsclass->adskin->form_yes_no( "newsalt", 1 )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ñîçäàòü íîâûé êëþ÷ äîñòóïà?</b><div style='color:gray'>Ïðè âûáîðå 'Äà', áóäóò ñîçäàíû íîâûå Cookie äëÿ ýòîãî ïîëüçîâàòåëÿ.<br />Ïîìîãàåò â òåõ ñëó÷àÿõ, êîãäà ïîëüçîâàòåëü èìååò ïðîáëåìû ñî âõîäîì â ñèñòåìó.<br />Òåêóùèå Cookie ïîëüçîâàòåëÿ ðàáîòàòü íå áóäóò.</div>" ,
|
|
$this->ipsclass->adskin->form_yes_no( "newkey", 1 )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_form("Èçìåíèòü ïàðîëü");
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
$this->ipsclass->admin->output();
|
|
}
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
//
|
|
// TEMP BANNING
|
|
//
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function member_suspend_start()
|
|
{
|
|
$this->ipsclass->admin->page_title = "Áëîêèðîâêà ïîëüçîâàòåëÿ";
|
|
|
|
$this->ipsclass->admin->page_detail = "Ýòà ñåêöèÿ ïîçâîëÿåò ïîñòàâèòü âðåìåííóþ áëîêèðîâêó ïîëüçîâàòåëÿ. Äîñòàòî÷íî ëèøü ââåñòè âðåìÿ áëîêèðîâêè";
|
|
|
|
$contents = "{membername},\nÀäìèíèñòðàòîð ôîðóìà {$this->ipsclass->vars['board_name']} âðåìåííî çàáëîêèðîâàë âàøó ó÷åòíóþ çàïèñü\n\nÂàøà ó÷åòíàÿ çàïèñü áóäåò àêòèâíà ñ {date_end} (â çàâèñèìîñòè îò âàøåãî ÷àñîâîãî ïîÿñà). Ýòî ïîëíîñòüþ àâòîìàòè÷åñêèé ïðîöåññ áëîêèðîâêè è îò âàñ íå òðåáóåòñÿ íè÷åãî äåëàòü äëÿ åãî óñêîðåíèÿ èëè ïðåêðàùåíèÿ.\n\nÔîðóì: {$this->ipsclass->vars['board_url']}/index.php";
|
|
|
|
if ($this->ipsclass->input['mid'] == "")
|
|
{
|
|
$this->ipsclass->admin->error("You must specify a valid member id, please go back and try again");
|
|
}
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'members', 'where' => "id=".intval($this->ipsclass->input['mid']) ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
if ( ! $member = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$this->ipsclass->admin->error("Âû äîëæíû ââåñòè ïðàâèëüíûé ID ïîëüçîâàòåëÿ, âåðíèòåñü è ïîïðîáóéòå åùå ðàç");
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Non root admin attempting to edit root admin?
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->member['mgroup'] != $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
if ( $member['mgroup'] == $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
$this->ipsclass->admin->error("Âû íå ìîæåòå ðåäàêòèðîâàòü ãëàâíûõ àäìèíèñòðàòîðîâ");
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Redirect
|
|
//-----------------------------------------
|
|
|
|
$page_array = array( 1 => array( 'code' , 'dobanmember' ),
|
|
2 => array( 'act' , 'mem' ),
|
|
3 => array( 'mid' , $this->ipsclass->input['mid'] ),
|
|
4 => array( 'section', $this->ipsclass->section_code ),
|
|
) ;
|
|
|
|
foreach( array('name','email','ip_address','aim_name','icq_number','yahoo','signature','posts','suspended', 'registered_first', 'registered_last','last_post_first', 'last_post_last', 'last_activity_first', 'last_activity_last','mgroup','namewhere','gotcount', 'fromdel') as $bit )
|
|
{
|
|
$page_array[] = array( $bit, trim($this->ipsclass->input[ $bit ]) );
|
|
}
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_form( $page_array );
|
|
|
|
$ban = $this->ipsclass->hdl_ban_line( $member['temp_ban'] );
|
|
|
|
$units = array( 0 => array( 'h', '÷àñîâ' ), 1 => array( 'd', 'äíåé' ) );
|
|
|
|
//-----------------------------------------
|
|
// Start form
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "40%" );
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "60%" );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Áëîêèðîâêà ó÷åòíîé çàïèñè ïîëüçîâàòåëÿ", "Ïðèìå÷àíèå: Åñëè ýòîò ïîëüçîâàòåëü áûë óæå çàáëîêèðîâàí, òî îòñ÷åò âðåìåíè íîâîé áëîêèðîâêè ïåðåêðîåò ñòàðóþ (îòñ÷åò âðåìåíè íà÷íåòñÿ ñ òåêóùåãî ìîìåíòà)." );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<strong>Çàáëîêèðîâàòü {$member['members_display_name']} íà...</strong>" ,
|
|
$this->ipsclass->adskin->form_input('timespan', $ban['timespan'], "text", "", '5' ) . ' ' . $this->ipsclass->adskin->form_dropdown('units', $units, $ban['units'] ),
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ïðåäóïðåäèòü ïîëüçîâàòåëÿ ïî email?</b><br>(Åñëè ÷òî, òî Âû ìîæåòå îòðåäàêòèðîâàòü òåêñò ñîîáùåíèÿ íèæå)" ,
|
|
$this->ipsclass->adskin->form_yes_no( "send_email", 0 )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ñîäåðæèìîå ïèñüìà</b><br>(Äîñòóïíûå òýãè: {membername} = èìÿ ïîëüçîâàòåëÿ, {date_end} = äàòà è âðåìÿ îêîí÷àíèÿ áëîêèðîâêè)" ,
|
|
$this->ipsclass->adskin->form_textarea( "email_contents", $contents )
|
|
), "", 'top' );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_form("Çàáëîêèðîâàòü");
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
$this->ipsclass->admin->output();
|
|
}
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
//
|
|
// SUSPEND COMPLETE
|
|
//
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function member_suspend_complete()
|
|
{
|
|
$this->ipsclass->admin->page_title = "Áëîêèðîâêà ó÷åòíîé çàïèñè ïîëüçîâàòåëÿ";
|
|
|
|
$this->ipsclass->admin->page_detail = "Àâòîìàòè÷åñêàÿ áëîêèðîâêà ó÷åòíîé çàïèñè ïîëüçîâàòåëÿ. Äîïîëíèòåëüíàÿ èíôîðìàöèÿ";
|
|
|
|
$this->ipsclass->input['mid'] = intval($this->ipsclass->input['mid']);
|
|
|
|
if ($this->ipsclass->input['mid'] == "")
|
|
{
|
|
$this->ipsclass->admin->error("Âû äîëæíû ââåñòè ïðàâèëüíûé ID ïîëüçîâàòåëÿ, âåðíèòåñü è ïîïðîáóéòå åùå ðàç");
|
|
}
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'members', 'where' => "id=".intval($this->ipsclass->input['mid']) ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
if ( ! $member = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$this->ipsclass->admin->error("Íåâîçìîæíî íàéòè ïîëüçîâàòåëÿ ñ òàêèì ID");
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Non root admin attempting to edit root admin?
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->member['mgroup'] != $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
if ( $member['mgroup'] == $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
$this->ipsclass->admin->error("Âû íå ìîæåòå ðåäàêòèðîâàòü ãëàâíûõ àäìèíèñòðàòîðîâ");
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Work out end date
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->input['timespan'] = intval($this->ipsclass->input['timespan']);
|
|
|
|
if ( $this->ipsclass->input['timespan'] == "" )
|
|
{
|
|
$new_ban = "";
|
|
}
|
|
else
|
|
{
|
|
$new_ban = $this->ipsclass->hdl_ban_line( array( 'timespan' => intval($this->ipsclass->input['timespan']), 'unit' => $this->ipsclass->input['units'] ) );
|
|
}
|
|
|
|
$show_ban = $this->ipsclass->hdl_ban_line( $new_ban );
|
|
|
|
//-----------------------------------------
|
|
// Update and show confirmation
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->do_update( 'members', array( 'temp_ban' => $new_ban ), "id=".$this->ipsclass->input['mid'] );
|
|
|
|
// I say, did we choose to email 'dis member?
|
|
|
|
if ($this->ipsclass->input['send_email'] == 1)
|
|
{
|
|
// By golly, we did!
|
|
|
|
require "./sources/classes/class_email.php";
|
|
|
|
$this->email = new emailer();
|
|
$this->email->ipsclass =& $this->ipsclass;
|
|
$this->email->email_init();
|
|
|
|
$msg = trim($this->ipsclass->txt_stripslashes($_POST['email_contents']));
|
|
|
|
$msg = str_replace( "{membername}", $member['members_display_name'] , $msg );
|
|
$msg = str_replace( "{date_end}" , $this->ipsclass->admin->get_date( $show_ban['date_end'], 'LONG') , $msg );
|
|
|
|
$this->email->message = $this->email->clean_message($msg);
|
|
$this->email->subject = "Óâåäîìëåíèå î áëîêèðîâêå ó÷åòíîé çàïèñè";
|
|
$this->email->to = $member['email'];
|
|
$this->email->send_mail();
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Redirect
|
|
//-----------------------------------------
|
|
|
|
$page_query = "";
|
|
|
|
foreach( array('name','email','ip_address','aim_name','icq_number','yahoo','signature','posts','suspended', 'registered_first', 'registered_last','last_post_first', 'last_post_last', 'last_activity_first', 'last_activity_last','mgroup','namewhere','gotcount', 'fromdel') as $bit )
|
|
{
|
|
$page_query .= '&'.$bit.'='.trim($this->ipsclass->input[ $bit ]);
|
|
}
|
|
|
|
$this->ipsclass->admin->save_log("Çàáëîêèðîâàí ïîëüçîâàòåëü ( {$member['members_display_name']} )");
|
|
|
|
$this->ipsclass->admin->done_screen("Ïîëüçîâàòåëü çàáëîêèðîâàí", "Ïîèñê ïîëüçîâàòåëåé", "{$this->ipsclass->form_code}".$page_query, "redirect" );
|
|
}
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
//
|
|
// Unsuspend
|
|
//
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function member_unsuspend()
|
|
{
|
|
if ($this->ipsclass->input['mid'] == "")
|
|
{
|
|
$this->ipsclass->admin->error("Âû äîëæíû ââåñòè ïðàâèëüíûé ID ïîëüçîâàòåëÿ, âåðíèòåñü è ïîïðîáóéòå åùå ðàç");
|
|
}
|
|
|
|
if ($this->ipsclass->input['mid'] == 'all')
|
|
{
|
|
$this->ipsclass->DB->do_update( 'members', array( 'temp_ban' => $new_ban ), "" );
|
|
|
|
$this->ipsclass->admin->save_log("Âñå ïîëüçîâàòåëè ðàçáëîêèðîâàíû");
|
|
|
|
$msg = "Âñå ïîëüçîâàòåëè ðàçáëîêèðîâàíû";
|
|
}
|
|
else
|
|
{
|
|
$mid = intval($this->ipsclass->input['mid']);
|
|
|
|
$this->ipsclass->DB->do_update( 'members', array( 'temp_ban' => $new_ban ), "id=$mid" );
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => 'members_display_name', 'from' => 'members', 'where' => "id=$mid" ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
$member = $this->ipsclass->DB->fetch_row();
|
|
|
|
$this->ipsclass->admin->save_log("Ïîëüçîâàòåëü {$member['members_display_name']} ðàçáëîêèðîâàí");
|
|
|
|
$msg = "{$member['members_display_name']} ðàçáëîêèðîâàí";
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Redirect
|
|
//-----------------------------------------
|
|
|
|
$page_query = "&members_display_name=".$member['members_display_name'];
|
|
|
|
$this->ipsclass->admin->done_screen($msg, "Ïîèñê ïîëüçîâàòåëåé", "{$this->ipsclass->form_code}".$page_query, "redirect" );
|
|
}
|
|
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
// CHANGE MEMBER DISPLAY NAME
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function member_change_display_name_do()
|
|
{
|
|
//-----------------------------------------
|
|
// INIT
|
|
//-----------------------------------------
|
|
|
|
$mid = intval( $this->ipsclass->input['mid'] );
|
|
$display_name = $this->ipsclass->input['new_name'];
|
|
|
|
//-----------------------------------------
|
|
// Check
|
|
//-----------------------------------------
|
|
|
|
if ( ! $mid )
|
|
{
|
|
$this->ipsclass->admin->error("Âû äîëæíû ââåñòè ïðàâèëüíûé ID ïîëüçîâàòåëÿ, âåðíèòåñü è ïîïðîáóéòå åùå ðàç");
|
|
}
|
|
|
|
if ($this->ipsclass->input['new_name'] == "")
|
|
{
|
|
$this->member_change_name_start("Âû äîëæíû ââåñòè íîâîå èìÿ äëÿ ýòîãî ïîëüçîâàòåëÿ");
|
|
exit();
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Select
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'members', 'where' => "id=".$mid ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
if ( ! $member = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$this->ipsclass->admin->error("Íåâîçìîæíî íàéòè ïîëüçîâàòåëÿ ñ òàêèì ID");
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Non root admin attempting to edit root admin?
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->member['mgroup'] != $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
if ( $member['mgroup'] == $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
$this->ipsclass->admin->error("Âû íå ìîæåòå ðåäàêòèðîâàòü ãëàâíûõ àäìèíèñòðàòîðîâ ");
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Check
|
|
//-----------------------------------------
|
|
|
|
if ( $display_name == $member['members_display_name'] )
|
|
{
|
|
$this->member_change_display_name("Íîâîå èìÿ ïîëüçîâàòåëÿ àíàëîãè÷íî ñòàðîìó, âåðíèòåñü íàçàä è ââåäèòå äðóãîå");
|
|
exit();
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Load ban filters
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'banfilters' ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
while( $r = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$banfilters[ $r['ban_type'] ][] = $r['ban_content'];
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Check for missing fields / chars.
|
|
//-----------------------------------------
|
|
|
|
if ( ! $display_name )
|
|
{
|
|
$this->member_change_display_name("Âû äîëæíû ââåñòè èìÿ");
|
|
exit();
|
|
}
|
|
|
|
if ( preg_match( "#[\[\];,\|]#", $display_name ) )
|
|
{
|
|
$this->member_change_display_name("Â íîâîì èìåíè åñòü çàïðåùåííûå ñèìâîëû");
|
|
exit();
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Are they banned [NAMES]?
|
|
//-----------------------------------------
|
|
|
|
if ( is_array( $banfilters['name'] ) and count( $banfilters['name'] ) )
|
|
{
|
|
foreach ( $banfilters['name'] as $n )
|
|
{
|
|
if ( $n == "" )
|
|
{
|
|
continue;
|
|
}
|
|
|
|
if ( preg_match( "/".preg_quote($n, '/' )."/i", $display_name ) )
|
|
{
|
|
$found_name = 1;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Check for existing name.
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->build_query( array( 'select' => "members_display_name, id",
|
|
'from' => 'members',
|
|
'where' => "LOWER(members_display_name)='{$display_name}' AND id != ".$mid,
|
|
'limit' => array( 0,1 ) ) );
|
|
|
|
$this->ipsclass->DB->exec_query();
|
|
|
|
//-----------------------------------------
|
|
// Got any results?
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->DB->get_num_rows() )
|
|
{
|
|
$found_name = 1;
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Check for existing LOG IN name.
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->vars['auth_dnames_nologinname'] )
|
|
{
|
|
$this->ipsclass->DB->build_query( array( 'select' => "members_display_name, id",
|
|
'from' => 'members',
|
|
'where' => "LOWER(name)='{$display_name}' AND id != ".$mid,
|
|
'limit' => array( 0,1 ) ) );
|
|
|
|
$this->ipsclass->DB->exec_query();
|
|
|
|
if ( $this->ipsclass->DB->get_num_rows() )
|
|
{
|
|
$found_name = 1;
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Got a name?
|
|
//-----------------------------------------
|
|
|
|
if ( $found_name )
|
|
{
|
|
$this->member_change_display_name("Ýòî èìÿ óæå èñïîëüçóåòñÿ äðóãèì ïîëüçîâàòåëåì");
|
|
exit();
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Insert into change log
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->force_data_type = array( 'dname_previous' => 'string',
|
|
'dname_current' => 'string' );
|
|
|
|
$this->ipsclass->DB->do_insert( 'dnames_change', array( 'dname_member_id' => $member['id'],
|
|
'dname_date' => time(),
|
|
'dname_ip_address' => $this->ipsclass->ip_address,
|
|
'dname_previous' => $member['members_display_name'],
|
|
'dname_current' => $display_name ) );
|
|
|
|
//-----------------------------------------
|
|
// Still here? Change it then
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->do_update( 'members' , array( 'members_display_name' => $display_name ), "id=" .$member['id'] );
|
|
$this->ipsclass->DB->do_update( 'contacts' , array( 'contact_name' => $display_name ), "contact_id=" .$member['id'] );
|
|
$this->ipsclass->DB->do_update( 'forums' , array( 'last_poster_name' => $display_name ), "last_poster_id=".$member['id'] );
|
|
$this->ipsclass->DB->do_update( 'sessions' , array( 'member_name' => $display_name ), "member_id=" .$member['id'] );
|
|
$this->ipsclass->DB->do_update( 'topics' , array( 'starter_name' => $display_name ), "starter_id=" .$member['id'] );
|
|
$this->ipsclass->DB->do_update( 'topics' , array( 'last_poster_name' => $display_name ), "last_poster_id=".$member['id'] );
|
|
|
|
//-----------------------------------------
|
|
// Recache moderators
|
|
//-----------------------------------------
|
|
|
|
require_once( ROOT_PATH .'sources/action_admin/moderator.php' );
|
|
$admod = new ad_moderator();
|
|
$admod->ipsclass =& $this->ipsclass;
|
|
|
|
$admod->rebuild_moderator_cache();
|
|
|
|
//-----------------------------------------
|
|
// Recache announcements
|
|
//-----------------------------------------
|
|
|
|
require_once( ROOT_PATH.'sources/action_public/announcements.php' );
|
|
$announcements = new announcements();
|
|
$announcements->ipsclass =& $this->ipsclass;
|
|
$announcements->announce_recache();
|
|
|
|
//-----------------------------------------
|
|
// Recache forums
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->update_forum_cache();
|
|
|
|
//-----------------------------------------
|
|
// 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' => '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 ) );
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// LOG
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->admin->save_log("Èçìåíåíî èìÿ ïîëüçîâàòåëÿ: ñ '{$member['members_display_name']}' íà '$display_name'");
|
|
|
|
//-----------------------------------------
|
|
// Redirect
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->input['members_display_name'] = $display_name;
|
|
|
|
$this->ipsclass->admin->done_screen("Èìÿ ïîëüçîâàòåëÿ èçìåíåíî", "Ïîèñê ïîëüçîâàòåëåé", "{$this->ipsclass->form_code}".$this->_generate_page_string_url(), "redirect" );
|
|
}
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
// Change name (display name)
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function member_change_display_name($message="")
|
|
{
|
|
//-----------------------------------------
|
|
// INIT
|
|
//-----------------------------------------
|
|
|
|
$mid = intval($this->ipsclass->input['mid']);
|
|
|
|
//-----------------------------------------
|
|
// Page titles
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->admin->page_title = "Èçìåíåíèå èìåíè ïîëüçîâàòåëÿ";
|
|
$this->ipsclass->admin->page_detail = "Â ýòîé ñåêöèè âû ìîæåòå èçìåíèòü òåêóùåå èìÿ ïîëüçîâàòåëÿ.";
|
|
|
|
//-----------------------------------------
|
|
// Check
|
|
//-----------------------------------------
|
|
|
|
if ( ! $mid )
|
|
{
|
|
$this->ipsclass->admin->error("Âû äîëæíû ââåñòè ïðàâèëüíûé ID ïîëüçîâàòåëÿ, âåðíèòåñü è ïîïðîáóéòå åùå ðàç");
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Get member
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'members', 'where' => "id=".$mid ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
if ( ! $member = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$this->ipsclass->admin->error("Íåâîçìîæíî íàéòè ïîëüçîâàòåëÿ ñ òàêèì ID");
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Non root admin attempting to edit root admin?
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->member['mgroup'] != $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
if ( $member['mgroup'] == $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
$this->ipsclass->admin->error("Âû íå ìîæåòå ðåäàêòèðîâàòü ãëàâíûõ àäìèíèñòðàòîðîâ");
|
|
}
|
|
}
|
|
|
|
$contents = "Óâàæàåìûé(àÿ) {old_name},\nÀäìèíèñòðàòîð ôîðóìà {$this->ipsclass->vars['board_name']} èçìåíèë âàøå èìÿ ïîëüçîâàòåëÿ.\n\nÂàøå íîâîå èìÿ ïîëüçîâàòåëÿ: {new_name}\n\nÏîæàëóéñòà, çàïîìíèòå åãî, ïðè ñëåäóþùåì âõîäå â ñèñòåìó âàì ïîòðåáóåòñÿ ââåñòè èìåííî ýòî èìÿ ïîëüçîâàòåëÿ.\nÔîðóì: {$this->ipsclass->vars['board_url']}/index.php";
|
|
|
|
//-----------------------------------------
|
|
// FORM
|
|
//-----------------------------------------
|
|
|
|
$page_array = array( 1 => array( 'code' , 'change_display_name_do' ),
|
|
2 => array( 'act' , 'mem' ),
|
|
3 => array( 'mid' , $mid ),
|
|
4 => array( 'section', $this->ipsclass->section_code ),
|
|
);
|
|
|
|
$page_array = array_merge( $page_array, $this->_generate_page_string() );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_form( $page_array );
|
|
|
|
//-----------------------------------------
|
|
// start form
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "40%" );
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "60%" );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Èçìåíåíèå èìåíè ïîëüçîâàòåëÿ" );
|
|
|
|
if ($message != "")
|
|
{
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Îøèáêà:</b>" ,
|
|
"<b><span style='color:red'>$message</span></b>",
|
|
) );
|
|
}
|
|
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Òåêóùåå èìÿ ïîëüçîâàòåëÿ</b>" ,
|
|
$member['members_display_name'],
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Íîâîå èìÿ ïîëüçîâàòåëÿ</b><div class='desctext'>Çàïðåùåííûå ñèìâîëû: [ ] | ; ,</div>" ,
|
|
$this->ipsclass->adskin->form_input( "new_name", $this->ipsclass->input['new_name'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_form("Èçìåíèòü èìÿ ïîëüçîâàòåëÿ");
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
$this->ipsclass->admin->output();
|
|
}
|
|
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
//
|
|
// CHANGE MEMBER NAME
|
|
//
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function member_change_name_complete()
|
|
{
|
|
$this->ipsclass->input['new_name'] = str_replace( '|', '|', $this->ipsclass->input['new_name'] );
|
|
|
|
//-----------------------------------------
|
|
// Check
|
|
//-----------------------------------------
|
|
|
|
if ($this->ipsclass->input['mid'] == "")
|
|
{
|
|
$this->ipsclass->admin->error("Âû íå âûáðàëè ïîëüçîâàòåëÿ");
|
|
}
|
|
|
|
if ($this->ipsclass->input['new_name'] == "")
|
|
{
|
|
$this->member_change_name_start("Âû äîëæíû ââåñòè èìÿ äëÿ ýòîãî ïîëüçîâàòåëÿ");
|
|
exit();
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Select
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'members', 'where' => "id=".intval($this->ipsclass->input['mid']) ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
if ( ! $member = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$this->ipsclass->admin->error("Âû íå âûáðàëè ïîëüçîâàòåëÿ");
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Non root admin attempting to edit root admin?
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->member['mgroup'] != $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
if ( $member['mgroup'] == $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
$this->ipsclass->admin->error("Âû íå ìîæåòå ðåäàêòèðîâàòü ãëàâíûõ àäìèíèñòðàòîðîâ ");
|
|
}
|
|
}
|
|
|
|
$mid = $this->ipsclass->input['mid']; // Save me poor ol' carpels
|
|
|
|
if ($this->ipsclass->input['new_name'] == $member['name'])
|
|
{
|
|
$this->member_change_name_start("Íîâîå èìÿ, òî÷íî òàêîå æå, êàê è ñòàðîå, òàê íå äîëæíî áûòü");
|
|
exit();
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Check to ensure that his member name hasn't already been taken.
|
|
//-----------------------------------------
|
|
|
|
$new_name = trim($this->ipsclass->input['new_name']);
|
|
|
|
$this->ipsclass->DB->cache_add_query( 'login_getmember', array( 'username' => strtolower($new_name) ) );
|
|
$this->ipsclass->DB->cache_exec_query();
|
|
|
|
if ( $this->ipsclass->DB->get_num_rows() )
|
|
{
|
|
$this->member_change_name_start("Èìÿ '$new_name' óæå ñóùåñòâóåò, âûáåðèòå äðóãîå");
|
|
exit();
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// If one gets here, one can assume that the new name is correct for one, er...one.
|
|
// So, lets do the converteroo
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->do_update( 'members' , array( 'name' => $new_name ), "id=" .$mid );
|
|
|
|
if ( ! $this->ipsclass->vars['auth_allow_dnames'] )
|
|
{
|
|
//-----------------------------------------
|
|
// Not using sep. display names?
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->do_update( 'members' , array( 'members_display_name' => $new_name ), "id=" .$mid );
|
|
|
|
# Not using Display names? Then update....
|
|
$this->ipsclass->DB->do_update( 'contacts' , array( 'contact_name' => $new_name ), "contact_id=" .$mid );
|
|
$this->ipsclass->DB->do_update( 'forums' , array( 'last_poster_name' => $new_name ), "last_poster_id=".$mid );
|
|
$this->ipsclass->DB->do_update( 'sessions' , array( 'member_name' => $new_name ), "member_id=" .$mid );
|
|
$this->ipsclass->DB->do_update( 'topics' , array( 'starter_name' => $new_name ), "starter_id=" .$mid );
|
|
$this->ipsclass->DB->do_update( 'topics' , array( 'last_poster_name' => $new_name ), "last_poster_id=".$mid );
|
|
|
|
//-----------------------------------------
|
|
// Recache moderators
|
|
//-----------------------------------------
|
|
|
|
require_once( ROOT_PATH .'sources/action_admin/moderator.php' );
|
|
$admod = new ad_moderator();
|
|
$admod->ipsclass =& $this->ipsclass;
|
|
|
|
$admod->rebuild_moderator_cache();
|
|
|
|
//-----------------------------------------
|
|
// Recache announcements
|
|
//-----------------------------------------
|
|
|
|
require_once( ROOT_PATH.'sources/action_public/announcements.php' );
|
|
$announcements = new announcements();
|
|
$announcements->ipsclass =& $this->ipsclass;
|
|
$announcements->announce_recache();
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// 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' => '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 ) );
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// I say, did we choose to email 'dis member?
|
|
//-----------------------------------------
|
|
|
|
if ($this->ipsclass->input['send_email'] == 1)
|
|
{
|
|
//-----------------------------------------
|
|
// By golly, we did!
|
|
//-----------------------------------------
|
|
|
|
require_once( ROOT_PATH."sources/classes/class_email.php" );
|
|
|
|
$this->email = new emailer();
|
|
$this->email->ipsclass =& $this->ipsclass;
|
|
$this->email->email_init();
|
|
|
|
$msg = trim($_POST['email_contents']);
|
|
|
|
$msg = str_replace( "{old_name}", $member['name'], $msg );
|
|
$msg = str_replace( "{new_name}", $new_name , $msg );
|
|
|
|
$this->email->message = stripslashes($this->email->clean_message($msg));
|
|
$this->email->subject = "Óâåäîìëåíèå ïîëüçîâàòåëþ î ñìåíå åãî èìåíè";
|
|
$this->email->to = $member['email'];
|
|
$this->email->send_mail();
|
|
}
|
|
|
|
$this->ipsclass->admin->save_log("Èçìåíèòü èìÿ: ñ '{$member['name']}' íà '$new_name'");
|
|
|
|
if ( USE_MODULES == 1 )
|
|
{
|
|
$this->modules->register_class($this);
|
|
$this->modules->on_name_change($mid, $new_name );
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Redirect
|
|
//-----------------------------------------
|
|
|
|
$page_query = "";
|
|
|
|
$this->ipsclass->input['name'] = $new_name;
|
|
|
|
foreach( array('name','email','ip_address','aim_name','icq_number','yahoo','signature','posts','suspended', 'registered_first', 'registered_last','last_post_first', 'last_post_last', 'last_activity_first', 'last_activity_last','mgroup','namewhere','gotcount', 'fromdel') as $bit )
|
|
{
|
|
$page_query .= '&'.$bit.'='.trim($this->ipsclass->input[ $bit ]);
|
|
}
|
|
|
|
$this->ipsclass->admin->done_screen("Èìÿ ïîëüçîâàòåëÿ èçìåíåíî", "Ïîèñê ïîëüçîâàòåëåé", "{$this->ipsclass->form_code}".$page_query, "redirect" );
|
|
}
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
//
|
|
// Change name complete
|
|
//
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function member_change_name_start($message="")
|
|
{
|
|
$this->ipsclass->admin->page_title = "Èçìåíåíèå èìåíè ïîëüçîâàòåëÿ";
|
|
|
|
$this->ipsclass->admin->page_detail = "Â ýòîé ñåêöèè âû ìîæåòå èçìåíèòü òåêóùåå èìÿ ïîëüçîâàòåëÿ.";
|
|
|
|
//-----------------------------------------
|
|
// check
|
|
//-----------------------------------------
|
|
|
|
if ($this->ipsclass->input['mid'] == "")
|
|
{
|
|
$this->ipsclass->admin->error("Âû äîëæíû ââåñòè ïðàâèëüíûé ID ïîëüçîâàòåëÿ, âåðíèòåñü è ïîïðîáóéòå åùå ðàç");
|
|
}
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'members', 'where' => "id=".intval($this->ipsclass->input['mid']) ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
if ( ! $member = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$this->ipsclass->admin->error("Íåâîçìîæíî íàéòè ïîëüçîâàòåëÿ ñ òàêèì ID");
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Non root admin attempting to edit root admin?
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->member['mgroup'] != $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
if ( $member['mgroup'] == $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
$this->ipsclass->admin->error("Âû íå ìîæåòå ðåäàêòèðîâàòü ãëàâíûõ àäìèíèñòðàòîðîâ");
|
|
}
|
|
}
|
|
|
|
$contents = "Óâàæàåìûé(àÿ) {old_name}.\nÀäìèíèñòðàòîð ôîðóìà {$this->ipsclass->vars['board_name']} èçìåíèë âàøå èìÿ ïîëüçîâàòåëÿ.\n\nÂàøå íîâîå èìÿ ïîëüçîâàòåëÿ: {new_name}\n\nÏîæàëóéñòà, çàïîìíèòå åãî, ïðè ñëåäóþùåì âõîäå â ñèñòåìó âàì ïîòðåáóåòñÿ ââåñòè èìåííî ýòî èìÿ ïîëüçîâàòåëÿ.\nÔîðóì: {$this->ipsclass->vars['board_url']}/index.php";
|
|
|
|
//-----------------------------------------
|
|
// Redirect
|
|
//-----------------------------------------
|
|
|
|
$page_array = array( 1 => array( 'code' , 'dochangename' ),
|
|
2 => array( 'act' , 'mem' ),
|
|
3 => array( 'mid' , $this->ipsclass->input['mid'] ),
|
|
4 => array( 'section', $this->ipsclass->section_code ),
|
|
);
|
|
|
|
foreach( array('name','email','ip_address','aim_name','icq_number','yahoo','signature','posts','suspended', 'registered_first', 'registered_last','last_post_first', 'last_post_last', 'last_activity_first', 'last_activity_last','mgroup','namewhere','gotcount', 'fromdel') as $bit )
|
|
{
|
|
$page_array[] = array( $bit, trim($this->ipsclass->input[ $bit ]) );
|
|
}
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_form( $page_array );
|
|
|
|
//-----------------------------------------
|
|
// start form
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "40%" );
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "60%" );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Èçìåíåíèå èìåíè ïîëüçîâàòåëÿ" );
|
|
|
|
if ($message != "")
|
|
{
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Îøèáêà:</b>" ,
|
|
"<b><span style='color:red'>$message</span></b>",
|
|
) );
|
|
}
|
|
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Òåêóùåå èìÿ ïîëüçîâàòåëÿ</b>" ,
|
|
$member['name'],
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Íîâîå èìÿ ïîëüçîâàòåëÿ</b>" ,
|
|
$this->ipsclass->adskin->form_input( "new_name", $this->ipsclass->input['new_name'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ïðåäóïðåäèòü ïîëüçîâàòåëÿ ïî email?</b><br>(Åñëè ÷òî, òî Âû ìîæåòå îòðåäàêòèðîâàòü òåêñò ñîîáùåíèÿ íèæå)" ,
|
|
$this->ipsclass->adskin->form_yes_no( "send_email", 1 )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ñîäåðæèìîå ïèñüìà</b><br>(Äîñòóïíûå òýãè: {old_name} = òåêóùåå èìÿ ïîëüçîâàòåëÿ, {new_name} = íîâîå èìÿ ïîëüçîâàòåëÿ)" ,
|
|
$this->ipsclass->adskin->form_textarea( "email_contents", $contents )
|
|
) );
|
|
|
|
$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];
|
|
}
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// 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();
|
|
$email->ipsclass =& $this->ipsclass;
|
|
$email->email_init();
|
|
|
|
$email->get_template("complete_reg");
|
|
|
|
$email->build_message( "" );
|
|
|
|
//-----------------------------------------
|
|
// 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['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)." ïîëüçîâàòåëåé àêòèâèðîâàíî");
|
|
|
|
//-----------------------------------------
|
|
// 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();
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// DELETE
|
|
//-----------------------------------------
|
|
|
|
else
|
|
{
|
|
$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("Óäàëåííûå ðåãèñòðàöèè");
|
|
|
|
$this->ipsclass->main_msg = count($ids)." ïîëüçîâàòåëåé óäàëåíî";
|
|
$this->member_view_moderation_queue();
|
|
}
|
|
}
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
// View member moderation queue
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function member_view_moderation_queue()
|
|
{
|
|
//-----------------------------------------
|
|
// INIT
|
|
//-----------------------------------------
|
|
|
|
$st = intval($this->ipsclass->input['st']);
|
|
$ord = $this->ipsclass->input['ord'] == 'asc' ? 'asc' : 'desc';
|
|
$new_ord = $ord == 'asc' ? 'desc' : 'asc';
|
|
$filter = $this->ipsclass->input['filter'];
|
|
$q_extra = "";
|
|
$content = "";
|
|
|
|
//-----------------------------------------
|
|
// SET PAGE TITLE
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->admin->page_title = "Óïðàâëåíèå ïîäòâåðæäåíèÿìè";
|
|
$this->ipsclass->admin->page_detail = "Ýòà ñåêöèÿ ïîçâîëÿåò âàì ïîäòâåðäèòü ðåãèñòðàöèþ èëè îòêàçàòü â ðåãèñòðàöèè.<br>Òàêæå ýòà ñåêöèÿ äàåò âîçìîæíîñòü ïîäòâåðäèòü èëè çàïðåòèòü ñìåíó àäðåñà email ó âûáðàííûõ ïîëüçîâàòåëåé.<br><br>Cïèñîê íèæå ïîçâîëèò âàì áûñòðî ïîäòâåðäèòü ðåãèñòðàöèè òåõ ïîëüçîâàòåëåé, êòî íå ïîëó÷èë ïèñüìî ñ êîäîì àêòèâàöèè.";
|
|
|
|
//-----------------------------------------
|
|
// Add extra query
|
|
//-----------------------------------------
|
|
|
|
switch( $filter )
|
|
{
|
|
case 'reg_user_validate':
|
|
$q_extra = " AND v.new_reg=1 AND v.user_verified=0";
|
|
break;
|
|
case 'reg_admin_validate':
|
|
$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->simple_construct( array( 'select' => 'COUNT(*) as mcount', 'from' => 'validating v', 'where' => "v.lost_pass=0".$q_extra ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
$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->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->cache_add_query( 'member_view_mod', array( 'col' => $col, 'ord' => $ord, 'st' => $st, 'extra' => $q_extra ) );
|
|
$this->ipsclass->DB->cache_exec_query();
|
|
|
|
while ( $r = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
if ($r['coppa_user'] == 1)
|
|
{
|
|
$r['_coppa'] = ' ( Çàïðîñ COPPA )';
|
|
}
|
|
else
|
|
{
|
|
$r['_coppa'] = "";
|
|
}
|
|
|
|
$r['_where'] = ( $r['lost_pass'] ? 'Ïîòåðÿí ïàðîëü' : ( $r['new_reg'] ? "Ðåãèñòðàöèÿ <strong>(Àêòèâàöèÿ ïîëüçîâàòåëåé)</strong>" : ( $r['email_chg'] ? "Èçìåíåíèå e-mail" : 'N/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 ( $r['name'] == "" )
|
|
{
|
|
$r['name'] = "<em>Óäàëèòü ïîëüçîâàòåëÿ</em>";
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Print row
|
|
//-----------------------------------------
|
|
|
|
$content .= $this->html->member_validating_row( $r );
|
|
}
|
|
}
|
|
|
|
$this->ipsclass->html .= $this->html->member_validating_wrapper($content, $st, $new_ord, $links);
|
|
|
|
$this->ipsclass->admin->output();
|
|
}
|
|
|
|
|
|
//-----------------------------------------
|
|
//
|
|
// MEMBER RANKS...
|
|
//
|
|
//-----------------------------------------
|
|
|
|
function titles_recache()
|
|
{
|
|
$this->ipsclass->cache['ranks'] = array();
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => 'id, title, pips, posts',
|
|
'from' => 'titles',
|
|
'order' => "posts DESC",
|
|
) );
|
|
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
while ($i = $this->ipsclass->DB->fetch_row())
|
|
{
|
|
$this->ipsclass->cache['ranks'][ $i['id'] ] = array(
|
|
'TITLE' => $i['title'],
|
|
'PIPS' => $i['pips'],
|
|
'POSTS' => $i['posts'],
|
|
);
|
|
}
|
|
|
|
$this->ipsclass->update_cache( array( 'name' => 'ranks', 'array' => 1, 'deletefirst' => 1 ) );
|
|
}
|
|
|
|
|
|
|
|
function titles_start()
|
|
{
|
|
$this->ipsclass->admin->page_title = "Óïðàâëåíèå çâàíèÿìè";
|
|
|
|
$this->ipsclass->admin->page_detail = "Ýòà ñåêöèÿ ïîçâîëÿåò âàì èçìåíÿòü, óäàëÿòü è äîáàâëÿòü íîâûå çâàíèÿ.<br>Åñëè âû õîòèòå, ÷òîáû ôîðóì ïîêàçûâàë çâåçäî÷êè ïîä èìåíåì ïîëüçîâàòåëÿ, ââåäèòå èõ êîëè÷åñòâî.<br>Åñëè âû õîòèòå, ÷òîáû ôîðóì ïîêàçûâàë ñïåöèàëüíîå èçîáðàæåíèå ïîä èìåíåì ïîëüçîâàòåëÿ, äîñòàòî÷íî ââåñòè ññûëêó ñ íàçâàíèåì èçîáðàæåíèÿ.<br>Ïðèìå÷àíèå: ýòè èçîáðàæåíèÿ äîëæíû íàõîäèòüñÿ â ïàïêå 'style_images/{img_dir}/folder_team_icons'.";
|
|
|
|
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->adskin->td_header[] = array( "Íàçâàíèå" , "30%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "Òðåáóåòñÿ ñîîáùåíèé" , "10%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "Çâåçäî÷êè" , "20%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "Èçìåíåíèå" , "20%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "Óäàëåíèå" , "20%" );
|
|
|
|
//-----------------------------------------
|
|
// Parse macro
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'skin_sets', 'where' => "set_default=1" ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
$mid = $this->ipsclass->DB->fetch_row();
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => 'macro_replace', 'from' => 'skin_macro', 'where' => "macro_set=1 AND macro_value='A_STAR'" ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
$row = $this->ipsclass->DB->fetch_row();
|
|
|
|
$row['A_STAR'] = str_replace( "<#IMG_DIR#>", $mid['set_image_dir'], $row['macro_replace'] );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Çâàíèÿ ïîëüçîâàòåëåé" );
|
|
|
|
//-----------------------------------------
|
|
// Lets get on with it...
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'titles', 'order' => "posts" ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
while ( $r = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$img = "";
|
|
|
|
if ( preg_match( "/^\d+$/", $r['pips'] ) )
|
|
{
|
|
for ($i = 1; $i <= $r['pips']; $i++)
|
|
{
|
|
$img .= $row['A_STAR'];
|
|
|
|
}
|
|
}
|
|
else
|
|
{
|
|
$img = "<img src='style_images/{$mid['set_image_dir']}/folder_team_icons/{$r['pips']}' border='0'>";
|
|
}
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>".$r['title']."</b>" ,
|
|
$r['posts'],
|
|
$img,
|
|
"<a href='{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=rank_edit&id={$r['id']}'>Èçìåíèòü</a>",
|
|
"<a href='{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=rank_delete&id={$r['id']}'>Óäàëèòü</a>",
|
|
) );
|
|
}
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'do_add_rank' ),
|
|
2 => array( 'act' , 'mem' ),
|
|
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( "Äîáàâëåíèå çâàíèÿ" );
|
|
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Íàçâàíèå çâàíèÿ</b>" ,
|
|
$this->ipsclass->adskin->form_input( "title" )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ìèíèìàëüíîå êîëè÷åñòâî ñîîáùåíèé äëÿ ïîëó÷åíèÿ çâàíèÿ</b>" ,
|
|
$this->ipsclass->adskin->form_input( "posts" )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Êîëè÷åñòâî çâåçäî÷åê</b><div class='graytext'>Èëè íàçâàíèå - èçîáðàæåíèå äîëæíî áûòü çàãðóæåíî â ïàïêó 'style_images/{img_dir}/folder_team_icons'</div>" ,
|
|
$this->ipsclass->adskin->form_input( "pips" )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_form("Äîáàâèòü ýòî çâàíèå");
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
$this->ipsclass->admin->output();
|
|
}
|
|
|
|
//-----------------------------------------
|
|
|
|
function titles_add_rank()
|
|
{
|
|
//-----------------------------------------
|
|
// check for input
|
|
//-----------------------------------------
|
|
|
|
foreach( array( 'posts', 'title', 'pips' ) as $field )
|
|
{
|
|
if ($this->ipsclass->input[ $field ] == "")
|
|
{
|
|
$this->ipsclass->admin->error("Âû äîëæíîñòüþ ïîëíîñòüþ çàïîëíèòü ôîðìó");
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Add it to the DB
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->do_insert( 'titles', array(
|
|
'posts' => trim($this->ipsclass->input['posts']),
|
|
'title' => trim($this->ipsclass->input['title']),
|
|
'pips' => trim($this->ipsclass->input['pips']),
|
|
) );
|
|
|
|
$this->titles_recache();
|
|
|
|
$this->ipsclass->admin->done_screen("Çâàíèå äîáàâëåíî", "Óïðàâëåíèå çâàíèÿìè", "{$this->ipsclass->form_code}&code=title", 'redirect' );
|
|
|
|
|
|
}
|
|
|
|
//-----------------------------------------
|
|
|
|
function titles_delete_rank()
|
|
{
|
|
//-----------------------------------------
|
|
// check for input
|
|
//-----------------------------------------
|
|
|
|
if ($this->ipsclass->input['id'] == "")
|
|
{
|
|
$this->ipsclass->admin->error("Íåâîçìîæíî íàéòè çâàíèå ñ òàêèì ID");
|
|
}
|
|
|
|
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'titles', 'where' => "id='".$this->ipsclass->input['id']."'" ) );
|
|
|
|
$this->titles_recache();
|
|
|
|
$this->ipsclass->admin->save_log("Óäàëåíî çâàíèå");
|
|
|
|
$this->ipsclass->admin->done_screen("Çâàíèå óäàëåíî", "Óïðàâëåíèå çâàíèÿìè", "{$this->ipsclass->form_code}&code=title", 'redirect' );
|
|
|
|
}
|
|
|
|
//-----------------------------------------
|
|
|
|
function titles_edit_rank()
|
|
{
|
|
//-----------------------------------------
|
|
// check for input
|
|
//-----------------------------------------
|
|
|
|
if ($this->ipsclass->input['id'] == "")
|
|
{
|
|
$this->ipsclass->admin->error("Íåâîçìîæíî íàéòè çâàíèå ñ òàêèì ID");
|
|
}
|
|
|
|
//-----------------------------------------
|
|
|
|
foreach( array( 'posts', 'title', 'pips' ) as $field )
|
|
{
|
|
if ($this->ipsclass->input[ $field ] == "")
|
|
{
|
|
$this->ipsclass->admin->error("Âû äîëæíîñòüþ ïîëíîñòüþ çàïîëíèòü ôîðìó");
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Add it to the DB
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->do_update( 'titles', array (
|
|
'posts' => trim($this->ipsclass->input['posts']),
|
|
'title' => trim($this->ipsclass->input['title']),
|
|
'pips' => trim($this->ipsclass->input['pips']),
|
|
) , "id='".$this->ipsclass->input['id']."'" );
|
|
|
|
$this->titles_recache();
|
|
|
|
$this->ipsclass->admin->save_log("Èçìåíåíî çâàíèå");
|
|
|
|
$this->ipsclass->admin->done_screen("Çâàíèå èçìåíåíî", "Óïðàâëåíèå çâàíèÿìè", "{$this->ipsclass->form_code}&code=title", 'redirect' );
|
|
|
|
|
|
}
|
|
|
|
//-----------------------------------------
|
|
|
|
function titles_rank_setup($mode='edit')
|
|
{
|
|
$this->ipsclass->admin->page_title = "Óïðàâëåíèå çâàíèÿìè";
|
|
|
|
$this->ipsclass->admin->page_detail = "Åñëè âû õîòèòå, ÷òîáû ôîðóì ïîêàçûâàë çâåçäî÷êè ïîä èìåíåì ïîëüçîâàòåëÿ, ââåäèòå èõ êîëè÷åñòâî.<br>Åñëè âû õîòèòå, ÷òîáû ôîðóì ïîêàçûâàë ñïåöèàëüíîå èçîáðàæåíèå ïîä èìåíåì ïîëüçîâàòåëÿ, äîñòàòî÷íî ââåñòè ññûëêó ñ íàçâàíèåì èçîáðàæåíèÿ.<br>Ïðèìå÷àíèå: ýòè èçîáðàæåíèÿ äîëæíû íàõîäèòüñÿ â ïàïêå 'style_images/{img_dir}/folder_team_icons'.";
|
|
|
|
if ($mode == 'edit')
|
|
{
|
|
$form_code = 'do_rank_edit';
|
|
|
|
if ($this->ipsclass->input['id'] == "")
|
|
{
|
|
$this->ipsclass->admin->error("Íåâîçìîæíî íàéòè çâàíèå ñ òàêèì ID");
|
|
}
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'titles', 'where' => "id='".$this->ipsclass->input['id']."'" ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
$rank = $this->ipsclass->DB->fetch_row();
|
|
|
|
$button = "Èçìåíèòü ýòî çâàíèå";
|
|
}
|
|
else
|
|
{
|
|
$form_code = 'do_add_rank';
|
|
$rank = array( 'posts' => "", 'title' => "", 'pips' => "");
|
|
$button = "Äîáàâèòü ýòî çâàíèå";
|
|
}
|
|
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , $form_code ),
|
|
2 => array( 'act' , 'mem' ),
|
|
3 => array( 'id' , $rank['id'] ),
|
|
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( "Çâàíèÿ ïîëüçîâàòåëåé" );
|
|
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Íàçâàíèå çâàíèÿ</b>" ,
|
|
$this->ipsclass->adskin->form_input( "title", $rank['title'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ìèíèìàëüíîå êîëè÷åñòâî ñîîáùåíèé äëÿ ïîëó÷åíèÿ çâàíèÿ</b>" ,
|
|
$this->ipsclass->adskin->form_input( "posts", $rank['posts'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Êîëè÷åñòâî çâåçäî÷åê</b><br>Èëè íàçâàíèå - èçîáðàæåíèå äîëæíî áûòü çàãðóæåíî â ïàïêó 'style_images/{img_dir}/folder_team_icons'" ,
|
|
$this->ipsclass->adskin->form_input( "pips", $rank['pips'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_form($button);
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
$this->ipsclass->admin->output();
|
|
|
|
|
|
}
|
|
|
|
//-----------------------------------------
|
|
|
|
function member_prune_confirm($ids=array(), $query)
|
|
{
|
|
//-----------------------------------------
|
|
// Got members?
|
|
//-----------------------------------------
|
|
|
|
if ( count($ids) < 101)
|
|
{
|
|
foreach( $ids as $i => $n )
|
|
{
|
|
$member_arr[] = "<a href='index.php?showuser={$n[0]}' target='_blank'>{$n[1]}</a>";
|
|
}
|
|
}
|
|
|
|
$this->ipsclass->admin->page_title = "Óäàëåíèå ïîëüçîâàòåëåé";
|
|
|
|
$this->ipsclass->admin->page_detail = "Ïîæàëóéñòà, ïîäòâåðäèòå âàøå äåéñòâèå.";
|
|
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'doprune' ),
|
|
2 => array( 'act' , 'mem' ),
|
|
3 => array( 'query' , str_replace( "'", ''', $query ) ),
|
|
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( "Ïîäòâåðæäåíèå óäàëåíèÿ" );
|
|
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Êîëè÷åñòâî óäàëÿåìûõ ïîëüçîâàòåëåé</b>" ,
|
|
count($ids)
|
|
) );
|
|
|
|
if ( count($member_arr) > 0 )
|
|
{
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Èìåíà ïîëüçîâàòåëåé</b>" ,
|
|
implode( '<br />', $member_arr )
|
|
) );
|
|
}
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_form("Óäàëèòü ýòèõ ïîëüçîâàòåëåé");
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
$this->ipsclass->admin->output();
|
|
|
|
}
|
|
|
|
|
|
//-----------------------------------------
|
|
//
|
|
// COMPLETE PRUNE
|
|
//
|
|
//-----------------------------------------
|
|
|
|
function member_doprune()
|
|
{
|
|
//-----------------------------------------
|
|
// Make sure we have *something*
|
|
//-----------------------------------------
|
|
|
|
$query = trim(urldecode($this->ipsclass->txt_stripslashes($_POST['query'])));
|
|
|
|
$query = str_replace( "<" , "<", $query );
|
|
$query = str_replace( ">" , ">", $query );
|
|
$query = str_replace( ''', "'", $query );
|
|
|
|
if ($query == "")
|
|
{
|
|
$this->ipsclass->admin->error("Îøèáêà óäàëåíèÿ");
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Get the member ids...
|
|
//-----------------------------------------
|
|
|
|
$ids = array();
|
|
|
|
$this->ipsclass->DB->query($query);
|
|
|
|
if ( $this->ipsclass->DB->get_num_rows() )
|
|
{
|
|
while ($i = $this->ipsclass->DB->fetch_row())
|
|
{
|
|
if ( $i['memid'] )
|
|
{
|
|
$ids[] = $i['memid'];
|
|
}
|
|
else if ( $i['id'] )
|
|
{
|
|
$ids[] = $i['id'];
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
$this->ipsclass->admin->error("Íåâîçìîæíî íàéòè ïîëüçîâàòåëåé äëÿ óäàëåíèÿ");
|
|
}
|
|
|
|
$this->member_delete_do($ids);
|
|
|
|
$this->ipsclass->admin->done_screen("Ïîëüçîâàòåëè óäàëåíû", "Óïðàâëåíèå ïîëüçîâàòåëÿìè", "{$this->ipsclass->form_code}" );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
//
|
|
// DELETE MEMBER(S)
|
|
//
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function member_delete_do($id)
|
|
{
|
|
//-----------------------------------------
|
|
// INIT
|
|
//-----------------------------------------
|
|
|
|
$tmp_mids = array();
|
|
|
|
//-----------------------------------------
|
|
// Sort out thingie
|
|
//-----------------------------------------
|
|
|
|
if ( is_array( $id ) )
|
|
{
|
|
$mids = ' IN ('.implode(",",$id).')';
|
|
}
|
|
else
|
|
{
|
|
$mids = ' = '.$id;
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Get accounts and check IDS
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => 'id, name, mgroup', 'from' => 'members', 'where' => 'id'.$mids ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
while ( $r = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
//-----------------------------------------
|
|
// Non root admin attempting to edit root admin?
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->member['mgroup'] != $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
if ( $r['mgroup'] == $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
continue;
|
|
}
|
|
}
|
|
|
|
$tmp_mids[] = $r['id'];
|
|
}
|
|
|
|
if ( ! count( $tmp_mids ) )
|
|
{
|
|
$this->ipsclass->admin->error("Íåò ïîëüçîâàòåëåé äëÿ óäàëåíèÿ");
|
|
}
|
|
|
|
$mids = ' IN ('.implode(",",$tmp_mids).')';
|
|
|
|
//-----------------------------------------
|
|
// Get avatars / photo
|
|
//-----------------------------------------
|
|
|
|
$delete_files = array();
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'member_extra', 'where' => 'id'.$mids ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
while( $r = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
if ( $r['photo_type'] == 'upload' and $r['photo_location'] )
|
|
{
|
|
$delete_files[] = $r['photo_location'];
|
|
}
|
|
|
|
if ( $r['avatar_type'] == 'upload' and $r['avatar_location'] )
|
|
{
|
|
$delete_files[] = $r['avatar_location'];
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Convert their posts and topics
|
|
// into guest postings..
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->do_update( 'posts' , array( 'author_id' => 0 ), "author_id".$mids );
|
|
$this->ipsclass->DB->do_update( 'topics', array( 'starter_id' => 0 ), "starter_id".$mids );
|
|
|
|
//-----------------------------------------
|
|
// Delete member...
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'pfields_content' , 'where' => "member_id".$mids ) );
|
|
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'member_extra' , 'where' => "id".$mids ) );
|
|
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'members_converge', 'where' => "converge_id".$mids ) );
|
|
|
|
//-----------------------------------------
|
|
// Delete member messages...
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->build_query( array( 'select' => 'mt_msg_id', 'from' => 'message_topics', 'where' => "mt_owner_id".$mids ) );
|
|
$this->ipsclass->DB->exec_query();
|
|
|
|
$messages = array();
|
|
while( $row = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$messages[] = $row['mt_msg_id'];
|
|
}
|
|
|
|
if( count($messages) > 0 )
|
|
{
|
|
$msgids = " IN(".implode( ",", $messages ).")";
|
|
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'message_text', 'where' => "msg_id".$msgids ) );
|
|
}
|
|
|
|
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'message_topics', 'where' => "mt_owner_id".$mids ) );
|
|
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'contacts' , 'where' => "member_id".$mids." or contact_id".$mids ) );
|
|
|
|
//-----------------------------------------
|
|
// Delete member subscriptions.
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'tracker' , 'where' => "member_id".$mids ) );
|
|
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'forum_tracker', 'where' => "member_id".$mids ) );
|
|
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'warn_logs' , 'where' => "wlog_mid" .$mids ) );
|
|
|
|
//-----------------------------------------
|
|
// Delete from validating..
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'validating', 'where' => "member_id".$mids ) );
|
|
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'members' , 'where' => "id".$mids ) );
|
|
|
|
//-----------------------------------------
|
|
// Delete avatars / photos
|
|
//-----------------------------------------
|
|
|
|
if ( count($delete_files) )
|
|
{
|
|
foreach( $delete_files as $file )
|
|
{
|
|
@unlink( $this->ipsclass->vars['upload_dir']."/".$file );
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Get current stats...
|
|
//-----------------------------------------
|
|
|
|
$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']));
|
|
|
|
//-----------------------------------------
|
|
// Rebuild stats
|
|
//-----------------------------------------
|
|
|
|
$r = $this->ipsclass->DB->simple_exec_query( array( 'select' => 'count(*) as members', 'from' => 'members', 'where' => "mgroup <> ".$this->ipsclass->vars['auth_group'] ) );
|
|
$stats['mem_count'] = intval( $r['members'] );
|
|
|
|
$r = $this->ipsclass->DB->simple_exec_query( array( 'select' => 'id, members_display_name',
|
|
'from' => 'members',
|
|
'where' => "mgroup <> ".$this->ipsclass->vars['auth_group'],
|
|
'order' => 'id DESC',
|
|
'limit' => array( 0, 1 )
|
|
) );
|
|
|
|
$stats['last_mem_name'] = $r['members_display_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 ) );
|
|
}
|
|
|
|
if ( USE_MODULES == 1 )
|
|
{
|
|
$this->modules->register_class($this);
|
|
$this->modules->on_delete($id);
|
|
}
|
|
}
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
//
|
|
// Delete Members
|
|
//
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function member_delete()
|
|
{
|
|
//-----------------------------------------
|
|
// Check input
|
|
//-----------------------------------------
|
|
|
|
if ( ! $this->ipsclass->input['mid'] )
|
|
{
|
|
$this->ipsclass->main_msg = "Ïîëüçîâàòåëü íå íàéäåí";
|
|
$this->search_form();
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Single or more?
|
|
//-----------------------------------------
|
|
|
|
if ( strstr( $this->ipsclass->input['mid'], ',' ) )
|
|
{
|
|
$ids = explode( ',', $this->ipsclass->input['mid'] );
|
|
}
|
|
else
|
|
{
|
|
$ids = array( $this->ipsclass->input['mid'] );
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Get accounts
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => 'id, name, mgroup', 'from' => 'members', 'where' => 'id IN ('.implode(",",$ids).')' ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
$names = array();
|
|
|
|
while ( $r = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
//-----------------------------------------
|
|
// Non root admin attempting to edit root admin?
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->member['mgroup'] != $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
if ( $r['mgroup'] == $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
continue;
|
|
}
|
|
}
|
|
|
|
$names[] = $r['name'];
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Check
|
|
//-----------------------------------------
|
|
|
|
if ( ! count( $names ) )
|
|
{
|
|
$this->ipsclass->main_msg = "Ïîëüçîâàòåëü íå íàéäåí";
|
|
$this->search_form();
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Delete
|
|
//-----------------------------------------
|
|
|
|
$this->member_delete_do( $ids );
|
|
|
|
//-----------------------------------------
|
|
// Redirect
|
|
//-----------------------------------------
|
|
|
|
$page_query = "";
|
|
|
|
foreach( array('name','email','ip_address','aim_name','icq_number','yahoo','signature','posts','suspended', 'registered_first', 'registered_last','last_post_first', 'last_post_last', 'last_activity_first', 'last_activity_last','mgroup','namewhere','gotcount', 'fromdel') as $bit )
|
|
{
|
|
$page_query .= '&'.$bit.'='.trim($this->ipsclass->input[ $bit ]);
|
|
}
|
|
|
|
$this->ipsclass->admin->save_log("Óäàëåí ïîëüçîâàòåëü ( ".implode(",",$names)." )");
|
|
|
|
$this->ipsclass->admin->done_screen("Ïîëüçîâàòåëü óäàëåí", "Ïîèñê ïîëüçîâàòåëåé", "{$this->ipsclass->form_code}".$page_query, "redirect" );
|
|
|
|
}
|
|
|
|
|
|
//-----------------------------------------
|
|
//
|
|
// ADD MEMBER FORM
|
|
//
|
|
//-----------------------------------------
|
|
|
|
function member_add_form()
|
|
{
|
|
//-----------------------------------------
|
|
// Page details
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->admin->page_title = "Ðåãèñòðàöèÿ ïîëüçîâàòåëÿ";
|
|
$this->ipsclass->admin->page_detail = "Âû ìîæåòå çàðåãèñòðèðîâàòü ïîëüçîâàòåëÿ ïîëüçóÿñü ôîðìîé íèæå.";
|
|
|
|
//-----------------------------------------
|
|
// Got admin restrictions?
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->member['row_perm_cache'] )
|
|
{
|
|
$this->ipsclass->html .= "<div class='input-warn-content' style='color:black'><strong>Note: You have ACP Permission Restrictions.</strong><br />Any member you create with a group that
|
|
that has access to the ACP will inherit your permission restrictions automatically.</div><br />";
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Groups
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => 'g_id, g_title', 'from' => 'groups', 'order' => "g_title" ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
//-----------------------------------------
|
|
// If non-root: Remove root group
|
|
//-----------------------------------------
|
|
|
|
while ( $r = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
if ( $this->ipsclass->vars['admin_group'] == $r['g_id'] )
|
|
{
|
|
if ( $this->ipsclass->member['mgroup'] != $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
continue;
|
|
}
|
|
}
|
|
|
|
$mem_group[] = array( $r['g_id'] , $r['g_title'] );
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Start table
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "40%" );
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "60%" );
|
|
|
|
//-----------------------------------------
|
|
// Custom profile fields stuff
|
|
//-----------------------------------------
|
|
|
|
$required_output = "";
|
|
$optional_output = "";
|
|
$custom_output = "";
|
|
|
|
require_once( ROOT_PATH.'sources/classes/class_custom_fields.php' );
|
|
$fields = new custom_fields( $this->ipsclass->DB );
|
|
|
|
$fields->cache_data = $this->ipsclass->cache['profilefields'];
|
|
|
|
$fields->init_data();
|
|
$fields->parse_to_register();
|
|
|
|
if ( count( $fields->out_fields ) )
|
|
{
|
|
$custom_out .= $this->ipsclass->adskin->add_td_basic( "Äîïîëíèòåëüíûå ïîëÿ â ïðîôèëå", "left", "pformstrip", 2 );
|
|
|
|
foreach( $fields->out_fields as $id => $data )
|
|
{
|
|
if ( $fields->cache_data[ $id ]['pf_type'] == 'drop' )
|
|
{
|
|
$form_element = "<select class='dropdown' name='field_{$id}'>{$data}</select>";
|
|
}
|
|
else if ( $fields->cache_data[ $id ]['pf_type'] == 'area' )
|
|
{
|
|
$form_element = $this->ipsclass->adskin->form_textarea( 'field_'.$id, $data );
|
|
}
|
|
else
|
|
{
|
|
$form_element = $this->ipsclass->adskin->form_input( 'field_'.$id, $data );
|
|
}
|
|
|
|
$custom_out .= $this->ipsclass->adskin->add_td_row( array( "<b>{$fields->field_names[ $id ]}</b><div class='graytext'>{$fields->field_desc[ $id ]}</div>" , $form_element ) );
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Start form
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'doadd' ),
|
|
2 => array( 'act' , 'mem' ),
|
|
4 => array( 'section', $this->ipsclass->section_code ),
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Äîáàâëåíèå ïîëüçîâàòåëÿ" );
|
|
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Èìÿ ïîëüçîâàòåëÿ</b>" ,
|
|
$this->ipsclass->adskin->form_input( "name", $_POST['name'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ïàðîëü</b>" ,
|
|
$this->ipsclass->adskin->form_input( "password", $_POST['password'], 'password' )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Àäðåñ email</b>" ,
|
|
$this->ipsclass->adskin->form_input( "email", $_POST['email'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ãðóïïà</b>" ,
|
|
$this->ipsclass->adskin->form_dropdown( "mgroup",
|
|
$mem_group,
|
|
$_POST['mgroup'] ? $_POST['mgroup'] : $this->ipsclass->vars['member_group']
|
|
)
|
|
) );
|
|
|
|
if ($custom_out != "")
|
|
{
|
|
$this->ipsclass->html .= $custom_out;
|
|
}
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_form("Äîáàâèòü ýòîãî ïîëüçîâàòåëÿ");
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
$this->ipsclass->admin->output();
|
|
}
|
|
|
|
//-----------------------------------------
|
|
//
|
|
// Add member
|
|
//
|
|
//-----------------------------------------
|
|
|
|
function member_do_add()
|
|
{
|
|
//-----------------------------------------
|
|
// Check form
|
|
//-----------------------------------------
|
|
|
|
foreach( array('name', 'password', 'email', 'mgroup') as $field )
|
|
{
|
|
if ( ! $_POST[ $field ] )
|
|
{
|
|
$this->ipsclass->admin->error("Âû äîëæíû çàïîëíèòü ôîðìó ïîëíîñòüþ!");
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Check
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->vars['admin_group'] == $this->ipsclass->input['mgroup'] )
|
|
{
|
|
if ($this->ipsclass->member['mgroup'] != $this->ipsclass->vars['admin_group'])
|
|
{
|
|
$this->ipsclass->admin->error("Òîëüêî ãëàâíûå àäìèíèñòðàòîðû ìîãóò ñîçäàòü ïîëüçîâàòåëÿ ñ òàêîé ãðóïïîé");
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Do we already have such a member?
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->cache_add_query( 'login_getmember', array( 'username' => strtolower($this->ipsclass->input['name']) ) );
|
|
$this->ipsclass->DB->cache_exec_query();
|
|
|
|
if ( $this->ipsclass->DB->get_num_rows() )
|
|
{
|
|
$this->ipsclass->main_msg = "Óæå åñòü ïîëüçîâàòåëü ñ òàêèì èìåíåì, ââåäèòå äðóãîå èìÿ ïîëüçîâàòåëÿ";
|
|
$this->member_add_form();
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// DNAME: Someone already using it?
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->vars['auth_dnames_nologinname'] )
|
|
{
|
|
$this->ipsclass->DB->cache_add_query( 'login_getmember_by_dname', array( 'username' => strtolower($this->ipsclass->input['name']) ) );
|
|
$this->ipsclass->DB->cache_exec_query();
|
|
|
|
if ( $this->ipsclass->DB->get_num_rows() )
|
|
{
|
|
$this->ipsclass->main_msg = "Ìû óæå èìååì ïîëüçîâàòåëÿ, êîòîðûé èñïîëüçóåò ýòî èìÿ, êàê îòîáðàæàåìîå èìÿ, ïîæàëóéñòà âûáåðèòå äðóãîå";
|
|
$this->member_add_form();
|
|
}
|
|
}
|
|
|
|
|
|
//-----------------------------------------
|
|
// Is this email addy taken? CONVERGE THIS??
|
|
//-----------------------------------------
|
|
|
|
$in_username = str_replace( '|', '|' , trim($this->ipsclass->input['name']) );
|
|
$in_username = trim( preg_replace( "/\s{2,}/", " ", $in_username ) );
|
|
$in_password = trim($this->ipsclass->input['password']);
|
|
$in_email = trim(strtolower($this->ipsclass->input['email']));
|
|
|
|
if( $this->ipsclass->txt_mb_strlen( $in_username ) > 32 )
|
|
{
|
|
$this->ipsclass->admin->error("Èìÿ ïîëüçîâàòåëÿ íå ìîæåò áûòü äëèíåå 32 ñèìâîëîâ!");
|
|
}
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => 'id', 'from' => 'members', 'where' => "email='".$in_email."'" ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
$email_check = $this->ipsclass->DB->fetch_row();
|
|
|
|
if ($email_check['id'])
|
|
{
|
|
$this->ipsclass->main_msg = "Óæå åñòü ïîëüçîâàòåëü ñ òàêèì e-mail àäðåñîì, ââåäèòå äðóãîé e-mail";
|
|
$this->member_add_form();
|
|
}
|
|
|
|
$member = array(
|
|
'name' => $in_username,
|
|
'members_display_name' => $in_username,
|
|
'member_login_key' => $this->ipsclass->converge->generate_auto_log_in_key(),
|
|
'email' => $in_email,
|
|
'mgroup' => intval($this->ipsclass->input['mgroup']),
|
|
'posts' => 0,
|
|
'joined' => time(),
|
|
'ip_address' => $this->ipsclass->input['IP_ADDRESS'],
|
|
'time_offset' => $this->ipsclass->vars['time_offset'],
|
|
'view_sigs' => 1,
|
|
'email_pm' => 1,
|
|
'view_img' => 1,
|
|
'view_avs' => 1,
|
|
'restrict_post' => 0,
|
|
'view_pop' => 1,
|
|
'msg_total' => 0,
|
|
'new_msg' => 0,
|
|
'coppa_user' => 0,
|
|
'language' => $this->ipsclass->vars['default_language'],
|
|
);
|
|
|
|
$salt = $this->ipsclass->converge->generate_password_salt(5);
|
|
$passhash = $this->ipsclass->converge->generate_compiled_passhash( $salt, md5($in_password) );
|
|
|
|
$converge = array( 'converge_email' => $in_email,
|
|
'converge_joined' => time(),
|
|
'converge_pass_hash' => $passhash,
|
|
'converge_pass_salt' => str_replace( '\\', "\\\\", $salt )
|
|
);
|
|
|
|
//-----------------------------------------
|
|
// Insert: CONVERGE
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->do_insert( 'members_converge', $converge );
|
|
|
|
//-----------------------------------------
|
|
// Get converges auto_increment user_id
|
|
//-----------------------------------------
|
|
|
|
$member_id = $this->ipsclass->DB->get_insert_id();
|
|
$member['id'] = $member_id;
|
|
|
|
//-----------------------------------------
|
|
// Insert: MEMBERS
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->force_data_type = array( 'name' => 'string' );
|
|
|
|
$this->ipsclass->DB->do_insert( 'members', $member );
|
|
|
|
//-----------------------------------------
|
|
// Insert: MEMBER EXTRA
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->do_insert( 'member_extra', array( 'id' => $member_id, 'vdirs' => 'in:Âõîäÿùèå|sent:Îòïðàâëåííûå' ) );
|
|
|
|
//-----------------------------------------
|
|
// Insert into the custom profile fields DB
|
|
//-----------------------------------------
|
|
|
|
require_once( ROOT_PATH.'sources/classes/class_custom_fields.php' );
|
|
$fields = new custom_fields( $this->ipsclass->DB );
|
|
|
|
$fields->member_id = $this->ipsclass->member['id'];
|
|
|
|
$fields->cache_data = $this->ipsclass->cache['profilefields'];
|
|
$fields->admin = intval($this->ipsclass->member['g_access_cp']);
|
|
$fields->supmod = intval($this->ipsclass->member['g_is_supmod']);
|
|
|
|
$fields->init_data();
|
|
$fields->parse_to_save(1);
|
|
|
|
//-----------------------------------------
|
|
// Custom profile field stuff
|
|
//-----------------------------------------
|
|
|
|
$fields->out_fields['member_id'] = $member['id'];
|
|
|
|
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'pfields_content', 'where' => 'member_id='.$member['id'] ) );
|
|
|
|
$this->ipsclass->DB->do_insert( 'pfields_content', $fields->out_fields );
|
|
|
|
//-----------------------------------------
|
|
// Restriction permissions stuff
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->member['row_perm_cache'] )
|
|
{
|
|
if ( $this->ipsclass->cache['group_cache'][ intval($this->ipsclass->input['mgroup']) ]['g_access_cp'] )
|
|
{
|
|
//-----------------------------------------
|
|
// Copy restrictions...
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->do_insert( 'admin_permission_rows', array( 'row_member_id' => $member['id'],
|
|
'row_perm_cache' => $this->ipsclass->member['row_perm_cache'],
|
|
'row_updated' => time() ) );
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Stats
|
|
//-----------------------------------------
|
|
|
|
$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']));
|
|
|
|
$stats['last_mem_name'] = $in_username;
|
|
$stats['last_mem_id'] = $member['id'];
|
|
|
|
$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']);
|
|
|
|
if ( count($stats) > 0 )
|
|
{
|
|
$this->ipsclass->cache['stats'] = $stats;
|
|
$this->ipsclass->update_cache( array( 'name' => 'stats', 'array' => 1, 'deletefirst' => 1 ) );
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Log and bog?
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->admin->save_log("Äîáàâëåí íîâûé ïîëüçîâàòåëü '{$this->ipsclass->input['name']}'");
|
|
|
|
$this->ipsclass->input['searchtype'] = 'normal';
|
|
$this->ipsclass->input['gotcount'] = 1;
|
|
|
|
$this->search_results();
|
|
|
|
//$this->ipsclass->admin->done_screen("Äîáàâëåí íîâûé ïîëüçîâàòåëü", "Óïðàâëåíèå ïîëüçîâàòåëÿìè", "{$this->ipsclass->form_code}&code=edit", 'redirect' );
|
|
|
|
}
|
|
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
//
|
|
// SEARCH FORM, SEARCH FOR MEMBER
|
|
//
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function search_form()
|
|
{
|
|
//-----------------------------------------
|
|
// INIT
|
|
//-----------------------------------------
|
|
|
|
$mem_group = array( 0 => array( 'all', 'Ëþáàÿ ãðóïïà') );
|
|
|
|
$this->ipsclass->admin->page_title = "Ðåäàêòèðîâàòü ïîëüçîâàòåëÿ";
|
|
$this->ipsclass->admin->page_detail = "Èñêàòü ïîëüçîâàòåëÿ.";
|
|
|
|
//-----------------------------------------
|
|
// Saved results?
|
|
//-----------------------------------------
|
|
|
|
if ( ( $this->ipsclass->input['gotcount'] > 1 and $this->ipsclass->input['fromdel'] ) or ( $this->ipsclass->input['gotcount'] and ! $this->ipsclass->input['fromdel'] ) )
|
|
{
|
|
$this->ipsclass->input['searchtype'] = 'normal';
|
|
$this->search_results();
|
|
}
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => 'g_id, g_title', 'from' => 'groups', 'order' => "g_title" ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
while ( $r = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$mem_group[] = array( $r['g_id'] , $r['g_title'] );
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Start form
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'searchresults' ),
|
|
2 => array( 'act' , 'mem' ),
|
|
4 => array( 'section', $this->ipsclass->section_code ),
|
|
) );
|
|
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "40%" );
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "60%" );
|
|
|
|
//-----------------------------------------
|
|
// Printy poos
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Ïîèñê ïîëüçîâàòåëåé" );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Èìÿ ïîëüçîâàòåëÿ ...</b><div class='graytext'>Âû ìîæåòå îñòàâèòü ýòî ïîëå ïóñòûì, åñëè èñïîëüçóåòå îïöèè, ïðåäñòàâëåííûå íèæå.</div>",
|
|
$this->ipsclass->adskin->form_dropdown( 'namewhere', array( 0 => array( 'begin' , 'íà÷èíàåòñÿ ñ' ),
|
|
1 => array( 'is' , 'ñîâïàäàåò ñ' ),
|
|
2 => array( 'contains', 'ñîäåðæèò' ),
|
|
3 => array( 'ends' , 'çàêàí÷èâàåòñÿ íà' )
|
|
), $_POST['namewhere']
|
|
)
|
|
.' '. $this->ipsclass->adskin->form_input( "name", $_POST['name'] )
|
|
) );
|
|
|
|
if ( $this->ipsclass->vars['auth_allow_dnames'] )
|
|
{
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b><u>ÈËÈ</u> Îòîáðàæàåìîå èìÿ</b><div class='graytext'>Âû ìîæåòå îñòàâèòü ýòî ïîëå ïóñòûì, åñëè èñïîëüçóåòå îïöèè, ïðåäñòàâëåííûå íèæå</div>",
|
|
$this->ipsclass->adskin->form_dropdown( 'dnamewhere', array( 0 => array( 'begin' , 'íà÷èíàåòñÿ ñ' ),
|
|
1 => array( 'is' , 'ñîâïàäàåò ñ' ),
|
|
2 => array( 'contains', 'ñîäåðæèò' ),
|
|
3 => array( 'ends' , 'çàêàí÷èâàåòñÿ íà' )
|
|
), $_POST['dnamewhere']
|
|
)
|
|
.' '. $this->ipsclass->adskin->form_input( "members_display_name", $_POST['members_display_name'] )
|
|
) );
|
|
}
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b><u>ÈËÈ</u> ID ïîëüçîâàòåëÿ...</b>" ,
|
|
$this->ipsclass->adskin->form_input( "memberid", $_POST['mid'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Òèï ïîèñêà:</b>" ,
|
|
$this->ipsclass->adskin->form_dropdown( "searchtype", array( 0 => array( 'normal', 'Íàéòè ïîëüçîâàòåëåé äëÿ èçìåíåíèÿ èëè óäàëåíèÿ' ),
|
|
1 => array( 'prune' , 'Ïîèñê ïîëüçîâàòåëåé äëÿ ìàññîâîãî óäàëåíèÿ' )
|
|
), $_POST['searchtype'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( "Äîïîëíèòåëüíûå îïöèè äëÿ ïîèñêà", "left", "pformstrip" );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Àäðåñ email ñîäåðæèò...</b>" ,
|
|
$this->ipsclass->adskin->form_input( "email", $_POST['email'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ïîëüçîâàòåëü çàáëîêèðîâàí</b>" ,
|
|
$this->ipsclass->adskin->form_dropdown( "suspended", array( 0=>array('0','Íå âàæíî'),1=>array('yes', 'Äà'),2=>array('no', 'Íåò') ), $_POST['suspended'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>IP-àäðåñ ñîäåðæèò...</b>" ,
|
|
$this->ipsclass->adskin->form_input( "ip_address", $_POST['ip_address'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Èäåíòèôèêàòîð AIM ñîäåðæèò...</b>" ,
|
|
$this->ipsclass->adskin->form_input( "aim_name", $_POST['aim_name'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Íîìåð ICQ ñîäåðæèò...</b>" ,
|
|
$this->ipsclass->adskin->form_input( "icq_number", $_POST['icq_number'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Èäåíòèôèêàòîð Yahoo! ñîäåðæèò...</b>" ,
|
|
$this->ipsclass->adskin->form_input( "yahoo", $_POST['yahoo'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ïîäïèñü ñîäåðæèò...</b>" ,
|
|
$this->ipsclass->adskin->form_input( "signature", $_POST['signature'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Êîëè÷åñòâî ñîîáùåíèé ìåíüøå, ÷åì:</b>" ,
|
|
$this->ipsclass->adskin->form_input( "posts", $_POST['posts'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Çàðåãèñòðèðîâàí ìåæäó (ôîðìàò äàò: MM-ÄÄ-ÃÃÃÃ)</b><div class='graytext'>Ïðèìåð: 11-02-1988 (2 íîÿáðÿ 1988 ã.)<br />Îñòàâüòå ïåðâîå ïîëå ïóñòûì äëÿ ïîèñêà ñ ñàìîé ðàííåé ðåãèñòðàöèè, èëè ïîñëåäíåå - äî ñàìîé ïîñëåäíåé ðåãèñòðàöèè.</div>",
|
|
$this->ipsclass->adskin->form_simple_input( "registered_first", $_POST['registered_first'], 10 ). ' äî ' .$this->ipsclass->adskin->form_simple_input( "registered_last", $_POST['registered_last'], 10 )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ïîñëåäíåå ñîîáùåíèå ìåæäó (ôîðìàò äàò: MM-ÄÄ-ÃÃÃÃ)</b><div class='graytext'>Ïðèìåð: 11-02-1988 (2 íîÿáðÿ 1988 ã.)<br />Îñòàâüòå ïåðâîå ïîëå ïóñòûì äëÿ ïîèñêà ñ ñàìîãî ïåðâîãî ñîîáùåíèÿ, èëè ïîñëåäíåå - äî ñàìîãî ïîñëåäíåãî ñîîáùåíèÿ.</div>" ,
|
|
$this->ipsclass->adskin->form_simple_input( "last_post_first", $_POST['last_post_first'], 10 ). ' äî ' . $this->ipsclass->adskin->form_simple_input( "last_post_last", $_POST['last_post_last'], 10 )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ïîñëåäíåå ïîñåùåíèå ìåæäó (ôîðìàò äàò: MM-ÄÄ-ÃÃÃÃ)</b><div class='graytext'>Ïðèìåð: 11-02-1988 (2 íîÿáðÿ 1988 ã.)<br />Îñòàâüòå ïåðâîå ïîëå ïóñòûì äëÿ ïîèñêà ñ ñàìîãî ðàííåãî ïîñåùåíèÿ, èëè ïîñëåäíåå - äî ñàìîãî ïîñëåäíåãî.</div>" ,
|
|
$this->ipsclass->adskin->form_simple_input( "last_activity_first", $_POST['last_activity_first'], 10 ). ' to ' . $this->ipsclass->adskin->form_simple_input( "last_activity_last", $_POST['last_activity_last'], 10 )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Â êàêîé ãðóïïå?</b>" ,
|
|
$this->ipsclass->adskin->form_dropdown( "mgroup", $mem_group, $_POST['mgroup'] )
|
|
) );
|
|
|
|
//-----------------------------------------
|
|
// Get custom profile information
|
|
//-----------------------------------------
|
|
|
|
require_once( ROOT_PATH.'sources/classes/class_custom_fields.php' );
|
|
$fields = new custom_fields( $this->ipsclass->DB );
|
|
|
|
$fields->member_id = $this->ipsclass->member['id'];
|
|
$fields->admin = intval($this->ipsclass->member['g_access_cp']);
|
|
$fields->supmod = intval($this->ipsclass->member['g_is_supmod']);
|
|
|
|
$fields->init_data();
|
|
$fields->parse_to_edit();
|
|
|
|
if ( count( $fields->out_fields ) )
|
|
{
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( "Custom Profile Fields", "left", "pformstrip" );
|
|
|
|
foreach( $fields->out_fields as $id => $data )
|
|
{
|
|
if ( $fields->cache_data[ $id ]['pf_type'] == 'drop' )
|
|
{
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>".$fields->field_names[ $id ]."</b>" ,
|
|
"<select class='dropdown' name='cm_field_{$id}'><option value=''>Any...</option>{$data}</select>"
|
|
) );
|
|
}
|
|
else
|
|
{
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>".$fields->field_names[ $id ]."</b>" ,
|
|
$this->ipsclass->adskin->form_simple_input('cm_field_'.$id, $_POST['field_'.$id], 10 )
|
|
) );
|
|
}
|
|
}
|
|
}
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_form("Íàéòè ïîëüçîâàòåëåé");
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
$this->ipsclass->admin->output();
|
|
|
|
|
|
}
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
//
|
|
// SEARCH RESULTS
|
|
//
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function search_results()
|
|
{
|
|
$page_query = "";
|
|
$un_all = "";
|
|
|
|
$query = array();
|
|
|
|
//-----------------------------------------
|
|
// Member extra?
|
|
//-----------------------------------------
|
|
|
|
$member_extra = array( 'aim_name', 'icq_number', 'yahoo', 'signature' );
|
|
$date_keys = array( 'registered_first', 'registered_last','last_post_first', 'last_post_last', 'last_activity_first', 'last_activity_last' );
|
|
|
|
//-----------------------------------------
|
|
// Loopy loo
|
|
//-----------------------------------------
|
|
|
|
foreach( array('name', 'members_display_name', 'memberid', 'email','ip_address','aim_name','icq_number','yahoo','signature','posts','suspended', 'registered_first', 'registered_last','last_post_first', 'last_post_last', 'last_activity_first', 'last_activity_last','mgroup') as $bit )
|
|
{
|
|
$this->ipsclass->input[ $bit ] = urldecode(trim($this->ipsclass->input[ $bit ]));
|
|
|
|
$page_query .= '&'.$bit.'='.urlencode($this->ipsclass->input[ $bit ]);
|
|
|
|
//-----------------------------------------
|
|
// Table?
|
|
//-----------------------------------------
|
|
|
|
$table_prefix = in_array( $bit, $member_extra ) ? 'me.' : 'm.';
|
|
|
|
if ( $this->ipsclass->input[ $bit ] )
|
|
{
|
|
//-----------------------------------------
|
|
// Time / Date
|
|
//-----------------------------------------
|
|
|
|
if ( in_array( $bit, $date_keys ) )
|
|
{
|
|
list( $month, $day, $year ) = explode( '-', $this->ipsclass->input[ $bit ] );
|
|
|
|
if ( ! checkdate( $month, $day, $year ) )
|
|
{
|
|
$this->ipsclass->main_msg = "Íåâåðíàÿ äàòà (Äåíü: $day, Ìåñÿö: $month, Ãîä: $year). Ôîðìàò äàòû äîëæåí èìåòü âèä: ÌÌ-ÄÄ-ÃÃÃÃ. Íàïðèìåð: 11-02-1988 (2 íîÿáðÿ 1988 ã.)";
|
|
$this->search_form();
|
|
}
|
|
|
|
$time_int = mktime( 0, 0 ,0,$month, $day, $year );
|
|
$tmp_bit = str_replace( '_first' , '', $bit );
|
|
$tmp_bit = str_replace( '_last' , '', $tmp_bit );
|
|
$tmp_bit = str_replace( 'registered', 'joined', $tmp_bit );
|
|
|
|
if ( strstr( $bit, '_first' ) )
|
|
{
|
|
$query[] = $table_prefix.$tmp_bit.' > '.$time_int;
|
|
}
|
|
else
|
|
{
|
|
$query[] = $table_prefix.$tmp_bit.' < '.$time_int;
|
|
}
|
|
}
|
|
else if ($bit == 'mgroup')
|
|
{
|
|
if ($this->ipsclass->input['mgroup'] != 'all')
|
|
{
|
|
$query[] = $table_prefix."mgroup=".$this->ipsclass->input['mgroup'];
|
|
}
|
|
}
|
|
else if ($bit == 'posts')
|
|
{
|
|
$query[] = $table_prefix."posts <".$this->ipsclass->input[$bit];
|
|
}
|
|
else if ($bit == 'suspended')
|
|
{
|
|
if ( $this->ipsclass->input[$bit] == 'yes' )
|
|
{
|
|
$query[] = $table_prefix."temp_ban > 0";
|
|
}
|
|
else if ( $this->ipsclass->input[$bit] == 'no' )
|
|
{
|
|
$query[] = $table_prefix."temp_ban < 1 or temp_ban='' or temp_ban is null";
|
|
}
|
|
}
|
|
else if ($bit == 'name')
|
|
{
|
|
$start_bit = '%';
|
|
$end_bit = '%';
|
|
|
|
if ( $this->ipsclass->input['namewhere'] == 'begin' )
|
|
{
|
|
$start_bit = '';
|
|
}
|
|
else if ( $this->ipsclass->input['namewhere'] == 'ends' )
|
|
{
|
|
$end_bit = '';
|
|
}
|
|
else if ( $this->ipsclass->input['namewhere'] == 'is' )
|
|
{
|
|
$end_bit = '';
|
|
$start_bit = '';
|
|
}
|
|
|
|
$query[] = "LOWER(".$table_prefix.$bit.") LIKE '".$start_bit.strtolower($this->ipsclass->input[$bit]).$end_bit."'";
|
|
}
|
|
else if ($bit == 'members_display_name')
|
|
{
|
|
$start_bit = '%';
|
|
$end_bit = '%';
|
|
|
|
if ( $this->ipsclass->input['dnamewhere'] == 'begin' )
|
|
{
|
|
$start_bit = '';
|
|
}
|
|
else if ( $this->ipsclass->input['dnamewhere'] == 'ends' )
|
|
{
|
|
$end_bit = '';
|
|
}
|
|
else if ( $this->ipsclass->input['dnamewhere'] == 'is' )
|
|
{
|
|
$end_bit = '';
|
|
$start_bit = '';
|
|
}
|
|
|
|
$query[] = "LOWER(".$table_prefix.$bit.") LIKE '".$start_bit.strtolower($this->ipsclass->input[$bit]).$end_bit."'";
|
|
}
|
|
else if ($bit == 'memberid')
|
|
{
|
|
$query[] = $table_prefix."id=".intval($this->ipsclass->input[$bit]);
|
|
}
|
|
else if ($bit == 'email')
|
|
{
|
|
$query[] = $table_prefix.$bit." LIKE '%".strtolower($this->ipsclass->input[$bit])."%'";
|
|
}
|
|
else
|
|
{
|
|
$query[] = $table_prefix.$bit." LIKE '%".$this->ipsclass->input[$bit]."%'";
|
|
}
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Custom fields...
|
|
//-----------------------------------------
|
|
|
|
foreach ($this->ipsclass->input as $key => $value)
|
|
{
|
|
if ( preg_match( "/^cm_field_(\d+)$/", $key, $match ) )
|
|
{
|
|
if ( $this->ipsclass->input[ $match[0] ] )
|
|
{
|
|
$query[] = 'p.field_'.$match[1]." LIKE '%".$this->ipsclass->input[ $match[0] ]."%'";
|
|
$page_query .= '&cm_field_'.$match[1].'='.urlencode($this->ipsclass->input[ $match[0] ]);
|
|
}
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// get 'owt?
|
|
//-----------------------------------------
|
|
|
|
if ( count($query) )
|
|
{
|
|
$rq = ' WHERE '.implode( " AND ", $query );
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// On with the show
|
|
//-----------------------------------------
|
|
|
|
$st = intval($this->ipsclass->input['st']);
|
|
|
|
$this->ipsclass->DB->cache_add_query( 'member_search_form_one', array( 'rq' => $rq, 'st' => $st ) );
|
|
$query = $this->ipsclass->DB->cur_query;
|
|
$this->ipsclass->DB->flush_query();
|
|
|
|
$this->ipsclass->DB->cache_add_query( 'member_search_form_two', array( 'rq' => $rq ) );
|
|
$pquery = $this->ipsclass->DB->cur_query;
|
|
$this->ipsclass->DB->flush_query();
|
|
|
|
//-----------------------------------------
|
|
// Get the number of results
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->cache_add_query( 'member_search_form_count', array( 'rq' => $rq ) );
|
|
$this->ipsclass->DB->cache_exec_query();
|
|
|
|
$count = $this->ipsclass->DB->fetch_row();
|
|
|
|
if ($count['count'] < 1)
|
|
{
|
|
$this->ipsclass->main_msg = "Íå íàéäåíî íè îäíîé çàïèñè, ñîîòâåòñòâóþùåé âàøåìó çàïðîñó.";
|
|
$this->search_form();
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Prune you fookers?
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->input['searchtype'] != 'normal' )
|
|
{
|
|
$ids = array();
|
|
|
|
$this->ipsclass->DB->query($pquery);
|
|
|
|
while ( $r = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$ids[ $r['id'] ] = array( $r['id'], $r['name'] );
|
|
}
|
|
|
|
$this->member_prune_confirm($ids, $pquery );
|
|
exit();
|
|
}
|
|
|
|
$page_query .= '&searchtype=normal&namewhere='.$this->ipsclass->input['namewhere'].'&gotcount='.$count['count'];
|
|
|
|
$this->ipsclass->admin->page_title = "Óïðàâëåíèå ïîëüçîâàòåëÿìè";
|
|
|
|
$this->ipsclass->admin->page_detail = "Ðåçóëüòàòû ïîèñêà ñ çàäàííûì çàïðîñîì.";
|
|
|
|
//-----------------------------------------
|
|
|
|
$pages = $this->ipsclass->build_pagelinks( array( 'TOTAL_POSS' => $count['count'],
|
|
'PER_PAGE' => 25,
|
|
'CUR_ST_VAL' => $this->ipsclass->input['st'],
|
|
'L_SINGLE' => $un_all."Îäíà ñòðàíèöà",
|
|
'L_MULTI' => $un_all."Ìíîæåñòâî ñòðàíèö",
|
|
'BASE_URL' => $this->ipsclass->base_url."&{$this->ipsclass->form_code}&showsusp={$this->ipsclass->input['showsusp']}&code={$this->ipsclass->input['code']}".$page_query,
|
|
) );
|
|
|
|
//-----------------------------------------
|
|
// Run the query
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->html .= "
|
|
<div class='tableborder'>
|
|
<div class='maintitle'>Ðåçóëüòàòû ïîèñêà ïîëüçîâàòåëåé: {$count['count']} ïîëüçîâàòåëåé íàéäåíî</div>
|
|
<table cellpadding='4' cellspacing='0' border='0' width='100%'>
|
|
";
|
|
|
|
$per_row = 2;
|
|
$td_width = 100 / $per_row;
|
|
$count = 0;
|
|
$people = "<tr align='center'>\n";
|
|
|
|
$this->ipsclass->DB->query($query);
|
|
|
|
while ( $r = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$count++;
|
|
|
|
$r['id'] = $r['memid'];
|
|
|
|
if ( ! $r['temp_ban'] )
|
|
{
|
|
$suspend_html = "<a href='{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=banmember&mid={$r['id']}{$page_query}' title='Çàáëîêèðîâàòü ïîëüçîâàòåëÿ'>Çàáëîêèðîâàòü ïîëüçîâàòåëÿ...</a>";
|
|
}
|
|
else
|
|
{
|
|
$s_ban = $this->ipsclass->hdl_ban_line( $r['temp_ban'] );
|
|
$suspend_html = "<a href='{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=unsuspend&mid={$r['id']}{$page_query}'>Ðàçáëîêèðîâàòü ïîëüçîâàòåëÿ (".$this->ipsclass->admin->get_date( $s_ban['date_end'], 'LONG') .$sus_link.")...</a>";
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Avatar?
|
|
//-----------------------------------------
|
|
|
|
if ( $r['avatar_location'] and $r['avatar_type'] )
|
|
{
|
|
$avatar = $this->ipsclass->get_avatar( $r['avatar_location'], 1, '25x25', $r['avatar_type'] );
|
|
|
|
if ( ! strstr( $avatar, 'width=' ) )
|
|
{
|
|
$avatar = str_replace( '<img', "<img width='25' height='25'", $avatar );
|
|
}
|
|
}
|
|
else
|
|
{
|
|
$avatar = "<img src='{$this->ipsclass->skin_url}/images/memsearch_head.gif' border='0' />";
|
|
}
|
|
|
|
$joined = $this->ipsclass->get_date( $r['joined'], 'JOINED' );
|
|
|
|
$people .= <<<EOF
|
|
<td width='{$td_width}%' align='left' class='$class'>
|
|
<fieldset>
|
|
<legend><strong>{$r['name']}</strong></legend>
|
|
<div style='border:1px solid #BBB;background-color:#EEE;margin:2px;padding:1px'>
|
|
<table cellpadding='4' cellspacing='0' border='0' width='100%'>
|
|
<tr>
|
|
<td width='1%' align='center'>{$avatar}</td>
|
|
<td width='99%'>
|
|
<a style='font-size:12px;font-weight:bold' title='Ïðîñìîòð ïðîôèëÿ ïîëüçîâàòåëÿ' href='index.{$this->ipsclass->vars['php_ext']}?showuser={$r['id']}' target='blank'>{$r['members_display_name']}</a>
|
|
<span style='font-size:10px' class='graytext'>({$r['ip_address']})</span>
|
|
</td>
|
|
<td width='1%' align='center'><img id='mid-{$r['id']}' src='{$this->ipsclass->skin_url}/images/filebrowser_action.gif' border='0' alt='Options' class='ipd' /></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div style='border:1px solid #BBB;background-color:#FFF;margin:2px;padding:1px'>
|
|
<table cellpadding='2' cellspacing='0' border='0' width='100%'>
|
|
<tr>
|
|
<td width='1%' align='center'><img src='{$this->ipsclass->skin_url}/images/memsearch_email.gif' border='0' /><td>
|
|
<td width='99%'><strong>{$r['email']}</strong></td>
|
|
</tr>
|
|
<tr>
|
|
<td width='1%' align='center'><img src='{$this->ipsclass->skin_url}/images/memsearch_group.gif' border='0' /><td>
|
|
<td width='99%'><strong>{$this->ipsclass->cache['group_cache'][$r['mgroup']]['g_title']}</strong> <span style='font-size:10px' class='graytext'>({$r['posts']} ñîîáùåíèé)</span></td>
|
|
</tr>
|
|
<tr>
|
|
<td width='1%' align='center'><img src='{$this->ipsclass->skin_url}/images/memsearch_posts.gif' border='0' /><td>
|
|
<td width='99%'><strong>Çàðåãèñòðèðîâàëñÿ: {$joined}</strong></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</fieldset>
|
|
<script type="text/javascript">
|
|
menu_build_menu(
|
|
"mid-{$r['id']}",
|
|
EOF;
|
|
if ( ( $this->ipsclass->member['mgroup'] != $this->ipsclass->vars['admin_group'] ) AND ( $r['mgroup'] == $this->ipsclass->vars['admin_group'] ) )
|
|
{
|
|
$people .= "new Array( 'Âû íå ìîæåòå ðåäàêòèðîâàòü àäìèíèñòðàòîðîâ' ) );</script></td>";
|
|
}
|
|
else
|
|
{
|
|
$people .= <<<EOF
|
|
new Array( "<img src='{$this->ipsclass->skin_url}/images/memsearch_changename.gif' style='margin:4px;' border='0' /> " +
|
|
"<a href='{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=doform&mid={$r['id']}{$page_query}'>Èçìåíèòü ïðîôèëü</a>",
|
|
"<img src='{$this->ipsclass->skin_url}/images/memsearch_changename.gif' style='margin:4px;' border='0' /> " +
|
|
"<a href='{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=changename&mid={$r['id']}{$page_query}'>Èçìåíèòü èìÿ ïîëüçîâàòåëÿ</a>",
|
|
"<img src='{$this->ipsclass->skin_url}/images/memsearch_changename.gif' style='margin:4px;' border='0' /> " +
|
|
"<a href='{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=deleteposts&mid={$r['id']}{$page_query}'>Óäàëèòü ÂÑÅ ñîîáùåíèÿ/òåìû ïîëüçîâàòåëÿ...</a>",
|
|
EOF;
|
|
if ( $this->ipsclass->vars['auth_allow_dnames'] )
|
|
{
|
|
$people .= <<<EOF
|
|
"<img src='{$this->ipsclass->skin_url}/images/memsearch_changename.gif' style='margin:4px;' border='0' /> " +
|
|
"<a href='{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=change_display_name&mid={$r['id']}{$page_query}'>Èçìåíèòü îòîáðàæàåìîå èìÿ</a>",
|
|
EOF;
|
|
}
|
|
|
|
$people .= <<<EOF
|
|
"<img src='{$this->ipsclass->skin_url}/images/memsearch_changename.gif' style='margin:4px;' border='0' /> " +
|
|
"<a href='{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=changepassword&id={$r['id']}{$page_query}'>Èçìåíèòü ïàðîëü</a>",
|
|
"<img src='{$this->ipsclass->skin_url}/images/memsearch_suspend.gif' style='margin:4px 7px 4px 7px;' border='0' /> " +
|
|
"$suspend_html",
|
|
"<img src='{$this->ipsclass->skin_url}/images/memsearch_changename.gif' style='margin:4px;' border='0' /> " +
|
|
"<a href='#' onclick='maincheckdelete(\"{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=member_delete&fromdel=1&mid={$r['id']}{$page_query}\"); return false;'>Óäàëèòü</a>"
|
|
) );
|
|
</script>
|
|
</td>
|
|
EOF;
|
|
}
|
|
|
|
if ($count == $per_row )
|
|
{
|
|
$people .= "</tr>\n\n<tr align='center'>";
|
|
$count = 0;
|
|
}
|
|
}
|
|
|
|
if ( $count > 0 and $count != $per_row )
|
|
{
|
|
for ($i = $count ; $i < $per_row ; ++$i)
|
|
{
|
|
$people .= "<td class='tdrow2'> </td>\n";
|
|
}
|
|
|
|
$people .= "</tr>";
|
|
}
|
|
|
|
|
|
$this->ipsclass->html .= $people;
|
|
|
|
$this->ipsclass->html .= "</table>
|
|
<div class='pformstrip' align='right'>{$pages}</div></div>";
|
|
|
|
$this->ipsclass->admin->output();
|
|
|
|
|
|
}
|
|
|
|
//-----------------------------------------
|
|
//
|
|
// DO EDIT FORM
|
|
//
|
|
//-----------------------------------------
|
|
|
|
function member_do_edit_form()
|
|
{
|
|
//-----------------------------------------
|
|
// Load and config the post parser
|
|
//-----------------------------------------
|
|
|
|
require_once( ROOT_PATH."sources/handlers/han_parse_bbcode.php" );
|
|
$this->parser = new parse_bbcode();
|
|
$this->parser->ipsclass = $this->ipsclass;
|
|
$this->parser->allow_update_caches = 1;
|
|
|
|
$this->parser->bypass_badwords = intval($this->ipsclass->member['g_bypass_badwords']);
|
|
|
|
if ($this->ipsclass->input['mid'] == "")
|
|
{
|
|
$this->ipsclass->admin->error("Âû äîëæíû ââåñòè ïðàâèëüíûé ID ïîëüçîâàòåëÿ, âåðíèòåñü è ïîïðîáóéòå åùå ðàç");
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// get member info
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->cache_add_query( 'member_search_do_edit_form', array( 'mid' => $this->ipsclass->input['mid'] ) );
|
|
$this->ipsclass->DB->cache_exec_query();
|
|
|
|
$mem = $this->ipsclass->DB->fetch_row();
|
|
|
|
$mem['id'] = $mem['memid'];
|
|
|
|
//-----------------------------------------
|
|
// check
|
|
//-----------------------------------------
|
|
|
|
if ( ! $mem['id'] )
|
|
{
|
|
$this->ipsclass->admin->error("Íåâîçìîæíî íàéòè ïîëüçîâàòåëÿ ñ òàêèì ID");
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Non root admin attempting to edit root admin?
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->member['mgroup'] != $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
if ( $mem['mgroup'] == $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
$this->ipsclass->admin->error("Âû íå ìîæåòå ðåäàêòèðîâàòü ãëàâíûõ àäìèíèñòðàòîðîâ ");
|
|
}
|
|
}
|
|
|
|
$mem_group = array();
|
|
$show_fixed = FALSE;
|
|
|
|
$units = array( 0 => array( 'h', '÷àñîâ' ), 1 => array( 'd', 'äíåé' ) );
|
|
|
|
//-----------------------------------------
|
|
// Get groups (USE CACHE FOR CRAPS SAKE)
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => 'g_id, g_title, g_access_cp', 'from' => 'groups', 'order' => "g_title" ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
while ( $r = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
//-----------------------------------------
|
|
// Ensure only root admins can promote to root admin grou...
|
|
// oh screw it, I can't be bothered explaining stuff tonight
|
|
//-----------------------------------------
|
|
|
|
if ($this->ipsclass->member['mgroup'] != $this->ipsclass->vars['admin_group'])
|
|
{
|
|
if ( $this->ipsclass->vars['admin_group'] == $r['g_id'] )
|
|
{
|
|
continue;
|
|
}
|
|
else if( $r['g_access_cp'] == 1 && $r['g_id'] != $this->ipsclass->member['mgroup'] )
|
|
{
|
|
continue;
|
|
}
|
|
}
|
|
|
|
$mem_group[] = array( $r['g_id'] , $r['g_title'] );
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// is this a non root editing a root?
|
|
//-----------------------------------------
|
|
|
|
if ($this->ipsclass->member['mgroup'] != $this->ipsclass->vars['admin_group'])
|
|
{
|
|
if ($mem['mgroup'] == $this->ipsclass->vars['admin_group'])
|
|
{
|
|
$show_fixed = TRUE;
|
|
}
|
|
else if ( $mem['g_access_cp'] )
|
|
{
|
|
$show_fixed = TRUE;
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Get langs (USE CACHE DICKHEAD)
|
|
//-----------------------------------------
|
|
|
|
$lang_array = array();
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'languages' ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
while ( $l = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$lang_array[] = array( $l['ldir'], $l['lname'] );
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Get Skins (CACHE)
|
|
//-----------------------------------------
|
|
|
|
require_once( ROOT_PATH.'sources/classes/class_display.php' );
|
|
$print = new display();
|
|
$print->ipsclass =& $this->ipsclass;
|
|
|
|
$tmp = $this->ipsclass->skin['_setid'];
|
|
|
|
$this->ipsclass->skin['_setid'] = $mem['skin'];
|
|
|
|
$skin_list = $print->_build_skin_list();
|
|
|
|
$this->ipsclass->skin['_setid'] = $tmp;
|
|
|
|
//-----------------------------------------
|
|
// Fix up langs
|
|
//-----------------------------------------
|
|
|
|
if ($this->ipsclass->vars['default_language'] == "")
|
|
{
|
|
$this->ipsclass->vars['default_language'] = 'ru';
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Get custom profile information
|
|
//-----------------------------------------
|
|
|
|
$custom_out = "";
|
|
|
|
require_once( ROOT_PATH.'sources/classes/class_custom_fields.php' );
|
|
$fields = new custom_fields( $this->ipsclass->DB );
|
|
|
|
$fields->member_id = $this->ipsclass->member['id'];
|
|
$fields->member_data = $mem;
|
|
$fields->admin = intval($this->ipsclass->member['g_access_cp']);
|
|
$fields->supmod = intval($this->ipsclass->member['g_is_supmod']);
|
|
|
|
$fields->init_data();
|
|
$fields->parse_to_edit();
|
|
|
|
if ( count( $fields->out_fields ) )
|
|
{
|
|
//$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( "Custom Profile Fields", "left", "pformstrip" );
|
|
|
|
foreach( $fields->out_fields as $id => $data )
|
|
{
|
|
if ( $fields->cache_data[ $id ]['pf_type'] == 'drop' )
|
|
{
|
|
$form_element = "<select class='dropdown' name='field_{$id}'>{$data}</select>";
|
|
}
|
|
else if ( $fields->cache_data[ $id ]['pf_type'] == 'area' )
|
|
{
|
|
$form_element = $this->ipsclass->adskin->form_textarea( 'field_'.$id, $data );
|
|
}
|
|
else
|
|
{
|
|
$form_element = $this->ipsclass->adskin->form_input( 'field_'.$id, $data );
|
|
}
|
|
|
|
$custom_out .= $this->ipsclass->adskin->add_td_row( array( "<b>{$fields->field_names[ $id ]}</b><div class='graytext'>{$fields->field_desc[ $id ]}</div>" , $form_element ) );
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Perms masks section
|
|
//-----------------------------------------
|
|
|
|
$perm_masks = array();
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'forum_perms' ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
while ( $r = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$perm_masks[] = array( $r['perm_id'], $r['perm_name'] );
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Start form
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->admin->page_title = "Ðåäàêòèðîâàíèå ïîëüçîâàòåëÿ: ".$mem['members_display_name']." (ID: ".$mem['id'].")";
|
|
|
|
$this->ipsclass->admin->page_detail = "Â ýòîé ñåêöèè âû ìîæåòå èçìåíèòü íàñòðîéêè âûáðàííîãî ïîëüçîâàòåëÿ.";
|
|
|
|
//-----------------------------------------
|
|
// Redirect
|
|
//-----------------------------------------
|
|
|
|
$page_array = array( 1 => array( 'code' , 'doedit' ),
|
|
2 => array( 'act' , 'mem' ),
|
|
3 => array( 'mid' , $mem['id'] ),
|
|
4 => array( 'curemail', $mem['email'] ),
|
|
5 => array( 'curgroup', $mem['mgroup'] ),
|
|
6 => array( 'section', $this->ipsclass->section_code ),
|
|
);
|
|
|
|
foreach( array('name','email','ip_address','aim_name','icq_number','yahoo','signature','posts','suspended', 'registered_first', 'registered_last','last_post_first', 'last_post_last', 'last_activity_first', 'last_activity_last','mgroup','namewhere','gotcount', 'fromdel') as $bit )
|
|
{
|
|
$page_array[] = array( $bit, trim($this->ipsclass->input[ $bit ]) );
|
|
}
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_form( $page_array );
|
|
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "40%" );
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "60%" );
|
|
|
|
//-----------------------------------------
|
|
// SECURITY
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Óñòàíîâêè áåçîïàíîñòè" );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>IP-àäðåñ â ìîìåíò ðåãèñòðàöèè</b>", "<a href='{$this->ipsclass->base_url}§ion={$this->ipsclass->section_code}&act=mtools&code=learnip&ip={$mem['ip_address']}' title='Óçíàòü áîëüøå îá ýòîì IP àäðåñå...'>{$mem['ip_address']}</a>"
|
|
." [ <a href='{$this->ipsclass->base_url}§ion={$this->ipsclass->section_code}&act=mtools&code=showallips&member_id={$mem['id']}'>Ïîêàçàòü âñå IP àäðåñà</a> ]"
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Óäàëèòü ôîòîãðàôèþ ïîëüçîâàòåëÿ</b>" ,
|
|
$this->ipsclass->adskin->form_checkbox("remove_photo", 0)
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Óðîâåíü ïðåäóïðåæäåíèé</b>" ,
|
|
$this->ipsclass->adskin->form_input("warn_level", $mem['warn_level'])
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ëè÷íîå çâàíèå</b>" ,
|
|
$this->ipsclass->adskin->form_input("title", $mem['title'])
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
//-----------------------------------------
|
|
// Group opts
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "40%" );
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "60%" );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Óñòàíîâêè ãðóïïû" );
|
|
|
|
if ($show_fixed != TRUE)
|
|
{
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Îñíîâíàÿ ãðóïïà</b><br /><div style='color:gray'>Ïîëüçîâàòåëü ïðèíàäëåæèò óêàçàííîé ãðóïïå</div>" ,
|
|
$this->ipsclass->adskin->form_dropdown( "mgroup", $mem_group, $mem['mgroup'] )
|
|
) );
|
|
|
|
$arr = explode( ",", $mem['mgroup_others'] );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Âòîðîñòåïåííûå ãðóïïû</b><br /><div style='color:gray'>Âû ìîæåòå âûáðàòü íåñêîëüêî ãðóïï.<div style='color:gray'>Ïîëüçîâàòåëü ïîëó÷èò 'ëó÷øèå' âîçìîæíîñòè âñåõ âûáðàííûõ âòîðîñòåïåííûõ ãðóïï.</div>" ,
|
|
$this->ipsclass->adskin->form_multiselect( "mgroup_others[]", $mem_group, $arr, 5 )
|
|
) );
|
|
}
|
|
else
|
|
{
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Îñíîâíàÿ ãðóïïà</b>" ,
|
|
$this->ipsclass->adskin->form_hidden( array( 1 => array( 'mgroup' , $mem['mgroup'] ) ) )."<b>Ãëàâíûé èëè îáû÷íûé Àäìèíèñòðàòîð</b> (íåâîçìîæíî èçìåíèòü)",
|
|
) );
|
|
}
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
//-----------------------------------------
|
|
// Posting
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "40%" );
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "60%" );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Íàñòðîéêè äîñòóïà è ñîçäàíèÿ ñîîáùåíèé" );
|
|
|
|
//-----------------------------------------
|
|
// Sort out perm id stuff
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->html .=
|
|
"<script type='text/javascript'>
|
|
|
|
var show = '';
|
|
";
|
|
|
|
foreach ($perm_masks as $id => $d)
|
|
{
|
|
$this->ipsclass->html .= " perms_$d[0] = '$d[1]';\n";
|
|
}
|
|
|
|
$this->ipsclass->html .=
|
|
"
|
|
|
|
function saveit(f)
|
|
{
|
|
show = '';
|
|
for (var i = 0 ; i < f.options.length; i++)
|
|
{
|
|
if (f.options[i].selected)
|
|
{
|
|
tid = f.options[i].value;
|
|
show += '\\n' + eval('perms_'+tid);
|
|
}
|
|
}
|
|
|
|
if ( show != '' )
|
|
{
|
|
document.forms[0].override.checked = true;
|
|
}
|
|
else
|
|
{
|
|
document.forms[0].override.checked = false;
|
|
}
|
|
}
|
|
|
|
function show_me()
|
|
{
|
|
if (show == '')
|
|
{
|
|
show = 'Èçìåíåíèé íå îáíàðóæåíî\\nÍàæìèòå íà íåîáõîäèìîå çíà÷åíèå â ôîðìå âûáîðà ìàñîê äîñòóïà';
|
|
}
|
|
|
|
alert('Âûáðàííûå ìàñêè äîñòóïà\\n---------------------------------\\n' + show);
|
|
}
|
|
|
|
</script>";
|
|
|
|
$arr = explode( ",",$mem['org_perm_id'] );
|
|
|
|
$ch_ch = ( $mem['org_perm_id'] ) ? 'checked' : '';
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Èçìåíèòü ìàñêè äîñòóïà ãðóïïû íà...</b><br />Âû ìîæåòå âûáðàòü íåñêîëüêî ìàñîê äîñòóïà.<div style='color:gray'>Âûáðàííûå ìàñêè äîñòóïà çàìåíÿò ìàñêè âûñòàâëåííûå îò âûáðàííûõ ãðóïï (îò îñíîâíîûé è âòîðîñòåïåííûõ).</div>" ,
|
|
"<input type='checkbox' name='override' value='1' $ch_ch> <b>Èçìåíèòü ìàñêè äîñòóïà ãðóïïû íà...</b><br>".
|
|
$this->ipsclass->adskin->form_multiselect( "permid[]",
|
|
$perm_masks,
|
|
$arr, 5, 'onfocus="saveit(this)" onchange="saveit(this)"'
|
|
)."<br><input style='margin-top:5px' id='editbutton' type='button' onclick='show_me();' value='Ïîêàçàòü âûáðàííûå ìàñêè äîñòóïà'>"
|
|
) , "subforum" );
|
|
|
|
//-----------------------------------------
|
|
// Mod posts bit
|
|
//-----------------------------------------
|
|
|
|
$mod_tick = 0;
|
|
$mod_arr = array();
|
|
|
|
if ( $mem['mod_posts'] == 1 )
|
|
{
|
|
$mod_tick = 'checked';
|
|
}
|
|
elseif ($mem['mod_posts'] > 0)
|
|
{
|
|
$mod_arr = $this->ipsclass->hdl_ban_line( $mem['mod_posts'] );
|
|
|
|
$hours = ceil( ( $mod_arr['date_end'] - time() ) / 3600 );
|
|
|
|
if ( $hours > 24 and ( ($hours / 24) == ceil($hours / 24) ) )
|
|
{
|
|
$mod_arr['units'] = 'd';
|
|
$mod_arr['timespan'] = $hours / 24;
|
|
}
|
|
else
|
|
{
|
|
$mod_arr['units'] = 'h';
|
|
$mod_arr['timespan'] = $hours;
|
|
}
|
|
|
|
$mod_extra = "<br /><span style='color:red'>Èñïîëüçóåòñÿ îãðàíè÷åíèå - îñòàâøååñÿ âðåìÿ áûëî ïåðåñ÷èòàíî</span>";
|
|
}
|
|
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Òðåáóåòñÿ ïðîâåðêà ìîäåðàòîðîì âñåõ ñîîáùåíèé ïîëüçîâàòåëÿ?</b><br>Åñëè âûáðàíî 'Äà', âñå ñîîáùåíèÿ ïîëüçîâàòåëÿ áóäóò ïðîâåðÿòüñÿ ìîäåðàòîðàìè.<br />Îñòàâüòå ïîëå ïóñòûì è ñíèìèòå ãàëî÷êó äëÿ îòêëþ÷åíèÿ îãðàíè÷åíèÿ." ,
|
|
"<input type='checkbox' name='mod_indef' value='1' $mod_tick> âñåãäà ïðîâåðÿòü
|
|
<br /><b>èëè íà</b> ".$this->ipsclass->adskin->form_input('mod_timespan', $mod_arr['timespan'], "text", "", '5' ) . ' ' . $this->ipsclass->adskin->form_dropdown('mod_units', $units, $mod_arr['units'] ).$mod_extra
|
|
) );
|
|
|
|
|
|
$post_tick = 0;
|
|
$post_arr = array();
|
|
|
|
if ( $mem['restrict_post'] == 1 )
|
|
{
|
|
$post_tick = 'checked';
|
|
}
|
|
else if( $mem['restrict_post'] > 0 )
|
|
{
|
|
$post_arr = $this->ipsclass->hdl_ban_line( $mem['restrict_post'] );
|
|
|
|
$hours = ceil( ( $post_arr['date_end'] - time() ) / 3600 );
|
|
|
|
if ( $hours > 24 and ( ($hours / 24) == ceil($hours / 24) ) )
|
|
{
|
|
$post_arr['units'] = 'd';
|
|
$post_arr['timespan'] = $hours / 24;
|
|
}
|
|
else
|
|
{
|
|
$post_arr['units'] = 'h';
|
|
$post_arr['timespan'] = $hours;
|
|
}
|
|
|
|
$post_extra = "<br /><span style='color:red'>Èñïîëüçóåòñÿ îãðàíè÷åíèå - îñòàâøååñÿ âðåìÿ áûëî ïåðåñ÷èòàíî</span>";
|
|
}
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Çàïðåòèòü ïîëüçîâàòåëþ {$mem['members_display_name']} îñòàâëÿòü ñîîáùåíèÿ?</b><br>Îñòàâüòå ïîëå ïóñòûì è ñíèìèòå ãàëî÷êó äëÿ îòêëþ÷åíèÿ îãðàíè÷åíèÿ." ,
|
|
"<input type='checkbox' name='post_indef' value='1' $post_tick> íàâñåãäà çàïðåòèòü
|
|
<br /><b>èëè íà</b> ".$this->ipsclass->adskin->form_input('post_timespan', $post_arr['timespan'], "text", "", '5' ) . ' ' . $this->ipsclass->adskin->form_dropdown('post_units', $units, $post_arr['units'] ).$post_extra
|
|
) , "subforum" );
|
|
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
|
|
//-----------------------------------------
|
|
// Settings
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "40%" );
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "60%" );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Íàñòðîéêè ôîðóìà" );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>ßçûê èíòåðôåéñà</b>" ,
|
|
$this->ipsclass->adskin->form_dropdown( "language",
|
|
$lang_array,
|
|
$mem['language'] != "" ? $mem['language'] : $this->ipsclass->vars['default_language']
|
|
)
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ñòèëü</b>" , "<select name='skin' class='dropdown'><option value='0'>--Íåò / Ïî óìîë÷àíèþ--</option>$skin_list</select>"
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ñïðÿòàòü àäðåñ email îò îñòàëüíûõ ïîëüçîâàòåëåé?</b>" ,
|
|
$this->ipsclass->adskin->form_yes_no("hide_email", $mem['hide_email'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Îòïðàâëÿòü ïèñüìî íà email ïðè ïîëó÷åíèè ëè÷íîãî ñîîáùåíèÿ?</b>" ,
|
|
$this->ipsclass->adskin->form_yes_no("email_pm", $mem['email_pm'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>{$this->ipsclass->acp_lang['mem_edit_pm_title']}</b>" ,
|
|
$this->ipsclass->adskin->form_dropdown("members_disable_pm", array( 0 => array( '0' , $this->ipsclass->acp_lang['mem_edit_pm_no'] ),
|
|
1 => array( '1' , $this->ipsclass->acp_lang['mem_edit_pm_yes'] ),
|
|
2 => array( '2' , $this->ipsclass->acp_lang['mem_edit_pm_yes_really'] ),
|
|
), $mem['members_disable_pm'])
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
//-----------------------------------------
|
|
// CONTACT INFO
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "40%" );
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "60%" );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Êîíòàêòíàÿ èíôîðìàöèÿ" );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Email àäðåñ</b>" ,
|
|
$this->ipsclass->adskin->form_input("email", $mem['email'])
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Èäåíòèôèêàòîð AIM</b>" ,
|
|
$this->ipsclass->adskin->form_input("aim_name", $mem['aim_name'])
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Íîìåð ICQ</b>" ,
|
|
$this->ipsclass->adskin->form_input("icq_number", $mem['icq_number'])
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Èäåíòèôèêàòîð Yahoo!</b>" ,
|
|
$this->ipsclass->adskin->form_input("yahoo", $mem['yahoo'])
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Èäåíòèôèêàòîð MSN</b>" ,
|
|
$this->ipsclass->adskin->form_input("msnname", $mem['msnname'])
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Àäðåñ ñàéòà</b>" ,
|
|
$this->ipsclass->adskin->form_input("website", $mem['website'])
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
//-----------------------------------------
|
|
// Other
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "40%" );
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "60%" );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Äðóãàÿ èíôîðìàöèÿ" );
|
|
|
|
$mem['signature'] = $this->parser->pre_edit_parse( $mem['signature'] );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Àâàòàð</b>" ,
|
|
$this->ipsclass->adskin->form_input("avatar", $mem['avatar_location'])
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Òèïû àâàòàðîâ</b>" ,
|
|
$this->ipsclass->adskin->form_dropdown("avatar_type", array( 0 => array( 'local' , 'Ãàëåðåÿ' ),
|
|
1 => array( 'url' , 'Ññûëêà (URL)' ),
|
|
2 => array( 'upload' , 'Çàãðóçèòü àâàòàð' ),
|
|
), $mem['avatar_type'])
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ðàçìåð àâàòàðà</b>" ,
|
|
$this->ipsclass->adskin->form_input("avatar_size", $mem['avatar_size'])
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Êîëè÷åñòâî ñîîáùåíèé</b>" ,
|
|
$this->ipsclass->adskin->form_input("posts", $mem['posts'])
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Îòêóäà</b>" ,
|
|
$this->ipsclass->adskin->form_input("location", $mem['location'])
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Èíòåðåñû</b>" ,
|
|
$this->ipsclass->adskin->form_textarea("interests", str_replace( '<br />', "\n",$mem['interests']))
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ïîäïèñü</b>" ,
|
|
$this->ipsclass->adskin->form_textarea("signature", $mem['signature'])
|
|
) );
|
|
|
|
|
|
|
|
//-----------------------------------------
|
|
// Custom profiles (HATE THIS TOO)
|
|
//-----------------------------------------
|
|
|
|
if ($custom_out != "")
|
|
{
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "40%" );
|
|
$this->ipsclass->adskin->td_header[] = array( " " , "60%" );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Äîïîëíèòåëüíûå ïîëÿ ïðîôèëÿ" );
|
|
|
|
$this->ipsclass->html .= $custom_out;
|
|
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Slip n' ship
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_form("Ðåäàêòèðîâàòü ïîëüçîâàòåëÿ");
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
$this->ipsclass->admin->output();
|
|
|
|
|
|
}
|
|
|
|
|
|
//-----------------------------------------
|
|
//
|
|
// Complete Edit
|
|
//-----------------------------------------
|
|
|
|
function member_do_edit()
|
|
{
|
|
//-----------------------------------------
|
|
// INIT
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->input['mid'] = intval($this->ipsclass->input['mid']);
|
|
|
|
//-----------------------------------------
|
|
// Load parser
|
|
//-----------------------------------------
|
|
|
|
require_once( ROOT_PATH."sources/handlers/han_parse_bbcode.php" );
|
|
$this->parser = new parse_bbcode();
|
|
$this->parser->ipsclass =& $this->ipsclass;
|
|
$this->parser->allow_update_caches = 0;
|
|
|
|
//-----------------------------------------
|
|
// Get member
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'members', 'where' => "id=".intval($this->ipsclass->input['mid']) ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
$memb = $this->ipsclass->DB->fetch_row();
|
|
|
|
//-----------------------------------------
|
|
// Non root admin attempting to edit root admin?
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->member['mgroup'] != $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
if ( $memb['mgroup'] == $this->ipsclass->vars['admin_group'] )
|
|
{
|
|
$this->ipsclass->admin->error("Âû íå ìîæåòå ðåäàêòèðîâàòü ãëàâíûõ àäìèíèñòðàòîðîâ ");
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Convert sig
|
|
//-----------------------------------------
|
|
|
|
$this->parser->parse_smilies = 0;
|
|
$this->parser->parse_bbcode = $this->ipsclass->vars['sig_allow_ibc'];
|
|
|
|
$this->ipsclass->input['signature'] = $this->parser->pre_db_parse( $this->ipsclass->input['signature'] );
|
|
|
|
//-----------------------------------------
|
|
// Perms
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->input['override'] == 1 )
|
|
{
|
|
$permid = ','.implode( ",", $_POST['permid'] ).',';
|
|
}
|
|
else
|
|
{
|
|
$permid = "";
|
|
}
|
|
|
|
$restrict_post = 0;
|
|
$mod_queue = 0;
|
|
|
|
//-----------------------------------------
|
|
// Q
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->input['mod_indef'] == 1 )
|
|
{
|
|
$mod_queue = 1;
|
|
}
|
|
elseif ( $this->ipsclass->input['mod_timespan'] > 0 )
|
|
{
|
|
$mod_queue = $this->ipsclass->hdl_ban_line( array( 'timespan' => intval($this->ipsclass->input['mod_timespan']), 'unit' => $this->ipsclass->input['mod_units'] ) );
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Post ban
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->input['post_indef'] == 1 )
|
|
{
|
|
$restrict_post = 1;
|
|
}
|
|
elseif ( $this->ipsclass->input['post_timespan'] > 0 )
|
|
{
|
|
$restrict_post = $this->ipsclass->hdl_ban_line( array( 'timespan' => intval($this->ipsclass->input['post_timespan']), 'unit' => $this->ipsclass->input['post_units'] ) );
|
|
}
|
|
|
|
$avatar_type = $this->ipsclass->input['avatar_type'];
|
|
|
|
if ( strstr( $this->ipsclass->input['avatar'], 'http://' ) )
|
|
{
|
|
$avatar_type = 'url';
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Throw to the DB
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->do_update( 'members', array (
|
|
'restrict_post' => $restrict_post,
|
|
'mgroup' => $this->ipsclass->input['mgroup'],
|
|
'title' => $this->ipsclass->input['title'],
|
|
'language' => $this->ipsclass->input['language'],
|
|
'skin' => $this->ipsclass->input['skin'],
|
|
'hide_email' => $this->ipsclass->input['hide_email'],
|
|
'email_pm' => $this->ipsclass->input['email_pm'],
|
|
'email' => $this->ipsclass->input['email'],
|
|
'posts' => $this->ipsclass->input['posts'],
|
|
'mod_posts' => $mod_queue,
|
|
'org_perm_id' => $permid,
|
|
'warn_level' => $this->ipsclass->input['warn_level'],
|
|
'members_disable_pm' => intval( $this->ipsclass->input['members_disable_pm'] ),
|
|
'mgroup_others' => $_POST['mgroup_others'] ? ','.implode( ",", $_POST['mgroup_others'] ).',' : '',
|
|
) , 'id='.$this->ipsclass->input['mid'] );
|
|
|
|
$this->ipsclass->DB->do_update( 'member_extra', array (
|
|
'aim_name' => $this->ipsclass->input['aim_name'],
|
|
'icq_number' => $this->ipsclass->input['icq_number'],
|
|
'yahoo' => $this->ipsclass->input['yahoo'],
|
|
'msnname' => $this->ipsclass->input['msnname'],
|
|
'website' => $this->ipsclass->input['website'],
|
|
'avatar_location' => $this->ipsclass->input['avatar'],
|
|
'avatar_size' => $this->ipsclass->input['avatar_size'],
|
|
'avatar_type' => $avatar_type,
|
|
'location' => $this->ipsclass->input['location'],
|
|
'interests' => $this->ipsclass->input['interests'],
|
|
'signature' => $this->ipsclass->input['signature'],
|
|
), 'id='.$this->ipsclass->input['mid'] );
|
|
|
|
//-----------------------------------------
|
|
// Moved from validating group?
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->input['curgroup'] == $this->ipsclass->vars['auth_group'] )
|
|
{
|
|
if ( $this->ipsclass->input['mgroup'] != $this->ipsclass->input['curgroup'] )
|
|
{
|
|
//-----------------------------------------
|
|
// Yes...
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'validating', 'where' => "member_id={$this->ipsclass->input['mid']} AND new_reg=1" ) );
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Diff email?
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->input['email'] != $this->ipsclass->input['curemail'] )
|
|
{
|
|
//-----------------------------------------
|
|
// Is this email addy taken? CONVERGE THIS??
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'members', 'where' => "email='".$this->ipsclass->input['email']."' and id <> {$this->ipsclass->input['mid']}" ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
$email_check = $this->ipsclass->DB->fetch_row();
|
|
|
|
if ($email_check['id'])
|
|
{
|
|
$this->ipsclass->main_msg = "Óæå åñòü ïîëüçîâàòåëü ñ òàêèì àäðåñ email, ââåäèòå äðóãîé àäðåñ email";
|
|
$this->member_do_edit_form();
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Update converge...
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->converge->converge_update_member( $this->ipsclass->input['curemail'], strtolower($this->ipsclass->input['email']) );
|
|
|
|
//-----------------------------------------
|
|
// Update member
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->do_update( 'members', array ( 'email' => strtolower($this->ipsclass->input['email']) ), 'id='.$this->ipsclass->input['mid'] );
|
|
|
|
//-----------------------------------------
|
|
// Update dupemail
|
|
//-----------------------------------------
|
|
|
|
if ( $memb['bio'] == 'dupemail' )
|
|
{
|
|
$this->ipsclass->DB->do_update( 'member_extra', array( 'bio' => '' ), 'id='.$this->ipsclass->input['mid'] );
|
|
}
|
|
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Remove photo?
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->input['remove_photo'] )
|
|
{
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'member_extra', 'where' => "id=".intval($this->ipsclass->input['mid']) ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
if ( $this->ipsclass->DB->get_num_rows() )
|
|
{
|
|
$this->ipsclass->DB->do_update( 'member_extra', array( 'photo_location' => '',
|
|
'photo_type' => '',
|
|
'photo_dimensions' => '',
|
|
), 'id='.$this->ipsclass->input['mid'] );
|
|
}
|
|
else
|
|
{
|
|
$this->ipsclass->DB->do_insert( 'member_extra', array( 'photo_location' => '',
|
|
'photo_type' => '',
|
|
'photo_dimensions' => '',
|
|
'id' => $this->ipsclass->input['mid']
|
|
) );
|
|
}
|
|
|
|
foreach( array( 'swf', 'jpg', 'jpeg', 'gif', 'png' ) as $ext )
|
|
{
|
|
if ( @file_exists( $this->ipsclass->vars['upload_dir']."/photo-".$this->ipsclass->input['mid'].".".$ext ) )
|
|
{
|
|
@unlink( $this->ipsclass->vars['upload_dir']."/photo-".$this->ipsclass->input['mid'].".".$ext );
|
|
}
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Custom profile field stuff
|
|
//-----------------------------------------
|
|
|
|
require_once( ROOT_PATH.'sources/classes/class_custom_fields.php' );
|
|
$fields = new custom_fields( $this->ipsclass->DB );
|
|
|
|
$fields->member_id = $this->ipsclass->member['id'];
|
|
|
|
$fields->cache_data = $this->ipsclass->cache['profilefields'];
|
|
$fields->admin = intval($this->ipsclass->member['g_access_cp']);
|
|
$fields->supmod = intval($this->ipsclass->member['g_is_supmod']);
|
|
|
|
$fields->init_data();
|
|
$fields->parse_to_save();
|
|
|
|
//-----------------------------------------
|
|
// Custom profile field stuff
|
|
//-----------------------------------------
|
|
|
|
if ( count( $fields->out_fields ) )
|
|
{
|
|
//-----------------------------------------
|
|
// Do we already have an entry in
|
|
// the content table?
|
|
//-----------------------------------------
|
|
|
|
$test = $this->ipsclass->DB->simple_exec_query( array( 'select' => 'member_id', 'from' => 'pfields_content', 'where' => 'member_id='.$this->ipsclass->input['mid'] ) );
|
|
|
|
if ( $test['member_id'] )
|
|
{
|
|
//-----------------------------------------
|
|
// We have it, so simply update
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->do_update( 'pfields_content', $fields->out_fields, 'member_id='.$this->ipsclass->input['mid'] );
|
|
}
|
|
else
|
|
{
|
|
$fields->out_fields['member_id'] = $this->ipsclass->input['mid'];
|
|
|
|
$this->ipsclass->DB->do_insert( 'pfields_content', $fields->out_fields );
|
|
}
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// SYNC modules
|
|
//-----------------------------------------
|
|
|
|
if ( USE_MODULES == 1 )
|
|
{
|
|
$this->modules->register_class($this);
|
|
|
|
if ( $memb['mgroup'] != $this->ipsclass->input['mgroup'] )
|
|
{
|
|
$this->modules->on_group_change($this->ipsclass->input['mid'], $this->ipsclass->input['mgroup']);
|
|
}
|
|
|
|
if ( $memb['email'] != strtolower($this->ipsclass->input['email']) )
|
|
{
|
|
$this->modules->on_email_change($this->ipsclass->input['mid'], strtolower($this->ipsclass->input['email']));
|
|
}
|
|
|
|
if ( $memb['signature'] != $this->ipsclass->input['signature'] )
|
|
{
|
|
$this->modules->on_signature_update($memb, $this->ipsclass->input['signature']);
|
|
}
|
|
|
|
$mem_array = array(
|
|
'title' => $this->ipsclass->input['title'],
|
|
'aim_name' => $this->ipsclass->input['aim_name'],
|
|
'icq_number' => $this->ipsclass->input['icq_number'],
|
|
'yahoo' => $this->ipsclass->input['yahoo'],
|
|
'msnname' => $this->ipsclass->input['msnname'],
|
|
'website' => $this->ipsclass->input['website'],
|
|
'location' => $this->ipsclass->input['location'],
|
|
'interests' => $this->ipsclass->input['interests'],
|
|
'id' => $this->ipsclass->input['mid']
|
|
);
|
|
|
|
$this->modules->on_profile_update($mem_array, $custom_fields);
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Redirect
|
|
//-----------------------------------------
|
|
|
|
$page_query = "";
|
|
|
|
foreach( array('name','suspended', 'registered_first', 'registered_last','last_post_first', 'last_post_last', 'last_activity_first', 'last_activity_last','mgroup','namewhere','gotcount', 'fromdel') as $bit )
|
|
{
|
|
$page_query .= '&'.$bit.'='.trim(str_replace('%','',$this->ipsclass->input[ $bit ]));
|
|
}
|
|
|
|
$this->ipsclass->admin->save_log("Îòðåäàêòèðîâàí ïîëüçîâàòåëü '{$memb['members_display_name']}'");
|
|
|
|
$this->ipsclass->admin->done_screen("Ó÷åòíàÿ çàïèñü ïîëüçîâàòåëÿ èçìåíåíà", "Ïîèñê ïîëüçîâàòåëåé", "{$this->ipsclass->form_code}".$page_query, 'redirect' );
|
|
}
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
// Generate page string
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function _generate_page_string()
|
|
{
|
|
//-----------------------------------------
|
|
// INIT
|
|
//-----------------------------------------
|
|
|
|
$page_array = array();
|
|
|
|
//-----------------------------------------
|
|
// Get 'em
|
|
//-----------------------------------------
|
|
|
|
foreach( array('name', 'members_display_name', 'email','ip_address','aim_name','icq_number','yahoo','signature','posts','suspended', 'registered_first', 'registered_last','last_post_first', 'last_post_last', 'last_activity_first', 'last_activity_last','mgroup','namewhere','gotcount', 'fromdel') as $bit )
|
|
{
|
|
$page_array[] = array( $bit, trim($this->ipsclass->input[ $bit ]) );
|
|
}
|
|
|
|
return $page_array;
|
|
}
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
// Generate page string url
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
function _generate_page_string_url()
|
|
{
|
|
//-----------------------------------------
|
|
// INIT
|
|
//-----------------------------------------
|
|
|
|
$page_array = "";
|
|
|
|
//-----------------------------------------
|
|
// Get 'em
|
|
//-----------------------------------------
|
|
|
|
foreach( array('name', 'members_display_name', 'email','ip_address','aim_name','icq_number','yahoo','signature','posts','suspended', 'registered_first', 'registered_last','last_post_first', 'last_post_last', 'last_activity_first', 'last_activity_last','mgroup','namewhere','gotcount', 'fromdel') as $bit )
|
|
{
|
|
$page_array .= '&'.$bit.'='.trim($this->ipsclass->input[ $bit ]);
|
|
}
|
|
|
|
return $page_array;
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Do banline (internal
|
|
//-----------------------------------------
|
|
|
|
function _do_banline($raw)
|
|
{
|
|
$ban = trim($this->ipsclass->txt_stripslashes($raw));
|
|
|
|
$ban = str_replace('|', "|", $ban);
|
|
|
|
$ban = preg_replace( "/\n/", '|', str_replace( "\n\n", "\n", str_replace( "\r", "\n", $ban ) ) );
|
|
|
|
$ban = preg_replace( "/\|{1,}\s{1,}?/s", "|", $ban );
|
|
|
|
$ban = preg_replace( "/^\|/", "", $ban );
|
|
|
|
$ban = preg_replace( "/\|$/", "", $ban );
|
|
|
|
$ban = str_replace( "'", ''', $ban );
|
|
|
|
return $ban;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
?>
|