Admin Framework for IPS Services
| > Module written by Matt Mecham
| > Date started: 17 February 2003
|
| > 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();
}
class ad_plugins {
var $base_url;
function auto_run()
{
global $ibforums, $DB, $std;
//-----------------------------------------
// Kill globals - globals bad, Homer good.
//-----------------------------------------
$tmp_in = array_merge( $_GET, $_POST, $_COOKIE );
foreach ( $tmp_in as $k => $v )
{
unset($$k);
}
//-----------------------------------------
// Make sure we're a root admin, or else!
if ($ibforums->member['mgroup'] != $ibforums->vars['admin_group'])
{
$ibforums->admin->error("Sorry, these functions are for the root admin group only");
}
switch($ibforums->input['code'])
{
case 'ipchat':
$this->chat_splash();
break;
case 'ipchat04':
$this->chat04_splash();
break;
case 'dochat04':
$this->chat_config_save();
break;
case 'chatframe':
$this->chat_frame();
break;
case 'chatsave':
$this->chat_save();
break;
case 'dochat':
$this->chat_config_save();
break;
case 'dorefreshchat':
$this->chat_refresh_online();
break;
//-----------------------------------------
case 'reg':
$this->reg_splash();
break;
case 'regframe':
$this->reg_frame();
break;
case 'regsave':
$this->reg_save();
break;
case 'doreg':
$this->reg_config_save();
break;
//-----------------------------------------
case 'copy':
$this->copy_splash();
break;
case 'copyframe':
$this->copy_frame();
break;
case 'copysave':
$this->copy_save();
break;
case 'docopy':
$this->copy_config_save();
break;
default:
exit();
break;
}
}
//-----------------------------------------
// Copyright removal Splash
//-----------------------------------------
function copy_splash()
{
global $ibforums, $DB, $std;
//-----------------------------------------
// Do we have an order number
//-----------------------------------------
if ( $ibforums->vars['ipb_copy_number'] )
{
$this->copy_config();
}
else
{
$frames = "
Invision Power Board: Registration Set up
";
print $frames;
exit();
}
}
//-----------------------------------------
function copy_frame()
{
global $ibforums, $DB, $std;
$html = "
Invision Power Board Order Box
skin_url}/acp_css.css\" />
";
echo $html;
exit();
}
//-----------------------------------------
function copy_save()
{
global $ibforums, $DB, $std;
require_once( ROOT_PATH.'sources/admin/ad_settings.php' );
$settings = new ad_settings();
$acc_number = trim($ibforums->input['ipb_copy_number']);
if ( stristr( $acc_number, ',pass=' ) )
{
list( $acc_number, $pass ) = explode( ',pass=', $acc_number );
if ( md5(strtolower($pass)) == 'b1c4780a00e7d010b0eca0b695398c02' )
{
$DB->do_update( 'conf_settings', array( 'conf_value' => $acc_number ), 'conf_key="ipb_copy_number"' );
$DB->do_update( 'conf_settings', array( 'conf_value' => 1 ), 'conf_key="ips_cp_purchase"' );
$settings->setting_rebuildcache();
$this->copy_config('new');
exit();
}
else
{
$ibforums->admin->error("The override password was incorrect. Please contact us for assistance or start a new ticket from your IPS customer account.");
}
}
if ( $acc_number == "" )
{
$ibforums->admin->error("Sorry, that is not a valid IPB Copyright key, please hit 'back' in your browser and try again.");
}
$response = trim( @implode ('', @file( "http://customer.invisionpower.com/ipb/copy/?k=".urlencode($acc_number) ) ) );
if ( $response == "" )
{
$ibforums->admin->error("There was no response back from the Invision Power Services registration server, this might be because of the following:
Your PHP version does not allow remote connections
The Invision Power Services registration server is offline
You are running this IPB on a server without an internet connection
Please contact us for assistance or start a new ticket from your IPS customer account.
");
}
else if ( $response == '0' )
{
$ibforums->admin->error("The registration key you entered is not valid, this might be because of the following:
You incorrectly entered the registration key
You mistakenly used your customer center password instead of the registration key
Your registration licence is no longer valid
Please contact us for assistance or start a new ticket from your IPS customer account.
");
}
else if ( $response == '1' )
{
$DB->do_update( 'conf_settings', array( 'conf_value' => $acc_number ), 'conf_key="ipb_copy_number"' );
$DB->do_update( 'conf_settings', array( 'conf_value' => 1 ), 'conf_key="ips_cp_purchase"' );
$settings->setting_rebuildcache();
}
$this->copy_config('new');
}
//-----------------------------------------
function copy_config($type="")
{
global $ibforums, $DB, $std;
$ibforums->admin->page_detail = " ";
$ibforums->admin->page_title = "IPB Copyright Confirmation";
if ( $type == "new" )
{
$ibforums->admin->page_detail .= "
Thank you for registering your copyright removal!";
}
//-----------------------------------------
$ibforums->adskin->td_header[] = array( " " , "100%" );
//-----------------------------------------
$ibforums->html .= $ibforums->adskin->start_table( "Configuration" );
$ibforums->html .= $ibforums->adskin->add_td_row( array( "The copyright should now be removed from the bottom of the IPB pages.
If this is not the case, please contact our after sales staff immediately."
) );
$ibforums->html .= $ibforums->adskin->end_table();
$ibforums->admin->output();
}
//-----------------------------------------
function copy_config_save()
{
global $ibforums, $DB, $std;
$new = array(
'ipb_reg_show' => $ibforums->input['ipb_reg_show'],
'ipb_reg_name' => $ibforums->input['ipb_reg_name'],
);
$ibforums->admin->rebuild_config( $new );
$ibforums->admin->done_screen("IPB Registration Configuration Updated", "IPB Registration Configuration Updated", "act=pin&code=reg" );
}
//-----------------------------------------
// Registration Splash
//-----------------------------------------
function reg_splash()
{
global $ibforums, $DB, $std;
//-----------------------------------------
// Do we have an order number
//-----------------------------------------
if ( $ibforums->vars['ipb_reg_number'] )
{
$this->reg_config();
}
else
{
$frames = "
Invision Power Board: Registration Set up
";
print $frames;
exit();
}
}
//-----------------------------------------
function reg_frame()
{
global $ibforums, $DB, $std;
$html = "
Invision Power Board Order Box
skin_url}/acp_css.css\" />
";
echo $html;
exit();
}
//-----------------------------------------
function reg_save()
{
global $ibforums, $DB, $std;
require_once( ROOT_PATH.'sources/admin/ad_settings.php' );
$settings = new ad_settings();
$acc_number = trim($ibforums->input['ipb_reg_number']);
if ( stristr( $acc_number, ',pass=' ) )
{
list( $acc_number, $pass ) = explode( ',pass=', $acc_number );
if ( md5(strtolower($pass)) == 'b1c4780a00e7d010b0eca0b695398c02' )
{
$DB->do_update( 'conf_settings', array( 'conf_value' => $acc_number ), 'conf_key="ipb_reg_number"' );
$settings->setting_rebuildcache();
$this->reg_config('new');
exit();
}
else
{
$ibforums->admin->error("The override password was incorrect. Please contact us for assistance or start a new ticket from your IPS customer account.");
}
}
if ( $acc_number == "" )
{
$ibforums->admin->error("Sorry, that is not a valid IPB registration key, please hit 'back' in your browser and try again.");
}
$response = trim( implode ('', file( "http://customer.invisionpower.com/ipb/reg/?k=".urlencode($acc_number) ) ) );
if ( $response == "" )
{
$ibforums->admin->error("There was no response back from the Invision Power Services registration server, this might be because of the following:
Your PHP version does not allow remote connections
The Invision Power Services registration server is offline
You are running this IPB on a server without an internet connection
Please contact us for assistance or start a new ticket from your IPS customer account.
");
}
else if ( $response == '0' )
{
$ibforums->admin->error("The registration key you entered is not valid, this might be because of the following:
You incorrectly entered the registration key
You mistakenly used your customer center password instead of the registration key
Your registration licence is no longer valid
Please contact us for assistance or start a new ticket from your IPS customer account.
");
}
else if ( $response == '1' )
{
$DB->do_update( 'conf_settings', array( 'conf_value' => $acc_number ), 'conf_key="ipb_reg_number"' );
$settings->setting_rebuildcache();
}
$this->reg_config('new');
}
//-----------------------------------------
function reg_config($type="")
{
global $ibforums, $DB, $std;
$ibforums->admin->page_detail = "You may edit the configuration below to suit";
$ibforums->admin->page_title = "IPB Registration Configuration";
if ( $type == "new" )
{
$ibforums->admin->page_detail .= "
Thank you for registering!";
}
//-----------------------------------------
// Load libby-do-dah
//-----------------------------------------
require_once( ROOT_PATH.'sources/admin/ad_settings.php' );
$adsettings = new ad_settings();
//-----------------------------------------
// START THE FORM
//-----------------------------------------
$ibforums->html .= $ibforums->adskin->start_form( array( 1 => array( 'code' , 'doreg' ),
2 => array( 'act' , 'pin' ),
) );
//-----------------------------------------
// get group ID
//-----------------------------------------
$conf_group = $DB->simple_exec_query( array( 'select' => '*', 'from' => 'conf_settings_titles', 'where' => "conf_title_keyword='ipbreg'" ) );
$DB->query("SELECT * FROM ibf_conf_settings WHERE conf_group='{$conf_group['conf_title_id']}' ORDER BY conf_position, conf_title");
while ( $r = $DB->fetch_row() )
{
$conf_entry[ $r['conf_id'] ] = $r;
if ( $r['conf_end_group'] )
{
$in_g = 0;
}
if ( $in_g )
{
$adsettings->in_group[] = $r['conf_id'];
}
if ( $r['conf_start_group'] )
{
$in_g = 1;
}
}
$title = "Settings for group: IPB Registration";
//-----------------------------------------
// start table
//-----------------------------------------
$ibforums->html .= "