aboutsummaryrefslogtreecommitdiffstats
path: root/mod/photo.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/photo.php')
-rw-r--r--mod/photo.php19
1 files changed, 8 insertions, 11 deletions
diff --git a/mod/photo.php b/mod/photo.php
index 66280cb76..e8cd95f1c 100644
--- a/mod/photo.php
+++ b/mod/photo.php
@@ -22,14 +22,6 @@ function photo_init(&$a) {
// NOTREACHED
}
- if($photo === 'qr') {
- $t = $_GET['qr'];
- require_once('library/phpqrcode/phpqrcode.php');
- header("Content-type: image/png");
- QRcode::png(($t) ? $t : '.');
- killme();
- }
-
$observer_xchan = get_observer_hash();
$default = get_default_profile_photo();
@@ -61,14 +53,17 @@ function photo_init(&$a) {
$uid = $person;
- $r = q("SELECT * FROM photo WHERE scale = %d AND uid = %d AND profile = 1 LIMIT 1",
+ $r = q("SELECT * FROM photo WHERE scale = %d AND uid = %d AND photo_usage = %d LIMIT 1",
intval($resolution),
- intval($uid)
+ intval($uid),
+ intval(PHOTO_PROFILE)
);
if(count($r)) {
$data = dbunescbin($r[0]['data']);
$mimetype = $r[0]['type'];
}
+ if(intval($r[0]['os_storage']))
+ $data = file_get_contents($data);
if(! isset($data)) {
$data = file_get_contents($default);
$mimetype = 'image/png';
@@ -128,7 +123,7 @@ function photo_init(&$a) {
);
if($r) {
- $allowed = (($r[0]['uid']) ? perm_is_allowed($r[0]['uid'],$observer_xchan,'view_photos') : true);
+ $allowed = (($r[0]['uid']) ? perm_is_allowed($r[0]['uid'],$observer_xchan,'view_storage') : true);
$sql_extra = permissions_sql($r[0]['uid']);
@@ -142,6 +137,8 @@ function photo_init(&$a) {
if($r && $allowed) {
$data = dbunescbin($r[0]['data']);
$mimetype = $r[0]['type'];
+ if(intval($r[0]['os_storage']))
+ $data = file_get_contents($data);
}
else {