aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-06-07 23:04:46 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-06-07 23:04:46 -0700
commit5b482c1daf1774b185df1e165d04df3de21fb730 (patch)
treeb7d4838976a103d0222534de8502bbd1e098bba3 /mod
parent10e88a3e45457e8d1f76f8ab2a989ffcb67e1883 (diff)
downloadvolse-hubzilla-5b482c1daf1774b185df1e165d04df3de21fb730.tar.gz
volse-hubzilla-5b482c1daf1774b185df1e165d04df3de21fb730.tar.bz2
volse-hubzilla-5b482c1daf1774b185df1e165d04df3de21fb730.zip
magic auth issues on dreamhost
Diffstat (limited to 'mod')
-rw-r--r--mod/magic.php2
-rw-r--r--mod/post.php7
2 files changed, 6 insertions, 3 deletions
diff --git a/mod/magic.php b/mod/magic.php
index df8ac39a8..2fee87241 100644
--- a/mod/magic.php
+++ b/mod/magic.php
@@ -133,7 +133,6 @@ function magic_init(&$a) {
$channel['token'] = $token;
$channel['token_sig'] = $token_sig;
-
$r = q("insert into verify ( type, channel, token, meta, created) values ('%s','%d','%s','%s','%s')",
dbesc('auth'),
intval($channel['channel_id']),
@@ -141,7 +140,6 @@ function magic_init(&$a) {
dbesc($x[0]['hubloc_url']),
dbesc(datetime_convert())
);
-
$target_url = $x[0]['hubloc_callback'] . '/?f=&auth=' . urlencode($channel['channel_address'] . '@' . $a->get_hostname())
. '&sec=' . $token . '&dest=' . urlencode($dest) . '&version=' . ZOT_REVISION;
diff --git a/mod/post.php b/mod/post.php
index 95931a3f0..908b9eb1d 100644
--- a/mod/post.php
+++ b/mod/post.php
@@ -757,8 +757,13 @@ function post_post(&$a) {
$sender_hash = make_xchan_hash($arr['guid'],$arr['guid_sig']);
// garbage collect any old unused notifications
+
+ // This was and should be 10 minutes but my hosting provider has time lag between the DB and
+ // the web server. We should probably convert this to webserver time rather than DB time so
+ // that the different clocks won't affect it and allow us to keep the time short.
+
q("delete from verify where type = 'auth' and created < %s - INTERVAL %s",
- db_utcnow(), db_quoteinterval('10 MINUTE')
+ db_utcnow(), db_quoteinterval('30 MINUTE')
);
$y = q("select xchan_pubkey from xchan where xchan_hash = '%s' limit 1",