return;
}
- $g = q("SELECT `def_gid` FROM `user` WHERE `uid` = %d LIMIT 1",
- intval($importer["uid"])
- );
+ $def_gid = get_default_group($importer['uid'], $ret["network"]);
- if($g && intval($g[0]["def_gid"]))
- group_add_member($importer["uid"], "", $contact_record["id"], $g[0]["def_gid"]);
+ if(intval($def_gid))
+ group_add_member($importer["uid"], "", $contact_record["id"], $def_gid);
if($importer["page-flags"] == PAGE_NORMAL) {
<?php
require_once("include/Scrape.php");
require_once("include/socgraph.php");
+require_once('include/group.php');
function update_contact($id) {
/*
$result['cid'] = $contact_id;
$def_gid = get_default_group($uid, $contact["network"]);
- if (intval($def_gid)) {
- require_once('include/group.php');
+ if (intval($def_gid))
group_add_member($uid, '', $contact_id, $def_gid);
- }
require_once("include/Photo.php");
require_once('mod/share.php');
require_once('include/enotify.php');
require_once('include/dfrn.php');
+require_once('include/group.php');
require_once('library/defuse/php-encryption-1.2.1/Crypto.php');
dbesc(($sharing) ? NETWORK_ZOT : NETWORK_OSTATUS),
intval(($sharing) ? CONTACT_IS_SHARING : CONTACT_IS_FOLLOWER)
);
- $r = q("SELECT `id` FROM `contact` WHERE `uid` = %d AND `url` = '%s' AND `pending` = 1 LIMIT 1",
+ $r = q("SELECT `id`, `network` FROM `contact` WHERE `uid` = %d AND `url` = '%s' AND `pending` = 1 LIMIT 1",
intval($importer['uid']),
dbesc($url)
);
);
}
- if(intval($r[0]['def_gid'])) {
- require_once('include/group.php');
- group_add_member($r[0]['uid'],'',$contact_record['id'],$r[0]['def_gid']);
- }
+ $def_gid = get_default_group($importer['uid'], $contact_record["network"]);
+
+ if(intval($def_gid))
+ group_add_member($importer['uid'],'',$contact_record['id'],$def_gid);
if(($r[0]['notify-flags'] & NOTIFY_INTRO) &&
in_array($r[0]['page-flags'], array(PAGE_NORMAL))) {
// returns an array of contact-ids that are allowed to see this object
function enumerate_permissions($obj) {
- require_once('include/group.php');
$allow_people = expand_acl($obj['allow_cid']);
$allow_groups = expand_groups(expand_acl($obj['allow_gid']));
$deny_people = expand_acl($obj['deny_cid']);
*/
require_once('include/enotify.php');
+require_once('include/group.php');
function dfrn_confirm_post(&$a,$handsfree = null) {
}
$def_gid = get_default_group($uid, $contact["network"]);
- if($contact && intval($def_gid)) {
- require_once('include/group.php');
+ if($contact && intval($def_gid))
group_add_member($uid, '', $contact['id'], $def_gid);
- }
// Let's send our user to the contact editor in case they want to
// do anything special with this new friend.
require_once('include/enotify.php');
require_once('include/Scrape.php');
+require_once('include/group.php');
if(! function_exists('dfrn_request_init')) {
function dfrn_request_init(&$a) {
);
if(count($r)) {
$def_gid = get_default_group(local_user(), $r[0]["network"]);
- if(intval($def_gid)) {
- require_once('include/group.php');
+ if(intval($def_gid))
group_add_member(local_user(), '', $r[0]['id'], $def_gid);
- }
+
$forwardurl = $a->get_baseurl()."/contacts/".$r[0]['id'];
} else
$forwardurl = $a->get_baseurl()."/contacts";
$contact_id = $r[0]['id'];
$def_gid = get_default_group($uid, $r[0]["network"]);
- if (intval($def_gid)) {
- require_once('include/group.php');
+ if (intval($def_gid))
group_add_member($uid, '', $contact_id, $def_gid);
- }
$photo = avatar_img($addr);