Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -11,7 +11,7 @@
|
||||
namespace IPS\core\modules\admin\settings;
|
||||
|
||||
/* 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;
|
||||
@@ -22,6 +22,11 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
*/
|
||||
class _licensekey extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
/**
|
||||
* @brief Has been CSRF-protected
|
||||
*/
|
||||
public static $csrfProtected = TRUE;
|
||||
|
||||
/**
|
||||
* @brief Data about the license key from the store
|
||||
*/
|
||||
@@ -59,7 +64,7 @@ class _licensekey extends \IPS\Dispatcher\Controller
|
||||
\IPS\Output::i()->sidebar['actions'] = array(
|
||||
'refresh' => array(
|
||||
'icon' => 'refresh',
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=settings&controller=licensekey&do=refresh' ),
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=settings&controller=licensekey&do=refresh' )->csrf(),
|
||||
'title' => 'license_refresh',
|
||||
),
|
||||
'remove' => array(
|
||||
@@ -89,6 +94,8 @@ class _licensekey extends \IPS\Dispatcher\Controller
|
||||
*/
|
||||
protected function refresh()
|
||||
{
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
/* Fetch the license key data and update our local storage */
|
||||
unset( \IPS\Data\Store::i()->license_data );
|
||||
|
||||
@@ -142,6 +149,8 @@ class _licensekey extends \IPS\Dispatcher\Controller
|
||||
|
||||
/* Refresh the locally stored license info */
|
||||
unset( \IPS\Data\Store::i()->license_data );
|
||||
|
||||
\IPS\core\AdminNotification::remove( 'core', 'License', 'missing' );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=settings&controller=licensekey' ), 'saved' );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user