Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -33,6 +33,19 @@ class _cleanup extends \IPS\Task
|
||||
/* Delete old password / security answer reset requests */
|
||||
\IPS\Db::i()->delete( 'core_validating', array( '( lost_pass=1 OR forgot_security=1 ) AND email_sent < ?', \IPS\DateTime::create()->sub( new \DateInterval( 'P1D' ) )->getTimestamp() ) );
|
||||
|
||||
/* Delete cancelled registration members */
|
||||
foreach( \IPS\Db::i()->select( 'member_id', 'core_validating', array( 'do_not_delete=0 and reg_cancelled > 0 and reg_cancelled < ?', time() - 86400 ) ) as $id )
|
||||
{
|
||||
try
|
||||
{
|
||||
\IPS\Member::load( $id )->delete();
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
\IPS\Db::i()->delete( 'core_validating', array( 'member_id=?', $id ) );
|
||||
}
|
||||
}
|
||||
|
||||
/* Delete old validating members */
|
||||
if ( \IPS\Settings::i()->validate_day_prune )
|
||||
{
|
||||
@@ -93,12 +106,6 @@ class _cleanup extends \IPS\Task
|
||||
\IPS\Db::i()->delete( 'core_error_logs', array( 'log_date < ?', \IPS\DateTime::create()->sub( new \DateInterval( 'P' . \IPS\Settings::i()->prune_log_error . 'D' ) )->getTimestamp() ) );
|
||||
}
|
||||
|
||||
/* ...and system logs */
|
||||
if( \IPS\Settings::i()->prune_log_system )
|
||||
{
|
||||
\IPS\Log::pruneLogs( \IPS\Settings::i()->prune_log_system );
|
||||
}
|
||||
|
||||
/* ...and spam service logs */
|
||||
if( \IPS\Settings::i()->prune_log_spam )
|
||||
{
|
||||
@@ -185,21 +192,11 @@ class _cleanup extends \IPS\Task
|
||||
}
|
||||
|
||||
/* Delete any incompleted accounts (for example, someone has clicked "Sign in with Twitter" and never provided a username or email */
|
||||
foreach ( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'core_members', array( array( '(name=? OR email=?)', '', '' ), array( 'joined<? AND last_visit=0 AND ipsconnect_id=0', \IPS\DateTime::create()->sub( new \DateInterval( 'PT1H' ) )->getTimestamp() ) ) ), 'IPS\Member' ) as $incompleteMember )
|
||||
foreach ( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'core_members', array( array( '(name=? OR email=?)', '', '' ), array( 'joined<? AND last_visit=0', \IPS\DateTime::create()->sub( new \DateInterval( 'PT1H' ) )->getTimestamp() ) ) ), 'IPS\Member' ) as $incompleteMember )
|
||||
{
|
||||
$incompleteMember->delete();
|
||||
}
|
||||
|
||||
/* Prune search index */
|
||||
if ( \IPS\Settings::i()->search_index_timeframe )
|
||||
{
|
||||
try
|
||||
{
|
||||
\IPS\Content\Search\Index::i()->prune( \IPS\DateTime::create()->sub( new \DateInterval( 'P' . \IPS\Settings::i()->search_index_timeframe . 'D' ) ) );
|
||||
}
|
||||
catch ( \UnexpectedValueException $e ) { }
|
||||
}
|
||||
|
||||
/* Remove widgets */
|
||||
if ( \IPS\Application::appIsEnabled('cms') )
|
||||
{
|
||||
@@ -222,6 +219,11 @@ class _cleanup extends \IPS\Task
|
||||
|
||||
/* Close open polls that need closing */
|
||||
\IPS\Db::i()->update( 'core_polls', array( 'poll_closed' => 1 ), array( 'poll_closed=? AND poll_close_date>? AND poll_close_date<?', 0, -1, time() ) );
|
||||
|
||||
/* Delete expired oAuth Authorization Codes */
|
||||
\IPS\Db::i()->delete( 'core_oauth_server_authorization_codes', array( 'expires<?', time() ) );
|
||||
\IPS\Db::i()->delete( 'core_oauth_server_access_tokens', array( 'refresh_token_expires<?', time() ) );
|
||||
\IPS\Db::i()->delete( 'core_oauth_authorize_prompts', array( 'timestamp<?', ( time() - 300 ) ) );
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user