aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-06-22 20:46:44 -0700
committerredmatrix <git@macgirvin.com>2016-06-22 20:46:44 -0700
commitb8c5a91940f75e79b1cd7e7e2148e4acd0ff7d83 (patch)
tree9934e0a7cd34669b778b6aee53d87a572ce6d0cc /Zotlabs
parent515b054a6e6e5030b66753147cff424e0f37bab8 (diff)
downloadvolse-hubzilla-b8c5a91940f75e79b1cd7e7e2148e4acd0ff7d83.tar.gz
volse-hubzilla-b8c5a91940f75e79b1cd7e7e2148e4acd0ff7d83.tar.bz2
volse-hubzilla-b8c5a91940f75e79b1cd7e7e2148e4acd0ff7d83.zip
set profile when "use existing photo"
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Profile_photo.php18
1 files changed, 14 insertions, 4 deletions
diff --git a/Zotlabs/Module/Profile_photo.php b/Zotlabs/Module/Profile_photo.php
index d1ce9f428..c02821a3c 100644
--- a/Zotlabs/Module/Profile_photo.php
+++ b/Zotlabs/Module/Profile_photo.php
@@ -70,6 +70,8 @@ class Profile_photo extends \Zotlabs\Web\Controller {
}
}
+
+logger('profile: ' . $_REQUEST['profile']);
// phase 2 - we have finished cropping
@@ -268,11 +270,19 @@ class Profile_photo extends \Zotlabs\Web\Controller {
notice( t('Permission denied.') . EOL );
return;
};
-
- // check_form_security_token_redirectOnErr('/profile_photo', 'profile_photo');
-
+
$resource_id = argv(2);
+ // When using an existing photo, we don't have a dialogue to offer a choice of profiles,
+ // so it gets attached to the default
+
+ $p = q("select id from profile where is_default = 1 and uid = %d",
+ intval(local_channel())
+ );
+ if($p) {
+ $_REQUEST['profile'] = $p[0]['id'];
+ }
+
$r = q("SELECT id, album, imgscale FROM photo WHERE uid = %d AND resource_id = '%s' ORDER BY imgscale ASC",
intval(local_channel()),
@@ -309,7 +319,7 @@ class Profile_photo extends \Zotlabs\Web\Controller {
dbesc($channel['xchan_hash'])
);
- profile_photo_set_profile_perms(); //Reset default photo permissions to public
+ profile_photo_set_profile_perms(); // Reset default photo permissions to public
\Zotlabs\Daemon\Master::Summon(array('Directory',local_channel()));
goaway(z_root() . '/profiles');
}