use profile_store_lowlevel() when creating additional profiles

This commit is contained in:
zotlabs 2017-02-09 17:40:56 -08:00
parent abadd0bd34
commit fce33402e7

View File

@ -70,15 +70,16 @@ class Profiles extends \Zotlabs\Web\Controller {
$r1 = q("SELECT fullname, photo, thumb FROM profile WHERE uid = %d AND is_default = 1 LIMIT 1", $r1 = q("SELECT fullname, photo, thumb FROM profile WHERE uid = %d AND is_default = 1 LIMIT 1",
intval(local_channel())); intval(local_channel()));
$r2 = q("INSERT INTO profile (aid, uid , profile_guid, profile_name , fullname, photo, thumb) $r2 = profile_store_lowlevel(
VALUES ( %d, '%s', '%s', '%s', '%s', '%s', '%s' )", [
intval(get_account_id()), 'aid' => intval(get_account_id()),
intval(local_channel()), 'uid' => intval(local_channel()),
dbesc(random_string()), 'profile_guid' => random_string(),
dbesc($name), 'profile_name' => $name,
dbesc($r1[0]['fullname']), 'fullname' => $r1[0]['fullname'],
dbesc($r1[0]['photo']), 'photo' => $r1[0]['photo'],
dbesc($r1[0]['thumb']) 'thumb' => $r1[0]['thumb']
]
); );
$r3 = q("SELECT id FROM profile WHERE uid = %d AND profile_name = '%s' LIMIT 1", $r3 = q("SELECT id FROM profile WHERE uid = %d AND profile_name = '%s' LIMIT 1",