Version 3.4.5
This commit is contained in:
1 parent
fb6b5baabc
commit
e4478369d8
1360 files changed
+228921
-179445
No files matched your search
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* @file facebook.php Community Enhancements - Facebook
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: mark $
|
||||
* @since 24 July 2012
|
||||
* $LastChangedDate: 2012-06-20 10:50:23 +0100 (Wed, 20 Jun 2012) $
|
||||
* @version v3.4.5
|
||||
* $Revision: 10952 $
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @class enhancements_core_facebook
|
||||
* @brief Community Enhancements - Facebook
|
||||
*/
|
||||
class enhancements_core_facebook
|
||||
{
|
||||
/**
|
||||
* Applicable Settings
|
||||
*/
|
||||
public $settings = array( 'fbc_enable', 'fbc_appid', 'fbc_secret', 'fbc_mgid', 'fbc_bot_group', 'fb_locale', 'fb_realname' );
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param ipsRegistry
|
||||
*/
|
||||
public function __construct( $registry )
|
||||
{
|
||||
$this->title = $registry->getClass('class_localization')->words['enhancements_facebook'];
|
||||
$this->description = $registry->getClass('class_localization')->words['enhancements_facebook_desc'];
|
||||
$this->enabled = ipsRegistry::$settings['fbc_enable'];
|
||||
$this->message = '<a href="http://external.ipslink.com/ipboard30/landing/?p=facebook" target="_blank">' . ipsRegistry::getClass('class_localization')->words['enhancements_facebook_help'] . '</a>';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* @file facebook.php Community Enhancements - Google Analytics
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: mark $
|
||||
* @since 24 July 2012
|
||||
* $LastChangedDate: 2012-06-20 10:50:23 +0100 (Wed, 20 Jun 2012) $
|
||||
* @version v3.4.5
|
||||
* $Revision: 10952 $
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @class enhancements_core_googleanalytics
|
||||
* @brief Community Enhancements - Google Analytics
|
||||
*/
|
||||
class enhancements_core_googleanalytics
|
||||
{
|
||||
/**
|
||||
* Applicable Settings
|
||||
*/
|
||||
public $settings = array( 'ipseo_ga' );
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param ipsRegistry
|
||||
*/
|
||||
public function __construct( $registry )
|
||||
{
|
||||
$this->title = $registry->getClass('class_localization')->words['enhancements_googleanalytics'];
|
||||
$this->description = $registry->getClass('class_localization')->words['enhancements_googleanalytics_desc'];
|
||||
$this->message = "<a href='http://www.google.com/analytics/' target='_blank'>{$registry->getClass('class_localization')->words['enhancements_googleanalytics_help']}</a>";
|
||||
$this->enabled = (bool) ipsRegistry::$settings['ipseo_ga'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* @file twitter.php Community Enhancements - IPS Backup
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: mark $
|
||||
* @since 24 July 2012
|
||||
* $LastChangedDate: 2012-06-20 10:50:23 +0100 (Wed, 20 Jun 2012) $
|
||||
* @version v3.4.5
|
||||
* $Revision: 10952 $
|
||||
*/
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// admin_core_applications_enhancements::manage()
|
||||
// contains code to disable this enhancement
|
||||
// from showing right now
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @class enhancements_core_ipsbackup
|
||||
* @brief Community Enhancements - IPS Backup
|
||||
*/
|
||||
class enhancements_core_ipsbackup
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param ipsRegistry
|
||||
*/
|
||||
public function __construct( $registry )
|
||||
{
|
||||
$this->title = 'IPS Backup Service';
|
||||
$this->description = 'Automatically backup your community.';
|
||||
$this->icon = '';
|
||||
$this->enabled = FALSE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
/**
|
||||
* @file ipscdn.php Community Enhancements - IPS CDN
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: mark $
|
||||
* @since 24 July 2012
|
||||
* $LastChangedDate: 2012-06-20 10:50:23 +0100 (Wed, 20 Jun 2012) $
|
||||
* @version v3.4.5
|
||||
* $Revision: 10952 $
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @class enhancements_core_ipscdn
|
||||
* @brief Community Enhancements - IPS CDN
|
||||
*/
|
||||
class enhancements_core_ipscdn
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param ipsRegistry
|
||||
*/
|
||||
public function __construct( $registry )
|
||||
{
|
||||
$this->title = $registry->getClass('class_localization')->words['enhancements_ipscdn'];
|
||||
$this->description = $registry->getClass('class_localization')->words['enhancements_ipscdn_desc'];
|
||||
$this->icon = '';
|
||||
$this->enabled = ipsRegistry::$settings['ips_cdn'];
|
||||
|
||||
$this->html = $registry->output->loadTemplate( 'cp_skin_applications' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit Settings
|
||||
*/
|
||||
public function editSettings()
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
|
||||
|
||||
$skinFunctions = new skinCaching( ipsRegistry::instance() );
|
||||
|
||||
if ( ipsRegistry::$request['recache'] )
|
||||
{
|
||||
$skinFunctions->flushipscdn();
|
||||
|
||||
ipsRegistry::getClass('output')->redirect( ipsRegistry::$settings['_base_url'] . "app=core&module=applications&section=enhancements&do=edit&service=enhancements_core_ipscdn", ipsRegistry::getClass('class_localization')->words['cdn_recached'] );
|
||||
}
|
||||
|
||||
if ( ipsRegistry::$request['disable'] )
|
||||
{
|
||||
IPSLib::updateSettings( array( 'ips_cdn' => FALSE, 'ipb_img_url' => '', 'ipb_css_url' => '', 'ipb_js_url' => '', 'upload_url' => '' ) );
|
||||
|
||||
if ( IPSLib::appIsInstalled('gallery') )
|
||||
{
|
||||
$this_script = str_replace( '\\', '/', getenv( 'SCRIPT_FILENAME' ) );
|
||||
$url = ipsRegistry::$settings['_original_base_url'];
|
||||
|
||||
if( $this_script )
|
||||
{
|
||||
$this_script = str_replace( '/'.CP_DIRECTORY.'/index.php', '', $this_script );
|
||||
if ( substr( ipsRegistry::$settings['gallery_images_path'], 0, strlen( $this_script ) ) === $this_script )
|
||||
{
|
||||
$url = str_replace( '\\', '/', str_replace( $this_script, $url, ipsRegistry::$settings['gallery_images_path'] ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$url .= '/uploads';
|
||||
}
|
||||
|
||||
IPSLib::updateSettings( array( 'gallery_images_path' => $url ) );
|
||||
}
|
||||
|
||||
IPSContentCache::truncate( 'post' );
|
||||
IPSContentCache::truncate( 'sig' );
|
||||
|
||||
/* Set skin sets to recache */
|
||||
$skinFunctions->flagSetForRecache();
|
||||
|
||||
ipsRegistry::getClass('output')->redirect( ipsRegistry::$settings['_base_url'] . "app=core&module=applications&section=enhancements", ipsRegistry::getClass('class_localization')->words['cdn_disabled'] );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !ipsRegistry::$settings['ipb_reg_number'] )
|
||||
{
|
||||
ipsRegistry::getClass('output')->showError( sprintf( ipsRegistry::getClass('class_localization')->words['enhancements_ipscdn_error_nokey'], ipsRegistry::getClass('output')->buildUrl('app=core&module=tools§ion=licensekey', 'admin') ) );
|
||||
}
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' );
|
||||
$file = new $classToLoad();
|
||||
$return = NULL;
|
||||
|
||||
if ( $json = @json_decode( $ping, TRUE ) )
|
||||
{
|
||||
if ( $json['ENABLED'] and $json['BYTES'] > 0 )
|
||||
{
|
||||
if ( !ipsRegistry::$settings['ips_cdn'] and !ipsRegistry::$request['enable'] )
|
||||
{
|
||||
return $this->html->cdnInactive( $json );
|
||||
}
|
||||
else
|
||||
{
|
||||
$settings = array( 'ips_cdn' => TRUE, 'ipb_img_url' => $json['URL'], 'ipb_css_url' => rtrim( $json['URL'], '/' ) . '/', 'ipb_js_url' => rtrim( $json['URL'], '/' ) . '/', 'upload_url' => $json['URL'] . '/uploads' );
|
||||
if ( IPSLib::appIsInstalled('downloads') )
|
||||
{
|
||||
if ( substr( ipsRegistry::$settings['idm_localsspath'], 0, 11 ) === '{root_path}' )
|
||||
{
|
||||
$settings['idm_screenshot_url'] = str_replace( '{root_path}', $json['URL'], ipsRegistry::$settings['idm_localsspath'] );
|
||||
}
|
||||
}
|
||||
if ( IPSLib::appIsInstalled('gallery') )
|
||||
{
|
||||
$this_script = str_replace( '\\', '/', getenv( 'SCRIPT_FILENAME' ) );
|
||||
if( $this_script )
|
||||
{
|
||||
$this_script = str_replace( '/'.CP_DIRECTORY.'/index.php', '', $this_script );
|
||||
if ( substr( ipsRegistry::$settings['gallery_images_path'], 0, strlen( $this_script ) ) === $this_script )
|
||||
{
|
||||
$settings['gallery_images_url'] = str_replace( '\\', '/', str_replace( $this_script, $json['URL'], ipsRegistry::$settings['gallery_images_path'] ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$_settings = array();
|
||||
foreach ( $settings as $k => $v )
|
||||
{
|
||||
if ( ipsRegistry::$settings[ $k ] != $v )
|
||||
{
|
||||
$_settings[ $k ] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !empty( $_settings ) )
|
||||
{
|
||||
IPSLib::updateSettings( $settings );
|
||||
}
|
||||
|
||||
/* Set skin sets to recache */
|
||||
$skinFunctions->flagSetForRecache();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$licenseData = ipsRegistry::cache()->getCache('licenseData');
|
||||
if ( $licenseData['key']['url'] != ipsRegistry::$settings['board_url'] )
|
||||
{
|
||||
ipsRegistry::getClass('output')->showError( ipsRegistry::getClass('class_localization')->words['enhancements_ipscdn_error_url'] );
|
||||
}
|
||||
|
||||
/* Set skin sets to recache */
|
||||
$skinFunctions->flagSetForRecache();
|
||||
|
||||
return $this->html->cdnNotEnabled( $json );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ipsRegistry::getClass('output')->showError( sprintf( ipsRegistry::getClass('class_localization')->words['enhancements_ipscdn_error_key'], ipsRegistry::getClass('output')->buildUrl('app=core&module=tools§ion=licensekey', 'admin') ) );
|
||||
}
|
||||
|
||||
return $this->html->cdnOverview( $json );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* @file twitter.php Community Enhancements - Twitter
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: mark $
|
||||
* @since 24 July 2012
|
||||
* $LastChangedDate: 2012-06-20 10:50:23 +0100 (Wed, 20 Jun 2012) $
|
||||
* @version v3.4.5
|
||||
* $Revision: 10952 $
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @class enhancements_core_twitter
|
||||
* @brief Community Enhancements - Twitter
|
||||
*/
|
||||
class enhancements_core_twitter
|
||||
{
|
||||
/**
|
||||
* Applicable Settings
|
||||
*/
|
||||
public $settings = array( 'tc_enabled', 'tc_token', 'tc_secret', 'tc_mgid' );
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param ipsRegistry
|
||||
*/
|
||||
public function __construct( $registry )
|
||||
{
|
||||
$this->title = $registry->getClass('class_localization')->words['enhancements_twitter'];
|
||||
$this->description = $registry->getClass('class_localization')->words['enhancements_twitter_desc'];
|
||||
$this->enabled = ipsRegistry::$settings['tc_enabled'];
|
||||
$this->message = '<a href="http://external.ipslink.com/ipboard30/landing/?p=twitter" target="_blank">' . ipsRegistry::getClass('class_localization')->words['enhancements_twitter_help'] . '</a>';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
/**
|
||||
* @file twitter.php Community Enhancements - Viglink
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: mark $
|
||||
* @since 24 July 2012
|
||||
* $LastChangedDate: 2012-06-20 10:50:23 +0100 (Wed, 20 Jun 2012) $
|
||||
* @version v3.4.5
|
||||
* $Revision: 10952 $
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @class enhancements_core_viglink
|
||||
* @brief Community Enhancements - Viglink
|
||||
*/
|
||||
class enhancements_core_viglink
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param ipsRegistry
|
||||
*/
|
||||
public function __construct( $registry )
|
||||
{
|
||||
$this->title = $registry->getClass('class_localization')->words['enhancements_viglink'];
|
||||
$this->description = $registry->getClass('class_localization')->words['enhancements_viglink_desc'];
|
||||
$this->enabled = ipsRegistry::$settings['viglink_enabled'];
|
||||
|
||||
if ( $this->enabled )
|
||||
{
|
||||
$this->message = sprintf( $registry->getClass('class_localization')->words['viglink_forums_notice'], $registry->output->buildUrl('app=forums', 'admin') );
|
||||
$this->settings = array( 'viglink_enabled' );
|
||||
if ( !ipsRegistry::$settings['viglink_subid'] )
|
||||
{
|
||||
$this->settings[] = 'viglink_api_key';
|
||||
}
|
||||
$this->settings[] = 'viglink_groups';
|
||||
$this->settings[] = 'viglink_norewrite';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit Settings
|
||||
*/
|
||||
public function editSettings()
|
||||
{
|
||||
$json = $this->_makeApiCall();
|
||||
return ipsRegistry::getClass('output')->loadTemplate('cp_skin_applications')->viglinkConvert( $json['URL'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Save Settings
|
||||
*/
|
||||
public function saveSettings()
|
||||
{
|
||||
if ( isset( ipsRegistry::$request['viglink_manual'] ) )
|
||||
{
|
||||
IPSLib::updateSettings( array( 'viglink_enabled' => '1', 'viglink_api_key' => ipsRegistry::$request['viglink_api_key'], 'viglink_subid' => '' ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$json = $this->_makeApiCall();
|
||||
IPSLib::updateSettings( array( 'viglink_enabled' => '1', 'viglink_api_key' => $json['API_KEY'], 'viglink_subid' => $json['SUBID'] ) );
|
||||
}
|
||||
|
||||
ipsRegistry::getClass('output')->silentRedirect( ipsRegistry::$settings['_base_url'] . "app=core&module=applications&section=enhancements&do=edit&service=enhancements_core_viglink" );
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make call to IPS to get API keys
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function _makeApiCall()
|
||||
{
|
||||
$subId = NULL;
|
||||
if ( ipsRegistry::$settings['ipb_reg_number'] )
|
||||
{
|
||||
$exploded = explode( '-', ipsRegistry::$settings['ipb_reg_number'] );
|
||||
if ( isset( $exploded[3] ) )
|
||||
{
|
||||
$subId = $exploded[3];
|
||||
}
|
||||
}
|
||||
if ( $subId === NULL )
|
||||
{
|
||||
$subId = ipsRegistry::$settings['board_url'];
|
||||
if ( strlen( $subId ) > 32 )
|
||||
{
|
||||
$subId = str_replace( array( 'http://', 'https://' ), '', $subId );
|
||||
}
|
||||
if ( strlen( $subId ) > 32 )
|
||||
{
|
||||
$subId = md5( $subId );
|
||||
}
|
||||
}
|
||||
|
||||
require_once IPS_KERNEL_PATH . 'classFileManagement.php';
|
||||
$cfm = new classFileManagement();
|
||||
$return = NULL;
|
||||
if ( $return and $json = @json_decode( $return, TRUE ) and $json['SUCCESS'] == TRUE )
|
||||
{
|
||||
return $json;
|
||||
}
|
||||
else
|
||||
{
|
||||
ipsRegistry::getClass('output')->showError( ipsRegistry::getClass('class_localization')->words['enhancements_viglink_error'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
/**
|
||||
* @file twitter.php Community Enhancements - Windows Live
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: mark $
|
||||
* @since 24 July 2012
|
||||
* $LastChangedDate: 2012-06-20 10:50:23 +0100 (Wed, 20 Jun 2012) $
|
||||
* @version v3.4.5
|
||||
* $Revision: 10952 $
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @class enhancements_core_windowslive
|
||||
* @brief Community Enhancements - Windows Live
|
||||
*/
|
||||
class enhancements_core_windowslive
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param ipsRegistry
|
||||
*/
|
||||
public function __construct( $registry )
|
||||
{
|
||||
$this->title = $registry->getClass('class_localization')->words['enhancements_windowslive'];
|
||||
$this->description = $registry->getClass('class_localization')->words['enhancements_windowslive_desc'];
|
||||
|
||||
$this->enabled = FALSE;
|
||||
$loginMethods = ipsRegistry::cache()->getCache('login_methods');
|
||||
foreach ( $loginMethods as $method )
|
||||
{
|
||||
if ( $method['login_folder_name'] == 'live' and $method['login_enabled'] )
|
||||
{
|
||||
$this->enabled = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
$this->html = $registry->output->loadTemplate( 'cp_skin_applications' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit Settings
|
||||
*/
|
||||
public function editSettings()
|
||||
{
|
||||
ipsRegistry::getClass('class_permissions')->checkPermissionAutoMsg( 'login_manage' );
|
||||
|
||||
$method = ipsRegistry::DB()->buildAndFetch( array( 'select' => '*', 'from' => 'login_methods', 'where' => "login_folder_name='live'" ) );
|
||||
if ( !$method['login_id'] )
|
||||
{
|
||||
ipsRegistry::getClass('output')->showError( sprintf( ipsRegistry::getClass('class_localization')->words['enhancements_windowslive_error'], ipsRegistry::$settings['_base_url'] . 'app=core&module=tools&section=login' ) );
|
||||
}
|
||||
|
||||
if ( ipsRegistry::$request['downloadxml'] )
|
||||
{
|
||||
$clientId = ipsRegistry::$request['client_id'];
|
||||
$clientSecret = ipsRegistry::$request['client_secret'];
|
||||
|
||||
header( "Content-Disposition: attachment; filename=\"Application-Key.xml\"" );
|
||||
header( "Content-type: application/xml" );
|
||||
|
||||
echo <<<XML
|
||||
<windowslivelogin>
|
||||
<appid>{$clientId}</appid>
|
||||
<secret>{$clientSecret}</secret>
|
||||
<securityalgorithm>wsignin1.0</securityalgorithm>
|
||||
</windowslivelogin>
|
||||
XML;
|
||||
exit;
|
||||
}
|
||||
|
||||
$config = unserialize( $method['login_custom_config'] );
|
||||
$settings = array( 'enabled' => $this->enabled );
|
||||
if ( $config['key_file_location'] )
|
||||
{
|
||||
$settings['xml'] = $config['key_file_location'];
|
||||
|
||||
$xml = file_get_contents( $settings['xml'] );
|
||||
|
||||
preg_match( "/<appid>(.+?)<\/appid>/" , $xml, $matches );
|
||||
$settings['client_id'] = $matches[1];
|
||||
|
||||
preg_match( "/<secret>(.+?)<\/secret>/" , $xml, $matches );
|
||||
$settings['client_secret'] = $matches[1];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$exploded = explode( '/', rtrim( DOC_IPS_ROOT_PATH, '/' ) );
|
||||
do
|
||||
{
|
||||
$popped = array_pop( $exploded );
|
||||
}
|
||||
while ( strstr( ipsRegistry::$settings['base_url'], $popped ) !== FALSE );
|
||||
$exploded[] = $popped;
|
||||
|
||||
$settings['xml'] = implode( '/', $exploded ) . '/Application-Key.xml';
|
||||
}
|
||||
|
||||
return $this->html->windowsLiveSetup( $settings );
|
||||
}
|
||||
|
||||
/**
|
||||
* Save Settings
|
||||
*/
|
||||
public function saveSettings()
|
||||
{
|
||||
ipsRegistry::getClass('class_permissions')->checkPermissionAutoMsg( 'login_manage' );
|
||||
|
||||
$login = ipsRegistry::DB()->buildAndFetch( array( 'select' => '*', 'from' => 'login_methods', 'where' => "login_folder_name='live'" ) );
|
||||
if ( !$login['login_id'] )
|
||||
{
|
||||
ipsRegistry::getClass('output')->showError( sprintf( ipsRegistry::getClass('class_localization')->words['enhancements_windowslive_error'], ipsRegistry::$settings['_base_url'] . 'app=core&module=tools&section=login' ) );
|
||||
}
|
||||
|
||||
if ( ipsRegistry::$request['disable'] )
|
||||
{
|
||||
ipsRegistry::DB()->update( 'login_methods', array( 'login_enabled' => 0 ), 'login_id=' . $login['login_id'] );
|
||||
ipsRegistry::cache()->rebuildCache( 'login_methods' );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !is_file( ipsRegistry::$request['xml'] ) )
|
||||
{
|
||||
ipsRegistry::getClass('output')->showError( ipsRegistry::getClass('class_localization')->words['enhancements_windowslive_error2'] );
|
||||
}
|
||||
|
||||
$config = unserialize( $login['login_custom_config'] );
|
||||
$config['key_file_location'] = ipsRegistry::$request['xml'];
|
||||
$toSave = array( 'login_custom_config' => serialize( $config ) );
|
||||
$toSave['login_enabled'] = '1';
|
||||
|
||||
ipsRegistry::DB()->update( 'login_methods', $toSave, 'login_id=' . $login['login_id'] );
|
||||
|
||||
ipsRegistry::cache()->rebuildCache( 'login_methods' );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user