aboutsummaryrefslogtreecommitdiffstats
path: root/include/security.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/security.php')
-rw-r--r--include/security.php17
1 files changed, 13 insertions, 4 deletions
diff --git a/include/security.php b/include/security.php
index 8b7e7d076..88988a7c0 100644
--- a/include/security.php
+++ b/include/security.php
@@ -118,10 +118,10 @@ function atoken_xchan($atoken) {
'xchan_network' => 'unknown',
'xchan_url' => z_root() . '/guest/' . substr($c['channel_hash'],0,16) . '.' . $atoken['atoken_name'],
'xchan_hidden' => 1,
- 'xchan_photo_mimetype' => 'image/jpeg',
- 'xchan_photo_l' => get_default_profile_photo(300),
- 'xchan_photo_m' => get_default_profile_photo(80),
- 'xchan_photo_s' => get_default_profile_photo(48)
+ 'xchan_photo_mimetype' => 'image/png',
+ 'xchan_photo_l' => z_root() . '/' . get_default_profile_photo(300),
+ 'xchan_photo_m' => z_root() . '/' . get_default_profile_photo(80),
+ 'xchan_photo_s' => z_root() . '/' . get_default_profile_photo(48)
];
}
@@ -266,6 +266,15 @@ function change_channel($change_channel) {
$_SESSION['mobile_theme'] = get_pconfig(local_channel(),'system', 'mobile_theme');
$_SESSION['cloud_tiles'] = get_pconfig(local_channel(),'system', 'cloud_tiles');
date_default_timezone_set($r[0]['channel_timezone']);
+
+ // Update the active timestamp at most once a day
+
+ if(substr($r[0]['channel_active'],0,10) !== substr(datetime_convert(),0,10)) {
+ $z = q("UPDATE channel SET channel_active = '%s' WHERE channel_id = %d",
+ dbesc(datetime_convert()),
+ intval($r[0]['channel_id'])
+ );
+ }
$ret = $r[0];
}
$x = q("select * from xchan where xchan_hash = '%s' limit 1",