Skip to content

Commit

Permalink
All the cron-files should use $ssi_guest_access = true because cron i…
Browse files Browse the repository at this point in the history
…s not a registered user - fixes elkarte#3195
  • Loading branch information
emanuele45 committed Jun 3, 2018
1 parent ee87392 commit b3987f0
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion SSI.php
Expand Up @@ -60,7 +60,7 @@
define('ELK', 'SSI');

require_once(dirname(__FILE__) . '/bootstrap.php');
$bootstrap = new Bootstrap();
$bootstrap = new Bootstrap(true);
}

// The globals that were created during the bootstrap process
Expand Down
7 changes: 5 additions & 2 deletions email_imap_cron.php
Expand Up @@ -18,8 +18,11 @@
// Being run as a cron job
if (!defined('ELK'))
{
global $ssi_guest_access;

require_once(__DIR__ . '/bootstrap.php');
new Bootstrap();
$ssi_guest_access = true;
new Bootstrap(true);
postbyemail_imap();

// Need to keep the cli clean on return
Expand Down Expand Up @@ -57,4 +60,4 @@ function postbyemail_imap()
{
return false;
}
}
}
7 changes: 5 additions & 2 deletions emailpost.php
Expand Up @@ -26,9 +26,12 @@
// Any output here is not good
error_reporting(0);

global $ssi_guest_access;

// Need to bootstrap to do much
require_once(__DIR__ . '/bootstrap.php');
new Bootstrap();
$ssi_guest_access = true;
new Bootstrap(true);

// No need to ID the server if we fall on our face :)
$_SERVER['SERVER_SOFTWARE'] = '';
Expand All @@ -39,4 +42,4 @@
$controller->action_pbe_post();

// Always exit as successful
exit(0);
exit(0);
7 changes: 5 additions & 2 deletions emailtopic.php
Expand Up @@ -26,9 +26,12 @@
// Any output here is not good, it will be bounced as email
error_reporting(0);

global $ssi_guest_access;

// Need to bootstrap the system to do much
require_once(dirname(__FILE__) . '/bootstrap.php');
new Bootstrap();
$ssi_guest_access = true;
new Bootstrap(true);

// No need to ID the server if we fall on our face :)
$_SERVER['SERVER_SOFTWARE'] = '';
Expand All @@ -39,4 +42,4 @@
$controller->action_pbe_topic();

// Always exit as successful
exit(0);
exit(0);
8 changes: 5 additions & 3 deletions subscriptions.php
Expand Up @@ -17,12 +17,14 @@
*/

// Start things rolling by getting the forum alive...
$ssi_guest_access = true;
if (!file_exists(dirname(__FILE__) . '/bootstrap.php'))
die('Unable to initialize');

global $ssi_guest_access;

require_once(dirname(__FILE__) . '/bootstrap.php');
new Bootstrap();
$ssi_guest_access = true;
new Bootstrap(true);

global $txt, $modSettings, $context;

Expand Down Expand Up @@ -276,4 +278,4 @@ function generateSubscriptionError($text)
Errors::instance()->log_error($text);

exit;
}
}

0 comments on commit b3987f0

Please sign in to comment.