Logger::notice('pumpio: cron_start');
$pconfigs = DBA::selectToArray('pconfig', ['cat' => 'pumpio', 'k' => 'mirror', 'v' => '1']);
- if (DBA::isResult($pconfigs)) {
- foreach ($pconfigs as $rr) {
- Logger::notice('pumpio: mirroring user '.$rr['uid']);
- pumpio_fetchtimeline($a, $rr['uid']);
- }
+ foreach ($pconfigs as $rr) {
+ Logger::notice('pumpio: mirroring user '.$rr['uid']);
+ pumpio_fetchtimeline($a, $rr['uid']);
}
$abandon_days = intval(DI::config()->get('system', 'account_abandon_days'));
$abandon_limit = date(DateTimeFormat::MYSQL, time() - $abandon_days * 86400);
$pconfigs = DBA::selectToArray('pconfig', ['cat' => 'pumpio', 'k' => 'import', 'v' => '1']);
- if (DBA::isResult($pconfigs)) {
- foreach ($pconfigs as $rr) {
+ foreach ($pconfigs as $rr) {
if ($abandon_days != 0) {
if (DBA::exists('user', ["uid = ? AND `login_date` >= ?", $rr['uid'], $abandon_limit])) {
Logger::notice('abandoned account: timeline from user '.$rr['uid'].' will not be imported');
pumpio_getallusers($a, $rr["uid"]);
DI::pConfig()->set($rr['uid'], 'pumpio', 'contact_check', time());
}
- }
}
Logger::notice('pumpio: cron_end');
function windowsphonepush_cron()
{
// retrieve all UID's for which the addon windowsphonepush is enabled and loop through every user
- $pconfigs = DBA::selectToArray('pconfig', ['cat' => 'windowsphonepush', 'k' => 'enable', 'v' => true]);
+ $pconfigs = DBA::selectToArray('pconfig', ['uid'], ['cat' => 'windowsphonepush', 'k' => 'enable', 'v' => true]);
foreach ($pconfigs as $rr) {
// load stored information for the user-id of the current loop
$device_url = DI::pConfig()->get($rr['uid'], 'windowsphonepush', 'device_url');
// the user on the Windows Phone device and that device url is no longer true for the other user, so we
// et the device_url for the OTHER user blank (should normally not occur as App should include User/server
// in url request to Microsoft Push Notification server)
- $pconfigs = DBA::selectToArray('pconfig', ["`uid` != ? AND `cat` = ? AND `k` = ? AND `v` = ?", local_user(), 'windowsphonepush', 'device_url', $device_url]);
+ $pconfigs = DBA::selectToArray('pconfig', ['uid'], ["`uid` != ? AND `cat` = ? AND `k` = ? AND `v` = ?", local_user(), 'windowsphonepush', 'device_url', $device_url]);
foreach ($pconfigs as $rr) {
DI::pConfig()->set($rr['uid'], 'windowsphonepush', 'device_url', '');
Logger::notice("WARN: the sent URL was already registered with user '" . $rr['uid'] . "'. Deleted for this user as we expect to be correct now for user '" . local_user() . "'.");