Admin Forum functions
| > Module written by Matt Mecham
| > Date started: 1st march 2002
|
| > Module Version Number: 1.0.0
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_ACP' ) )
{
print "
Incorrect access
You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
$idx = new ad_forums();
$root_path = "";
class ad_forums {
var $base_url;
var $modules = "";
function ad_forums()
{
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $ibforums;
//--------------------------------------------
// Get the sync module
//--------------------------------------------
if ( USE_MODULES == 1 )
{
require ROOT_PATH."modules/ipb_member_sync.php";
$this->modules = new ipb_member_sync();
}
//---------------------------------------
// Kill globals - globals bad, Homer good.
//---------------------------------------
$tmp_in = array_merge( $_GET, $_POST, $_COOKIE );
foreach ( $tmp_in as $k => $v )
{
unset($$k);
}
$ADMIN->nav[] = array( 'act=mem&code=edit', 'Edit Member Search Form' );
//---------------------------------------
switch($IN['code'])
{
case 'stepone':
$this->do_advanced_search(1);
break;
case 'doform':
$this->do_edit_form();
break;
case 'doedit':
$this->do_edit();
break;
case 'advancedsearch':
$this->do_advanced_search();
break;
//---------------------
case 'unsuspend':
$this->unsuspend();
break;
//---------------------
case 'add':
$this->add_form();
break;
case 'doadd':
$this->do_add();
break;
//---------------------
case 'del':
$this->delete_form();
break;
case 'delete2':
$this->delete_lookup_form();
break;
case 'dodelete':
$this->dodelete();
break;
case 'prune':
$this->prune_confirm();
break;
case 'doprune':
$this->doprune();
break;
//---------------------
case 'title':
$this->titles();
break;
case 'rank_edit':
$this->rank_setup('edit');
break;
case 'rank_add':
$this->rank_setup('add');
break;
case 'do_add_rank':
$this->add_rank();
break;
case 'do_rank_edit':
$this->edit_rank();
break;
case 'rank_delete':
$this->delete_rank();
break;
//---------------------
case 'ban':
$this->ban_control();
break;
case 'doban':
$this->update_ban();
break;
//---------------------
case 'mod':
$this->view_mod();
break;
case 'domod':
$this->domod();
break;
//---------------------
case 'changename':
$this->change_name_start();
break;
case 'dochangename':
$this->change_name_complete();
break;
//---------------------
case 'mail':
$this->bulk_mail_form();
break;
case 'domail':
$this->do_bulk_mail();
break;
case 'banmember':
$this->temp_ban_start();
break;
case 'dobanmember':
$this->temp_ban_complete();
break;
//---------------------
default:
$this->search_form();
break;
}
}
//+---------------------------------------------------------------------------------
//
// MASS EMAIL PEOPLE!
//
//+---------------------------------------------------------------------------------
function do_bulk_mail() {
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS;
// Get the ID's of the groups we're emailing.
$ids = array();
foreach ($IN as $key => $value)
{
if ( preg_match( "/^sg_(\d+)$/", $key, $match ) )
{
if ($IN[$match[0]])
{
$ids[] = $match[1];
}
}
}
if ( count($ids) < 1 )
{
$this->bulk_mail_form(1, 'Errors', 'You must choose at least one group to send the email to');
exit();
}
if ($IN['title'] == "")
{
$this->bulk_mail_form(1, 'Errors', 'You must set a subject for this email');
exit();
}
if ($IN['email_contents'] == "")
{
$this->bulk_mail_form(1, 'Errors', 'You must include some text for the email body');
exit();
}
$group_str = implode( ",", $ids);
// Sort out the rest of the DB stuff
$where = ""; // Where? who knows? who cares?
if ($IN['posts'] > 0)
{
$where .= " AND posts < ".$IN['posts'];
}
if ($IN['days'] > 0)
{
$time = time() - ($IN['days']*60*60*24);
$where .= " AND last_activity < '$time'";
}
if ($IN["honour_user_setting"] == 1)
{
$where .= "AND allow_admin_mails=1";
}
//+---------------------------------------
// Get a grip, er count
//+---------------------------------------
$DB->query("SELECT COUNT(id) as total FROM ibf_members WHERE mgroup IN($group_str)".$where);
$rows = $DB->fetch_row();
if ($rows['total'] < 1)
{
$this->bulk_mail_form(1, 'Errors', 'Please expand your criteria as no members could be found to email using the supplied information');
exit();
}
//+---------------------------------------
// Regex up stuff
//+---------------------------------------
$DB->query("SELECT * FROM ibf_stats");
$stats = $DB->fetch_row();
$contents = $std->txt_stripslashes($HTTP_POST_VARS['email_contents']);
$contents = str_replace( "{board_name}" , str_replace( "'", "'", $INFO['board_name'] ) , $contents );
$contents = str_replace( "{board_url}" , $INFO['board_url']."/index.".$INFO['php_ext'] , $contents );
$contents = str_replace( "{reg_total}" , $stats['MEM_COUNT'] , $contents );
$contents = str_replace( "{total_posts}", $stats['TOTAL_TOPICS'] + $stats['TOTAL_REPLIES'] , $contents );
$contents = str_replace( "{busy_count}" , $stats['MOST_COUNT'] , $contents );
$contents = str_replace( "{busy_time}" , $std->get_date( $stats['MOST_DATE'], 'SHORT' ), $contents );
//+---------------------------------------
// Are we previewing? Why am I asking you?
//+---------------------------------------
if ($IN['preview'] != "")
{
$this->bulk_mail_form(1, 'Preview',
"".$std->txt_stripslashes($IN['title'])."
"
.$contents."
Members to mail: ".$rows['total']
);
exit();
}
//+---------------------------------------
// We're still here? GROOVY, send da mail
//+---------------------------------------
@set_time_limit(1200);
require "./sources/lib/emailer.php";
$this->email = new emailer();
$this->email->bcc = array();
$DB->query("SELECT email FROM ibf_members WHERE mgroup IN($group_str)".$where);
while ( $r = $DB->fetch_row() )
{
if ($r['email'] != "")
{
$this->email->bcc[] = $r['email'];
}
}
$this->email->from = $INFO['email_in'];
$this->email->message = str_replace( "\r\n", "\n", $contents);
$this->email->subject = $std->txt_stripslashes($IN['title']);
if ($IN['email_admin'] == 1)
{
$this->email->to = $INFO['email_in'];
}
else
{
$this->email->to = "";
}
$this->email->send_mail();
$ADMIN->save_log("Mass emailed members ($where)");
$ADMIN->done_screen("Bulk Email sent", "Member Control", "act=mem" );
}
function bulk_mail_form($preview=0, $title='Preview', $content="") {
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS;
$ADMIN->page_title = "Bulk Email Members";
$ADMIN->page_detail = "You may bulk email your members by configuring the form below. Click the 'Quick Help' link for more information";
$ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'domail' ),
2 => array( 'act' , 'mem' ),
) );
if ($HTTP_POST_VARS['email_contents'] == "")
{
$HTTP_POST_VARS['email_contents'] = "\n\n\n-------------------------------------\n{board_name} Statistics:\n"
."-------------------------------------\nRegistered Users: {reg_total}\nTotal Posts: {total_posts}\n"
."Busiest Time: {busy_count} users were online on {busy_time}\n\n"
."-------------------------------------\nHandy Links\n"
."-------------------------------------\nBoard Address: {board_url}\nLog In: {board_url}?act=Login&CODE=00\n"
."Lost Password Recovery: {board_url}?act=Reg&CODE=10\n\n"
."-------------------------------------\nHow to unsubscribe\n"
."-------------------------------------\nVisit your email preferences ({board_url}?act=UserCP&CODE=02) and ensure "
."that the box for 'Send me any updates sent by the board administrator' is unchecked and submit the form";
}
if ($preview == 1)
{
$SKIN->td_header[] = array( " " , "100%" );
$ADMIN->html .= $SKIN->start_table( $title );
$ADMIN->html .= $SKIN->add_td_row( array( nl2br($content) ) );
$ADMIN->html .= $SKIN->end_table();
}
//+-------------------------------
$SKIN->td_header[] = array( " " , "40%" );
$SKIN->td_header[] = array( " " , "60%" );
//+-------------------------------
$ADMIN->html .= $SKIN->start_table( "Bulk Email Members: Content" );
$ADMIN->html .= $SKIN->add_td_row( array( "Honour 'Allow Admin Emails' user setting? It is strongly recommended that you do!" ,
$SKIN->form_yes_no( "honour_user_setting", isset($IN["honour_user_setting"]) ? $IN["honour_user_setting"] : 1 )
) );
$ADMIN->html .= $SKIN->add_td_row( array( "Email Subject" ,
$SKIN->form_input( "title", $std->txt_stripslashes($IN['title']) )
) );
$ADMIN->html .= $SKIN->add_td_row( array( "Email contents ".$SKIN->js_help_link('m_bulkemail') ,
$SKIN->form_textarea( "email_contents", $std->txt_stripslashes($HTTP_POST_VARS['email_contents']), 60, 15 )
) );
$ADMIN->html .= $SKIN->add_td_row( array( "Send this email to the admin incoming address? Enable this if you get a mail error upon submit - required when using SMTP." ,
$SKIN->form_yes_no( "email_admin", isset($IN['email_admin']) ? $IN['email_admin'] : 1 )
) );
$ADMIN->html .= $SKIN->end_table();
//+-------------------------------
$SKIN->td_header[] = array( " " , "40%" );
$SKIN->td_header[] = array( " " , "60%" );
//+-------------------------------
$ADMIN->html .= $SKIN->start_table( "Bulk Email Members: Settings" );
$DB->query("SELECT g_id, g_title FROM ibf_groups WHERE g_id <> ".$INFO['guest_group']." ORDER BY g_title");
while ( $r = $DB->fetch_row() )
{
$ADMIN->html .= $SKIN->add_td_row( array( "Send to group {$r['g_title']}?" ,
$SKIN->form_yes_no( "sg_{$r['g_id']}", isset($IN['sg_'.$r['g_id']]) ? $IN['sg_'.$r['g_id']] : 1 )
) );
}
$ADMIN->html .= $SKIN->add_td_row( array( "Where user has less than [x] posts Leave blank to email regardless of post count" ,
$SKIN->form_input( "post", $IN['post'] )
) );
$ADMIN->html .= $SKIN->add_td_row( array( "Where user has NOT been online for more than [x] days Leave blank to email regardless of last visit" ,
$SKIN->form_input( "days", $IN['days'] )
) );
$ADMIN->html .= $SKIN->add_td_basic( '', 'center' );
$ADMIN->html .= $SKIN->end_form("Proceed");
$ADMIN->html .= $SKIN->end_table();
$ADMIN->output();
}
//+---------------------------------------------------------------------------------
//
// TEMP BANNING
//
//+---------------------------------------------------------------------------------
function temp_ban_start()
{
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
$ADMIN->page_title = "Account Suspension";
$ADMIN->page_detail = "Automated temporary member suspension. Simply choose the duration of the suspension and submit the form below";
$contents = "{membername},\nYour member account at {$INFO['board_name']} has been temporarily suspended.\n\nYour account will not be functional until {date_end} (depending on your timezone). This is an automated process and you do not need to do anything to expediate the unsuspension process.\n\nBoard Address: {$INFO['board_url']}/index.php";
if ($IN['mid'] == "")
{
$ADMIN->error("You must specify a valid member id, please go back and try again");
}
$DB->query("SELECT * FROM ibf_members WHERE id='".$IN['mid']."'");
if ( ! $member = $DB->fetch_row() )
{
$ADMIN->error("We could not match that ID in the members database");
}
$ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'dobanmember' ),
2 => array( 'act' , 'mem' ),
3 => array( 'mid' , $IN['mid'] ),
) );
$ban = $std->hdl_ban_line( $member['temp_ban'] );
$units = array( 0 => array( 'h', 'Hours' ), 1 => array( 'd', 'Days' ) );
//+-------------------------------
$SKIN->td_header[] = array( " " , "40%" );
$SKIN->td_header[] = array( " " , "60%" );
//+-------------------------------
$ADMIN->html .= $SKIN->start_table( "Member Account Suspension", "Note: If this member is already suspended, any new setting will restart the ban" );
$ADMIN->html .= $SKIN->add_td_row( array( "Suspend {$member['name']} for..." ,
$SKIN->form_input('timespan', $ban['timespan'], "text", "", '5' ) . ' ' . $SKIN->form_dropdown('units', $units, $ban['units'] ),
) );
$ADMIN->html .= $SKIN->add_td_row( array( "Email notification to this member? (If so, you may edit the email below)" ,
$SKIN->form_yes_no( "send_email", 0 )
) );
$ADMIN->html .= $SKIN->add_td_row( array( "Email contents (Tags: {membername} = member's name, {date_end} = ban end)" ,
$SKIN->form_textarea( "email_contents", $contents )
), "", 'top' );
$ADMIN->html .= $SKIN->end_form("Suspend This Account");
$ADMIN->html .= $SKIN->end_table();
$ADMIN->output();
}
//---------------------------------------------------------------
function unsuspend()
{
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
if ($IN['mid'] == "")
{
$ADMIN->error("You must specify a valid member id, please go back and try again");
}
if ($IN['mid'] == 'all')
{
$DB->query("UPDATE ibf_members SET temp_ban=''");
$ADMIN->save_log("Unsuspended all member accounts");
$ADMIN->done_screen("All Accounts Unsuspended", "Member Control", "act=mem" );
}
else
{
$mid = intval($IN['mid']);
$DB->query("UPDATE ibf_members SET temp_ban='' WHERE id=$mid");
$DB->query("SELECT name FROM ibf_members WHERE id=$mid");
$member = $DB->fetch_row();
$ADMIN->save_log("Unsuspended {$member['name']}");
$ADMIN->done_screen("{$member['name']} Unsuspended", "Member Control", "act=mem" );
}
}
//---------------------------------------------------------------
function temp_ban_complete()
{
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS;
$ADMIN->page_title = "Account Suspension";
$ADMIN->page_detail = "Automated temporary member suspension. Confirmation and information";
$IN['mid'] = intval($IN['mid']);
if ($IN['mid'] == "")
{
$ADMIN->error("You must specify a valid member id, please go back and try again");
}
$DB->query("SELECT * FROM ibf_members WHERE id='".$IN['mid']."'");
if ( ! $member = $DB->fetch_row() )
{
$ADMIN->error("We could not match that ID in the members database");
}
//+-------------------------------
// Work out end date
//+-------------------------------
$IN['timespan'] = intval($IN['timespan']);
if ( $IN['timespan'] == "" )
{
$new_ban = "";
}
else
{
$new_ban = $std->hdl_ban_line( array( 'timespan' => intval($IN['timespan']), 'unit' => $IN['units'] ) );
}
$show_ban = $std->hdl_ban_line( $new_ban );
//+-------------------------------
// Update and show confirmation
//+-------------------------------
$DB->query("UPDATE ibf_members SET temp_ban='$new_ban' WHERE id={$IN['mid']}");
// I say, did we choose to email 'dis member?
if ($IN['send_email'] == 1)
{
// By golly, we did!
require "./sources/lib/emailer.php";
$this->email = new emailer();
$msg = trim($std->txt_stripslashes($HTTP_POST_VARS['email_contents']));
$msg = str_replace( "{membername}", $member['name'] , $msg );
$msg = str_replace( "{date_end}" , $ADMIN->get_date( $show_ban['date_end'], 'LONG') , $msg );
$this->email->message = $this->email->clean_message($msg);
$this->email->subject = "Account Suspension Notification";
$this->email->to = $member['email'];
$this->email->send_mail();
$skin_extra = $SKIN->add_td_row( array( "Email Sent",
"Account Suspension Notification
".str_replace( "\n", " ", $msg)
), "", 'top' );
}
//+-------------------------------
$SKIN->td_header[] = array( " " , "40%" );
$SKIN->td_header[] = array( " " , "60%" );
//+-------------------------------
$ADMIN->html .= $SKIN->start_table( "Member Suspension: Result" );
$ADMIN->html .= $SKIN->add_td_row( array( "{$member['name']} is suspended until...",
$ADMIN->get_date( $show_ban['date_end'], 'LONG'),
) );
$ADMIN->html .= $skin_extra;
$ADMIN->html .= $SKIN->end_table();
$ADMIN->nav[] = array( "act=mem&code=stepone&USER_NAME={$member['name']}", "Admin Options for {$member['name']}" );
$ADMIN->save_log("Suspended {$member['name']} until ".$ADMIN->get_date( $show_ban['date_end'], 'SHORT'));
$ADMIN->output();
}
//+---------------------------------------------------------------------------------
//
// CHANGE MEMBER NAME
//
//+---------------------------------------------------------------------------------
function change_name_complete()
{
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS;
$IN['new_name'] = str_replace( '|', '|', $IN['new_name'] );
if ($IN['mid'] == "")
{
$ADMIN->error("You must specify a valid member id, please go back and try again");
}
if ($IN['new_name'] == "")
{
$this->change_name_start("You must enter a new name for this member");
exit();
}
$DB->query("SELECT name, email FROM ibf_members WHERE id='".$IN['mid']."'");
if ( ! $member = $DB->fetch_row() )
{
$ADMIN->error("We could not match that ID in the members database");
}
$mid = $IN['mid']; // Save me poor ol' carpels
if ($IN['new_name'] == $member['name'])
{
$this->change_name_start("The new name is the same as the old name, that is illogical captain");
exit();
}
// Check to ensure that his member name hasn't already been taken.
$new_name = trim($IN['new_name']);
$DB->query("SELECT id FROM ibf_members WHERE LOWER(name)='".strtolower($new_name)."'");
if ( $DB->get_num_rows() )
{
$this->change_name_start("The name '$new_name' already exists, please choose another");
exit();
}
// If one gets here, one can assume that the new name is correct for one, er...one.
// So, lets do the converteroo
$DB->query("UPDATE ibf_members SET name='$new_name' WHERE id='$mid'");
$DB->query("UPDATE ibf_contacts SET contact_name='$new_name' WHERE contact_id='$mid'");
$DB->query("UPDATE ibf_forums SET last_poster_name='$new_name' WHERE last_poster_id='$mid'");
$DB->query("UPDATE ibf_moderator_logs SET member_name='$new_name' WHERE member_id='$mid'");
$DB->query("UPDATE ibf_moderators SET member_name='$new_name' WHERE member_id='$mid'");
$DB->query("UPDATE ibf_posts SET author_name='$new_name' WHERE author_id='$mid'");
$DB->query("UPDATE ibf_sessions SET member_name='$new_name' WHERE member_id='$mid'");
$DB->query("UPDATE ibf_topics SET starter_name='$new_name' WHERE starter_id='$mid'");
$DB->query("UPDATE ibf_topics SET last_poster_name='$new_name' WHERE last_poster_id='$mid'");
// I say, did we choose to email 'dis member?
if ($IN['send_email'] == 1)
{
// By golly, we did!
require "./sources/lib/emailer.php";
$this->email = new emailer();
$msg = trim($HTTP_POST_VARS['email_contents']);
$msg = str_replace( "{old_name}", $member['name'], $msg );
$msg = str_replace( "{new_name}", $new_name , $msg );
$this->email->message = $this->email->clean_message($msg);
$this->email->subject = "Member Name Change Notification";
$this->email->to = $member['email'];
$this->email->send_mail();
}
$DB->query("SELECT id, name FROM ibf_members WHERE mgroup <> '".$INFO['auth_group']."' ORDER BY id DESC LIMIT 0,1");
$r = $DB->fetch_row();
$stats['LAST_MEM_NAME'] = $r['name'];
$stats['LAST_MEM_ID'] = $r['id'];
$db_string = $DB->compile_db_update_string( $stats );
$DB->query("UPDATE ibf_stats SET $db_string");
$ADMIN->save_log("Changed Member Name '{$member['name']}' to '$new_name'");
if ( USE_MODULES == 1 )
{
$this->modules->register_class(&$this);
$this->modules->on_name_change($mid, $new_name );
}
$ADMIN->done_screen("Member Name Changed", "Member Control", "act=mem" );
}
//===========================================================================
function change_name_start($message="") {
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
$ADMIN->page_title = "Change Member Name";
$ADMIN->page_detail = "You may enter a new name for this member.";
if ($IN['mid'] == "")
{
$ADMIN->error("You must specify a valid member id, please go back and try again");
}
$DB->query("SELECT name FROM ibf_members WHERE id='".$IN['mid']."'");
if ( ! $member = $DB->fetch_row() )
{
$ADMIN->error("We could not match that ID in the members database");
}
$contents = "{old_name},\nAn administrator has changed your member name on {$INFO['board_name']}.\n\nYour new name is: {new_name}\n\nPlease remember this as you will need to use this new name when you log in next time.\nBoard Address: {$INFO['board_url']}/index.php";
$ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'dochangename' ),
2 => array( 'act' , 'mem' ),
3 => array( 'mid' , $IN['mid'] ),
) );
//+-------------------------------
$SKIN->td_header[] = array( " " , "40%" );
$SKIN->td_header[] = array( " " , "60%" );
//+-------------------------------
$ADMIN->html .= $SKIN->start_table( "Change Member Name" );
if ($message != "")
{
$ADMIN->html .= $SKIN->add_td_row( array( "Error Message:" ,
"$message",
) );
}
$ADMIN->html .= $SKIN->add_td_row( array( "Current Member's Name" ,
$member['name'],
) );
$ADMIN->html .= $SKIN->add_td_row( array( "New Members Name" ,
$SKIN->form_input( "new_name", $IN['new_name'] )
) );
$ADMIN->html .= $SKIN->add_td_row( array( "Email notification to this member? (If so, you may edit the email below)" ,
$SKIN->form_yes_no( "send_email", 1 )
) );
$ADMIN->html .= $SKIN->add_td_row( array( "Email contents (Tags: {old_name} = current name, {new_name} = new name)" ,
$SKIN->form_textarea( "email_contents", $contents )
) );
$ADMIN->html .= $SKIN->end_form("Change this members name");
$ADMIN->html .= $SKIN->end_table();
$ADMIN->output();
}
//+---------------------------------------------------------------------------------
//+---------------------------------------------------------------------------------
//
// Moderation control...
//
//+---------------------------------------------------------------------------------
function domod() {
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
$ids = array();
foreach ($IN as $k => $v)
{
if ( preg_match( "/^mid_(\d+)$/", $k, $match ) )
{
if ($IN[ $match[0] ])
{
$ids[] = $match[1];
}
}
}
//-------------------
if ( count($ids) < 1 )
{
$ADMIN->error("You did not select any members to approve or delete");
}
//-------------------
if ($IN['type'] == 'approve')
{
//-------------------------------------------
require ROOT_PATH."sources/lib/emailer.php";
$email = new emailer();
$email->get_template("complete_reg");
$email->build_message( "" );
$email->subject = "Account validated at ".$INFO['board_name'];
//-------------------------------------------
$main = $DB->query("SELECT m.id, m.email, m.mgroup, v.* FROM ibf_validating v
LEFT JOIN ibf_members m ON (v.member_id=m.id)
WHERE m.id IN(".implode( ",",$ids ).")");
while( $row = $DB->fetch_row( $main ) )
{
if ($row['mgroup'] != $INFO['auth_group'])
{
continue;
}
if ($row['real_group'] == "")
{
$row['real_group'] = $INFO['member_group'];
}
$update = $DB->query("UPDATE ibf_members SET mgroup=".$row['real_group']." WHERE id=".$row['id']);
$email->to = $row['email'];
$email->send_mail();
}
$DB->query("DELETE FROM ibf_validating WHERE member_id IN(".implode( ",",$ids ).")");
$DB->query("SELECT id, name FROM ibf_members WHERE mgroup <> ".$INFO['auth_group']." ORDER BY id DESC LIMIT 0,1");
$r = $DB->fetch_row();
$DB->query("UPDATE ibf_stats SET MEM_COUNT=MEM_COUNT+".count($ids).", LAST_MEM_NAME='{$r['name']}', LAST_MEM_ID='{$r['id']}'");
$ADMIN->save_log("Approved Queued Registrations");
$ADMIN->done_screen( count($ids)." Members Approved", "Manage Registrations", "act=mem&code=mod" );
}
else
{
$DB->query("DELETE FROM ibf_members WHERE id IN(".implode( ",",$ids ).")");
$DB->query("DELETE FROM ibf_member_extra WHERE id IN(".implode( ",",$ids ).")");
// Delete member messages...
$DB->query("DELETE from ibf_messages WHERE member_id IN(".implode( ",",$ids ).")");
$DB->query("DELETE from ibf_contacts WHERE member_id IN(".implode( ",",$ids ).") or contact_id IN(".implode( ",",$ids ).")");
$DB->query("DELETE FROM ibf_validating WHERE member_id IN(".implode( ",",$ids ).")");
$DB->query("DELETE from ibf_pfields_content WHERE member_id IN(".implode( ",",$ids ).")");
$DB->query("DELETE from ibf_warn_logs WHERE wlog_mid IN(".implode( ",",$ids ).")");
// Convert their posts and topics into guest postings..
$DB->query("UPDATE ibf_posts SET author_id='0' WHERE author_id IN(".implode( ",",$ids ).")");
$DB->query("UPDATE ibf_topics SET starter_id='0' WHERE starter_id IN(".implode( ",",$ids ).")");
if ( USE_MODULES == 1 )
{
$this->modules->register_class(&$this);
$this->modules->on_delete($ids);
}
$ADMIN->save_log("Denied Queued Registrations");
$ADMIN->done_screen( count($ids)." Members Removed", "Manage Registrations", "act=mem&code=mod" );
}
}
//---------------------------------------------
function view_mod() {
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
$ADMIN->page_title = "Manage User Registration/Email Change Queues";
$ADMIN->page_detail = "This section allows you to allow or deny registrations where you have requested that an administrator previews new accounts before allowing full membership. It will also allow you to complete or deny new email address changes.