diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/locs.php | 6 | ||||
-rw-r--r-- | mod/post.php | 13 |
2 files changed, 7 insertions, 12 deletions
diff --git a/mod/locs.php b/mod/locs.php index b1169fcca..352112e3a 100644 --- a/mod/locs.php +++ b/mod/locs.php @@ -50,8 +50,7 @@ function locs_post(&$a) { notice( t('Primary location cannot be removed.') . EOL); return; } - $r = q("update hubloc set hubloc_flags = (hubloc_flags & %d) where hubloc_id = %d and hubloc_hash = '%s'", - intval(HUBLOC_FLAGS_DELETED), + $r = q("update hubloc set hubloc_deleted = 1 where hubloc_id = %d and hubloc_hash = '%s'", intval($hubloc_id), dbesc($channel['channel_hash']) ); @@ -66,7 +65,6 @@ function locs_post(&$a) { function locs_content(&$a) { - if(! local_user()) { notice( t('Permission denied.') . EOL); return; @@ -86,7 +84,7 @@ function locs_content(&$a) { for($x = 0; $x < count($r); $x ++) { $r[$x]['primary'] = (($r[$x]['hubloc_flags'] & HUBLOC_FLAGS_PRIMARY) ? true : false); - $r[$x]['deleted'] = (($r[$x]['hubloc_flags'] & HUBLOC_FLAGS_DELETED) ? true : false); + $r[$x]['deleted'] = (intval($r[$x]['hubloc_deleted']) ? true : false); } diff --git a/mod/post.php b/mod/post.php index 9e818a7e2..338cd71c0 100644 --- a/mod/post.php +++ b/mod/post.php @@ -666,14 +666,12 @@ function post_post(&$a) { // a dead hub came back to life - reset any tombstones we might have - if($hub['hubloc_status'] & HUBLOC_OFFLINE) { - q("update hubloc set hubloc_status = (hubloc_status & ~%d) where hubloc_id = %d", - intval(HUBLOC_OFFLINE), + if(intval($hub['hubloc_error'])) { + q("update hubloc set hubloc_error = 0 where hubloc_id = %d", intval($hub['hubloc_id']) ); - if($r[0]['hubloc_flags'] & HUBLOC_FLAGS_ORPHANCHECK) { - q("update hubloc set hubloc_flags = (hubloc_flags & ~%d) where hubloc_id = %d", - intval(HUBLOC_FLAGS_ORPHANCHECK), + if(intval($r[0]['hubloc_orphancheck'])) { + q("update hubloc set hubloc_orhpancheck = 0 where hubloc_id = %d", intval($hub['hubloc_id']) ); } @@ -693,8 +691,7 @@ function post_post(&$a) { * */ - q("update hubloc set hubloc_flags = ( hubloc_flags | %d ) where hubloc_url = '%s' and hubloc_sitekey != '%s' ", - intval(HUBLOC_FLAGS_DELETED), + q("update hubloc set hubloc_deleted = 1 where hubloc_url = '%s' and hubloc_sitekey != '%s' ", dbesc($hub['hubloc_url']), dbesc($hub['hubloc_sitekey']) ); |