Version 4.1.2
This commit is contained in:
1 parent
3ba79295ee
commit
28bd025b35
1131 files changed
+63658
-20579
No files matched your search
@@ -38,7 +38,7 @@ abstract class _ProfileSyncAbstract
|
||||
$services = array();
|
||||
foreach ( new \DirectoryIterator( \IPS\ROOT_PATH . '/applications/core/sources/ProfileSync' ) as $file )
|
||||
{
|
||||
if ( !$file->isDot() and mb_substr( $file, -4 ) === '.php' )
|
||||
if ( !$file->isDot() and mb_substr( $file, -4 ) === '.php' and mb_substr( $file, 0, 2 ) != '._' )
|
||||
{
|
||||
require_once $file->getPathname();
|
||||
$class = 'IPS\core\ProfileSync\\' . mb_substr( $file, 0, -4 );
|
||||
@@ -173,6 +173,7 @@ abstract class _ProfileSyncAbstract
|
||||
*/
|
||||
public function save( $values )
|
||||
{
|
||||
/* Get existing settings */
|
||||
$settings = $this->member->profilesync ? json_decode( $this->member->profilesync, TRUE ) : array(
|
||||
static::$loginKey => array(
|
||||
'photo' => FALSE,
|
||||
@@ -180,12 +181,30 @@ abstract class _ProfileSyncAbstract
|
||||
'status' => ''
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
/* Set the new values for this service */
|
||||
$settings[ static::$loginKey ] = array(
|
||||
'photo' => isset( $values['profilesync_photo'] ) ? $values['profilesync_photo'] : ( isset( $settings[ static::$loginKey ]['photo'] ) ? $settings[ static::$loginKey ]['photo'] : FALSE ),
|
||||
'cover' => isset( $values['profilesync_cover'] ) ? $values['profilesync_cover'] : ( isset( $settings[ static::$loginKey ]['cover'] ) ? $settings[ static::$loginKey ]['cover'] : FALSE ),
|
||||
'status' => isset( $values['profilesync_status'] ) ? $values['profilesync_status'] : ( isset( $settings[ static::$loginKey ]['status'] ) ? $settings[ static::$loginKey ]['status'] : FALSE ),
|
||||
);
|
||||
'status' => isset( $values['profilesync_status'] ) ? ( $values['profilesync_status'] == 'none' ) ? FALSE : $values['profilesync_status'] : ( isset( $settings[ static::$loginKey ]['status'] ) ? $settings[ static::$loginKey ]['status'] : FALSE ),
|
||||
);
|
||||
|
||||
/* We cannot have more than one service syncing photos/cover photos - otherwise they conflict */
|
||||
foreach ( array( 'photo', 'cover' ) as $type )
|
||||
{
|
||||
if ( $settings[ static::$loginKey ][ $type ] )
|
||||
{
|
||||
foreach ( $settings as $service => $serviceSettings )
|
||||
{
|
||||
if ( $service != static::$loginKey and $serviceSettings[ $type ] )
|
||||
{
|
||||
$settings[ $service ][ $type ] = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Finalise */
|
||||
$this->member->profilesync = json_encode( $settings );
|
||||
|
||||
/* If we're enabling status import, reset last sync time so we import the latest status */
|
||||
@@ -227,7 +246,7 @@ abstract class _ProfileSyncAbstract
|
||||
}
|
||||
}
|
||||
}
|
||||
catch ( \IPS\Http\Request\Exception $e ) {}
|
||||
catch ( \RuntimeException $e ) {}
|
||||
}
|
||||
if ( $settings['cover'] and $this->member->group['gbw_allow_upload_bgimage'] )
|
||||
{
|
||||
@@ -240,9 +259,13 @@ abstract class _ProfileSyncAbstract
|
||||
catch ( \Exception $e ) { }
|
||||
}
|
||||
|
||||
$this->member->pp_cover_photo = (string) $this->cover();
|
||||
try
|
||||
{
|
||||
$this->member->pp_cover_photo = (string) $this->cover();
|
||||
}
|
||||
catch ( \RuntimeException $e ) {}
|
||||
}
|
||||
if ( $settings['status'] and $settings['status'] == 'import' )
|
||||
if ( $settings['status'] and $settings['status'] == 'import' and !$this->member->group['gbw_no_status_import'] )
|
||||
{
|
||||
if ( $status = $this->status() )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user