Version 4.7.13
This commit is contained in:
1 parent
fd22d99e69
commit
7124a02564
954 files changed
+29277
-59308
No files matched your search
@@ -331,6 +331,9 @@ class _cleanup extends \IPS\Task
|
||||
|
||||
/* Truncate the output caches table */
|
||||
\IPS\Output\Cache::i()->deleteExpired( TRUE );
|
||||
|
||||
/* Delete Contact Us Verifications older than a month */
|
||||
\IPS\Db::i()->delete( 'core_contact_verify', array( "verify_time<?", \IPS\DateTime::create()->sub( new \DateInterval( 'P30D' ) )->getTimestamp() ) );
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief clearUnconfirmed Task
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 21 Aug 2023
|
||||
*/
|
||||
|
||||
namespace IPS\core\tasks;
|
||||
|
||||
use IPS\DateTime;
|
||||
use IPS\Db;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* clearUnconfirmed Task
|
||||
*/
|
||||
class _clearUnconfirmed extends \IPS\Task
|
||||
{
|
||||
/**
|
||||
* Execute
|
||||
*
|
||||
* If ran successfully, should return anything worth logging. Only log something
|
||||
* worth mentioning (don't log "task ran successfully"). Return NULL (actual NULL, not '' or 0) to not log (which will be most cases).
|
||||
* If an error occurs which means the task could not finish running, throw an \IPS\Task\Exception - do not log an error as a normal log.
|
||||
* Tasks should execute within the time of a normal HTTP request.
|
||||
*
|
||||
* @return mixed Message to log or NULL
|
||||
* @throws \IPS\Task\Exception
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
Db::i()->delete( 'core_hive_subscribers', [ 'subscribe_confirmed=? AND subscribe_date<=?', 0, DateTime::create()->sub( new \DateInterval( 'P1M' ) )->getTimestamp() ] );
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleanup
|
||||
*
|
||||
* If your task takes longer than 15 minutes to run, this method
|
||||
* will be called before execute(). Use it to clean up anything which
|
||||
* may not have been done
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -39,25 +39,9 @@ class _pruneipaddresses extends \IPS\Task
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
$types = array();
|
||||
|
||||
foreach ( \IPS\Content::routedClasses( FALSE, TRUE ) as $class )
|
||||
{
|
||||
try
|
||||
{
|
||||
$class::pruneIpAddresses( \IPS\Settings::i()->ip_address_prune );
|
||||
}
|
||||
catch( \Exception $ex ) { }
|
||||
}
|
||||
|
||||
/* Personal Messages */
|
||||
$time = time() - ( 86400 * \IPS\Settings::i()->ip_address_prune );
|
||||
\IPS\Db::i()->update( 'core_message_posts', array( 'msg_ip_address' => '' ), array( "msg_ip_address != '' AND msg_date <= " . $time ) );
|
||||
|
||||
/* Ratings */
|
||||
\IPS\Db::i()->update( 'core_ratings', array( 'ip' => '' ), array( "ip != '' AND rating_date IS NOT NULL AND rating_date <= " . $time ) );
|
||||
|
||||
\IPS\Member::pruneAllLoggedIpAddresses( $time );
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ class _viewupdates extends \IPS\Task
|
||||
*/
|
||||
protected function update( $class, $id, $count )
|
||||
{
|
||||
if ( class_exists( $class ) and \in_array( 'IPS\Content\Views', class_implements( $class ) ) AND isset( $class::$databaseColumnMap['views'] ) )
|
||||
if ( class_exists( $class ) and \IPS\IPS::classUsesTrait( $class, 'IPS\Content\ViewUpdates' ) AND isset( $class::$databaseColumnMap['views'] ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -55,7 +55,7 @@ class _webhooks extends \IPS\Task
|
||||
\IPS\Output::i()->parseFileObjectUrls( $fire['data'] );
|
||||
$fire['data'] = \IPS\Output::i()->replaceEmojiWithImages( $fire['data'] );
|
||||
|
||||
$response = \IPS\Http\Url::external( $webhooks[ $fire['webhook'] ]['url'] )
|
||||
$request = \IPS\Http\Url::external( $webhooks[ $fire['webhook'] ]['url'] )
|
||||
->request()
|
||||
->setHeaders(
|
||||
[
|
||||
@@ -63,8 +63,14 @@ class _webhooks extends \IPS\Task
|
||||
'Webhook-Event' => $fire['event'],
|
||||
'Content-Type' => $webhooks[ $fire['webhook'] ]['content_type']
|
||||
]
|
||||
)
|
||||
->login( $webhooks[ $fire['webhook'] ]['api_key'], '' )->post( $fire['data'] );
|
||||
);
|
||||
|
||||
if( !empty( $webhooks[ $fire['webhook'] ]['api_key'] ) )
|
||||
{
|
||||
$request = $request->login( $webhooks[ $fire['webhook'] ]['api_key'], '' );
|
||||
}
|
||||
|
||||
$response = $request->post( $fire['data'] );
|
||||
|
||||
if ( \IPS\Settings::i()->webhook_logs_success )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user