X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=testdrive%2Ftestdrive.php;h=eff149d323ff8dbf21169f928a79b6baee7a6fa7;hb=4bee797f9e0b8b53ae5ab7763a7d3d8151cc6a61;hp=b7c021a102c775393cd63cd1b82a775a6f2c4668;hpb=d679a38e9efabb2213c294e8537e020d987cc3fe;p=friendica-addons.git diff --git a/testdrive/testdrive.php b/testdrive/testdrive.php index b7c021a1..eff149d3 100644 --- a/testdrive/testdrive.php +++ b/testdrive/testdrive.php @@ -14,6 +14,9 @@ function testdrive_install() { register_hook('register_account', 'addon/testdrive/testdrive.php', 'testdrive_register_account'); register_hook('cron', 'addon/testdrive/testdrive.php', 'testdrive_cron'); + register_hook('enotify','addon/testdrive/testdrive.php', 'testdrive_enotify'); + register_hook('globaldir_update','addon/testdrive/testdrive.php', 'testdrive_globaldir_update'); + } @@ -21,7 +24,13 @@ function testdrive_uninstall() { unregister_hook('register_account', 'addon/testdrive/testdrive.php', 'testdrive_register_account'); unregister_hook('cron', 'addon/testdrive/testdrive.php', 'testdrive_cron'); + unregister_hook('enotify','addon/testdrive/testdrive.php', 'testdrive_enotify'); + unregister_hook('globaldir_update','addon/testdrive/testdrive.php', 'testdrive_globaldir_update'); + +} +function testdrive_globaldir_update($a,&$b) { + $b['url'] = ''; } function testdrive_register_account($a,$b) { @@ -32,13 +41,13 @@ function testdrive_register_account($a,$b) { if(! $days) return; - $r = q("UPDATE user set account_expires_on = '%s' where uid = %d limit 1", + $r = q("UPDATE user set account_expires_on = '%s' where uid = %d", dbesc(datetime_convert('UTC','UTC','now +' . $days . ' days')), intval($uid) ); }; - + function testdrive_cron($a,$b) { require_once('include/enotify.php'); @@ -60,11 +69,11 @@ function testdrive_cron($a,$b) { 'source_photo' => $a->get_baseurl() . '/images/person-80.jpg', )); - q("update user set expire_notification_sent = '%s' where uid = %d limit 1", + q("update user set expire_notification_sent = '%s' where uid = %d", dbesc(datetime_convert()), intval($rr['uid']) ); - + } }