X-Git-Url: https://git.mxchange.org/?p=friendica-addons.git;a=blobdiff_plain;f=testdrive%2Ftestdrive.php;h=4398ffbf9cb98575f32115fc62ec871bc80b5a14;hp=5c3930cd35188167186d1b21fc185c18debf210e;hb=39dd3dffe07efd69fa1ac6d0bd243c7fc0e3a66f;hpb=1900da6c421a939b9a98994e974f2ab01d6ded74 diff --git a/testdrive/testdrive.php b/testdrive/testdrive.php index 5c3930cd..4398ffbf 100644 --- a/testdrive/testdrive.php +++ b/testdrive/testdrive.php @@ -39,7 +39,7 @@ function testdrive_register_account($a,$b) { $uid = $b; - $days = Config::get('testdrive','expiredays'); + $days = get_config('testdrive','expiredays'); if(! $days) return; @@ -59,7 +59,7 @@ function testdrive_cron($a,$b) { if(count($r)) { foreach($r as $rr) { - notification([ + notification(array( 'uid' => $rr['uid'], 'type' => NOTIFY_SYSTEM, 'system_type' => 'testdrive_expire', @@ -69,7 +69,7 @@ function testdrive_cron($a,$b) { 'source_name' => L10n::t('Administrator'), 'source_link' => $a->get_baseurl(), 'source_photo' => $a->get_baseurl() . '/images/person-80.jpg', - ]); + )); q("update user set expire_notification_sent = '%s' where uid = %d", dbesc(DateTimeFormat::utcNow()), @@ -81,10 +81,12 @@ function testdrive_cron($a,$b) { $r = q("select * from user where account_expired = 1 and account_expires_on < UTC_TIMESTAMP() - INTERVAL 5 DAY "); if(count($r)) { - foreach($r as $rr) { - User::remove($rr['uid']); - } + require_once('include/Contact.php'); + foreach($r as $rr) + user_remove($rr['uid']); + } + } function testdrive_enotify(&$a, &$b) {