Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -12,7 +12,7 @@
|
||||
namespace IPS\nexus\modules\admin\payments;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -23,6 +23,11 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
*/
|
||||
class _billingagreements extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
/**
|
||||
* @brief Has been CSRF-protected
|
||||
*/
|
||||
public static $csrfProtected = TRUE;
|
||||
|
||||
/**
|
||||
* Execute
|
||||
*
|
||||
@@ -79,7 +84,7 @@ class _billingagreements extends \IPS\Dispatcher\Controller
|
||||
$transactions->limit = 50;
|
||||
foreach ( $transactions->include as $k => $v )
|
||||
{
|
||||
if ( in_array( $v, array( 't_method', 't_member' ) ) )
|
||||
if ( \in_array( $v, array( 't_method', 't_member' ) ) )
|
||||
{
|
||||
unset( $transactions->include[ $k ] );
|
||||
}
|
||||
@@ -94,7 +99,7 @@ class _billingagreements extends \IPS\Dispatcher\Controller
|
||||
\IPS\Output::i()->sidebar['actions']['suspend'] = array(
|
||||
'icon' => 'times',
|
||||
'title' => 'billing_agreement_suspend',
|
||||
'link' => $billingAgreement->acpUrl()->setQueryString( array( 'do' => 'act', 'act' => 'suspend' ) ),
|
||||
'link' => $billingAgreement->acpUrl()->setQueryString( array( 'do' => 'act', 'act' => 'suspend' ) )->csrf(),
|
||||
'data' => array( 'confirm' => '', 'confirmSubMessage' => \IPS\Member::loggedIn()->language()->addToStack('billing_agreement_suspend_confirm') )
|
||||
);
|
||||
}
|
||||
@@ -103,7 +108,7 @@ class _billingagreements extends \IPS\Dispatcher\Controller
|
||||
\IPS\Output::i()->sidebar['actions']['reactivate'] = array(
|
||||
'icon' => 'check',
|
||||
'title' => 'billing_agreement_reactivate',
|
||||
'link' => $billingAgreement->acpUrl()->setQueryString( array( 'do' => 'act', 'act' => 'reactivate' ) ),
|
||||
'link' => $billingAgreement->acpUrl()->setQueryString( array( 'do' => 'act', 'act' => 'reactivate' ) )->csrf(),
|
||||
'data' => array( 'confirm' => '' )
|
||||
);
|
||||
}
|
||||
@@ -112,13 +117,13 @@ class _billingagreements extends \IPS\Dispatcher\Controller
|
||||
\IPS\Output::i()->sidebar['actions']['cancel'] = array(
|
||||
'icon' => 'times-circle',
|
||||
'title' => 'billing_agreement_cancel',
|
||||
'link' => $billingAgreement->acpUrl()->setQueryString( array( 'do' => 'act', 'act' => 'cancel' ) ),
|
||||
'link' => $billingAgreement->acpUrl()->setQueryString( array( 'do' => 'act', 'act' => 'cancel' ) )->csrf(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/* Display */
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( 'billing_agreement_id', FALSE, array( 'sprintf' => array( $billingAgreement->id ) ) );
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( 'billing_agreement_id', FALSE, array( 'sprintf' => array( $billingAgreement->gw_id ) ) );
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'billingagreements' )->view( $billingAgreement, $purchases, $transactions );
|
||||
}
|
||||
catch ( \IPS\nexus\Gateway\PayPal\Exception $e )
|
||||
@@ -138,6 +143,8 @@ class _billingagreements extends \IPS\Dispatcher\Controller
|
||||
*/
|
||||
public function reconcile()
|
||||
{
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
/* Load */
|
||||
try
|
||||
{
|
||||
@@ -173,9 +180,11 @@ class _billingagreements extends \IPS\Dispatcher\Controller
|
||||
*/
|
||||
public function act()
|
||||
{
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
/* Check act */
|
||||
$act = \IPS\Request::i()->act;
|
||||
if ( !in_array( $act, array( 'suspend', 'reactivate', 'cancel' ) ) )
|
||||
if ( !\in_array( $act, array( 'suspend', 'reactivate', 'cancel' ) ) )
|
||||
{
|
||||
\IPS\Output::i()->error( 'node_error', '3X320/8', 403, '' );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user