Version 2.2.0 RC-1

This commit is contained in:
Neo committed 2025-12-19 00:22:37 -08:00
1 parent f73f8bff6d
commit 22f1b963ee
1034 files changed
+178610 -70897

No files matched your search

+144 -39
View File
@@ -2,27 +2,17 @@
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.1.7
| Invision Power Board
| =============================================
| by Matthew Mecham
| (c) 2001 - 2005 Invision Power Services, Inc.
| (c) 2001 - 2006 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: 2005-12-01 16:45:12 +0000 (Thu, 01 Dec 2005) $
| > $Revision: 88 $
| > $Date: 2006-10-05 23:01:22 +0100 (Thu, 05 Oct 2006) $
| > $Revision: 610 $
| > $Author: bfarber $
+---------------------------------------------------------------------------
|
@@ -88,7 +78,7 @@ class han_paysubscriptions
}
}
if ( $this->ipsclass->input['currency'] )
if ( isset($this->ipsclass->input['currency']) AND $this->ipsclass->input['currency'] )
{
if ( is_array($this->all_currency[ $this->ipsclass->input['currency'] ]) )
{
@@ -206,7 +196,8 @@ class han_paysubscriptions
// We're upgrading!! Yay! - Get cur subs
//--------------------------------------------
$this->ipsclass->DB->query("SELECT * FROM ibf_subscription_trans WHERE subtrans_member_id={$this->ipsclass->member['id']} AND subtrans_sub_id={$sub_current['sub_id']} AND subtrans_state='paid'");
$this->ipsclass->DB->build_query( array( 'select' => '*', 'from' => 'subscription_trans', 'where' => "subtrans_member_id={$this->ipsclass->member['id']} AND subtrans_sub_id={$sub_current['sub_id']} AND subtrans_state='paid'" ) );
$this->ipsclass->DB->exec_query();
if ( ! $cur_trans = $this->ipsclass->DB->fetch_row() )
{
@@ -222,12 +213,17 @@ class han_paysubscriptions
$end_date = ( $sub_upgrade['sub_unit'] == 'x' or $sub_current['sub_unit'] == 'x' )
? $this->ipsclass->lang['no_expire']
: $this->ipsclass->get_date( $cur_trans['subtrans_end_date'], 'JOINED' );
$new_date = ( $sub_upgrade['sub_unit'] == 'x' or $sub_current['sub_unit'] == 'x' )
? $this->ipsclass->lang['no_expire']
: $this->ipsclass->get_date( ( $cur_trans['subtrans_end_date'] - ($sub_current['sub_length'] * $this->day_to_seconds[$sub_current['sub_unit']]) + ($sub_upgrade['sub_length'] * $this->day_to_seconds[$sub_upgrade['sub_unit']])) , 'JOINED' );
$this->ipsclass->lang['sc_upgrade_string'] = sprintf( $this->ipsclass->lang['sc_upgrade_string'],
$sub_current['sub_title'],
$sub_upgrade['sub_title'],
$end_date,
sprintf( "%.2f", $balance * $this->cho_currency['subcurrency_exchange'] ).' '.$this->cho_currency['subcurrency_code']
sprintf( "%.2f", $balance * $this->cho_currency['subcurrency_exchange'] ).' '.$this->cho_currency['subcurrency_code'],
$new_date
);
//---------------------------------------
@@ -236,7 +232,7 @@ class han_paysubscriptions
if ( $sub_current['sub_unit'] != 'x' )
{
$time_left_to_run = $cur_trans['subtrans_end_date'] - time();
$time_left_to_run = ($cur_trans['subtrans_end_date'] + $sub_upgrade['sub_length']) - time();
$time_left_to_run = ceil($time_left_to_run / 86400);
$time_left_units = 'D';
@@ -376,7 +372,6 @@ class han_paysubscriptions
'ttr_int' => '',
'ttr_unit' => '',
'ttr_balance' => '',
'ttr_package_id' => $cur_trans['subtrans_sub_id'],
'vendor_id' => $pay_method['submethod_sid'],
'product_id' => $extra['subextra_product_id'],
'extra_1' => $pay_method['submethod_custom_1'],
@@ -450,6 +445,16 @@ class han_paysubscriptions
if ( $pay_method['submethod_is_auto'] != 1 )
{
$this->do_log("{$this->class_gateway->i_am}: Tried to return validate but failed: ACP settings have auto validate switched off");
if ( $this->class_gateway->no_postback )
{
$this->ipsclass->boink_it( GW_URL_PAYDONE );
}
else
{
$this->class_gateway->core_print_status_message();
}
exit();
}
@@ -460,6 +465,16 @@ class han_paysubscriptions
if ( empty( $_REQUEST ) )
{
$this->do_log("{$this->class_gateway->i_am}: Tried to return validate but failed: REQUEST DATA EMPTY");
if ( $this->class_gateway->no_postback )
{
$this->ipsclass->boink_it( GW_URL_PAYDONE );
}
else
{
$this->class_gateway->core_print_status_message();
}
exit();
}
@@ -482,8 +497,18 @@ class han_paysubscriptions
if ( ! $this->results['verified'] )
{
if ( ! GW_TEST_MODE_ON )
{
$this->do_log("{$this->class_gateway->i_am}: UPGRADE - NOT VERIFIED" . $this->class_gateway->error );
{
$this->do_log("{$this->class_gateway->i_am}: UPGRADE - NOT VERIFIED " . $this->class_gateway->error );
if ( $this->class_gateway->no_postback )
{
$this->ipsclass->boink_it( GW_URL_PAYDONE );
}
else
{
$this->class_gateway->core_print_status_message();
}
exit();
}
}
@@ -511,6 +536,16 @@ class han_paysubscriptions
if ( ! $this->member['id'] )
{
$this->do_log("{$this->class_gateway->i_am}: Could not locate a member id to upgrade");
if ( $this->class_gateway->no_postback )
{
$this->ipsclass->boink_it( GW_URL_PAYDONE );
}
else
{
$this->class_gateway->core_print_status_message();
}
exit();
}
@@ -523,9 +558,17 @@ class han_paysubscriptions
if ( ! $this->new_sub['sub_id'] )
{
$this->do_log("{$this->class_gateway->i_am}: Tried to return validate but failed: No start sub package found");
exit();
}
if ( $this->class_gateway->no_postback )
{
$this->ipsclass->boink_it( GW_URL_PAYDONE );
}
else
{
$this->class_gateway->core_print_status_message();
}
}
//--------------------------------------
// Check for txn_id - if already used, this
// is a dupe from a repeated form submit
@@ -533,7 +576,7 @@ class han_paysubscriptions
$this->trans = $this->ipsclass->DB->build_and_exec_query( array( 'select' => 'subtrans_id',
'from' => 'subscription_trans',
'where' => "subtrans_trxid='".addslashes($this->results['transaction_id'])."'" ) );
'where' => "subtrans_subscrid='".addslashes($this->results['subscription_id'])."'" ) );
if ( $this->trans['subtrans_id'] )
{
@@ -541,7 +584,7 @@ class han_paysubscriptions
// Is this a reversal?
//--------------------------------------
if ( $this->results['payment_status'] == 'REFUND' )
if ( $this->results['payment_status'] == 'REFUND' OR $this->results['payment_status'] == 'CANCEL' )
{
//-----------------------------
// Update trans for the refund
@@ -556,15 +599,34 @@ class han_paysubscriptions
//-----------------------------
$this->do_log("{$this->class_gateway->i_am}: Reversal / Subscription cancellation completed");
if ( $this->class_gateway->no_postback )
{
$this->ipsclass->boink_it( GW_URL_PAYDONE );
}
else
{
$this->class_gateway->core_print_status_message();
}
exit();
}
else
{
$this->do_log("{$this->class_gateway->i_am}: Duplicate transaction ID - failing and exiting transaction");
if ( $this->class_gateway->no_postback )
{
$this->ipsclass->boink_it( GW_URL_PAYDONE );
}
else
{
$this->class_gateway->core_print_status_message();
}
exit();
}
}
//--------------------------------------
// UPGRADE
//--------------------------------------
@@ -633,7 +695,15 @@ class han_paysubscriptions
}
}
$this->class_gateway->core_print_status_message();
if ( $this->class_gateway->no_postback )
{
$this->ipsclass->boink_it( GW_URL_PAYDONE );
}
else
{
$this->class_gateway->core_print_status_message();
}
exit();
}
@@ -662,6 +732,11 @@ class han_paysubscriptions
exit();
}
$this->existing_sub = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',
'from' => 'subscriptions',
'where' => 'sub_id='.intval($this->cur_details['subtrans_sub_id'])
) );
//--------------------------------------
// Update subscription
//--------------------------------------
@@ -681,6 +756,16 @@ class han_paysubscriptions
$this->update['subtrans_end_date'] = 9999999999;
}
//--------------------------------------
// Else increase their sub
//--------------------------------------
else
{
$this->update['subtrans_end_date'] = $this->cur_details['subtrans_end_date'] + ( $this->new_sub['sub_length'] * $this->day_to_seconds[ $this->new_sub['sub_unit'] ] );
$this->update['subtrans_end_date'] -= ($this->existing_sub['sub_length'] * $this->day_to_seconds[ $this->existing_sub['sub_unit'] ] );
}
//--------------------------------------
// Update DB
//--------------------------------------
@@ -733,6 +818,11 @@ class han_paysubscriptions
exit();
}
$this->existing_sub = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',
'from' => 'subscriptions',
'where' => 'sub_id='.intval($this->cur_details['subtrans_sub_id'])
) );
//--------------------------------------
// Update subscription
//--------------------------------------
@@ -752,6 +842,16 @@ class han_paysubscriptions
$this->update['subtrans_end_date'] = 9999999999;
}
//--------------------------------------
// Else increase their sub
//--------------------------------------
else
{
$this->update['subtrans_end_date'] = $this->cur_details['subtrans_end_date'] + ( $this->new_sub['sub_length'] * $this->day_to_seconds[ $this->new_sub['sub_unit'] ] );
$this->update['subtrans_end_date'] -= ($this->existing_sub['sub_length'] * $this->day_to_seconds[ $this->existing_sub['sub_unit'] ] );
}
//--------------------------------------
// Update DB
//--------------------------------------
@@ -808,6 +908,8 @@ class han_paysubscriptions
// Update subscription
//--------------------------------------
$old_group = ($this->new_sub[ 'sub_new_group' ] > 0) ? $this->member['mgroup'] : 0;
$this->update['subtrans_paid'] = $results['amount_paid'] * $this->def_currency['subcurrency_exchange'];
$this->update['subtrans_trxid'] = $this->results['transaction_id'];
$this->update['subtrans_sub_id'] = $this->new_sub['sub_id'];
@@ -815,7 +917,7 @@ class han_paysubscriptions
$this->update['subtrans_state'] = strtolower( $results['state'] );
$this->update['subtrans_cumulative'] = $this->update['subtrans_paid'];
$this->update['subtrans_member_id'] = $this->member['id'];
$this->update['subtrans_old_group'] = $this->member['mgroup'];
$this->update['subtrans_old_group'] = $old_group;
$this->update['subtrans_start_date'] = time();
//--------------------------------------
@@ -1041,16 +1143,15 @@ class han_paysubscriptions
}
}
$query = "UPDATE ibf_members SET sub_end=$end_date";
$update_fields = array();
$update_fields['sub_end'] = $end_date;
if ( $new_sub['sub_new_group'] )
{
$query .= ", mgroup={$new_sub['sub_new_group']}";
$update_fields['mgroup'] = $new_sub['sub_new_group'];
}
$query .= " WHERE id={$member['id']}";
$this->ipsclass->DB->query($query);
$this->ipsclass->DB->do_update( "members", $update_fields, "id=".$member['id'] );
//--------------------------------------
// Running Custom code?
@@ -1112,9 +1213,13 @@ class han_paysubscriptions
{
define( 'IPB_CALLED', 1 );
$query = "UPDATE ibf_members SET sub_end=0";
$update_fields = array();
$update_fields['sub_end'] = 0;
if ( $cur_trx_id )
// We want to move them back to the member group if the payment
// failed, but not if they cancelled a subscription - bug 2008
if ( $cur_trx_id AND !$this->results['payment_status'] == 'CANCEL' )
{
$this->ipsclass->DB->cache_add_query( 'mod_failed_member', array( 'cur_trx_id' => $cur_trx_id ), 'sql_subsm_queries' );
$this->ipsclass->DB->cache_exec_query();
@@ -1123,12 +1228,10 @@ class han_paysubscriptions
$mgroup = $r['g_id'] ? $r['g_id'] : $this->ipsclass->vars['member_group'];
$query .= ", mgroup={$mgroup}";
$update_fields['mgroup'] = $mgroup;
}
$query .= " WHERE id={$member['id']}";
$this->ipsclass->DB->query($query);
$this->ipsclass->DB->do_update( "members", $update_fields, "id=".$member['id'] );
//--------------------------------------
// Running Custom code?
@@ -1202,6 +1305,8 @@ class han_paysubscriptions
}
}
$extra = htmlentities( strip_tags( str_replace( '\\', '', $extra ) ) );
//--------------------------------------
// Add to DB
//--------------------------------------