aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Module/Settings/Channel.php9
-rw-r--r--include/follow.php3
-rw-r--r--include/zot.php2
-rwxr-xr-xview/tpl/settings.tpl4
4 files changed, 17 insertions, 1 deletions
diff --git a/Zotlabs/Module/Settings/Channel.php b/Zotlabs/Module/Settings/Channel.php
index 63370a141..db0f79060 100644
--- a/Zotlabs/Module/Settings/Channel.php
+++ b/Zotlabs/Module/Settings/Channel.php
@@ -2,6 +2,8 @@
namespace Zotlabs\Module\Settings;
+require_once('include/selectors.php');
+
class Channel {
@@ -148,7 +150,8 @@ class Channel {
$defpermcat = ((x($_POST,'defpermcat')) ? notags(trim($_POST['defpermcat'])) : 'default');
$cal_first_day = (((x($_POST,'first_day')) && (intval($_POST['first_day']) == 1)) ? 1: 0);
- $mailhost = ((array_key_exists('mailhost',$_POST)) ? notags(trim($_POST['mailhost'])) : '');
+ $mailhost = ((array_key_exists('mailhost',$_POST)) ? notags(trim($_POST['mailhost'])) : '');
+ $profile_assign = ((x($_POST,'profile_assign')) ? notags(trim($_POST['profile_assign'])) : '');
$pageflags = $channel['channel_pageflags'];
@@ -242,6 +245,7 @@ class Channel {
set_pconfig(local_channel(),'system','cal_first_day',$cal_first_day);
set_pconfig(local_channel(),'system','default_permcat',$defpermcat);
set_pconfig(local_channel(),'system','email_notify_host',$mailhost);
+ set_pconfig(local_channel(),'system','profile_assign',$profile_assign);
$r = q("update channel set channel_name = '%s', channel_pageflags = %d, channel_timezone = '%s', channel_location = '%s', channel_notifyflags = %d, channel_max_anon_mail = %d, channel_max_friend_req = %d, channel_expire_days = %d $set_perms where channel_id = %d",
dbesc($username),
@@ -515,6 +519,9 @@ class Channel {
'$permissions' => t('Default Privacy Group'),
'$permdesc' => t("\x28click to open/close\x29"),
'$aclselect' => populate_acl($perm_defaults, false, \Zotlabs\Lib\PermissionDescription::fromDescription(t('Use my default audience setting for the type of object published'))),
+ '$profseltxt' => t('Profile to assign new connections'),
+ '$profselect' => ((feature_enabled(local_channel(),'multi_profiles')) ? contact_profile_assign(get_pconfig(local_channel(),'system','profile_assign','')) : ''),
+
'$allow_cid' => acl2json($perm_defaults['allow_cid']),
'$allow_gid' => acl2json($perm_defaults['allow_gid']),
'$deny_cid' => acl2json($perm_defaults['deny_cid']),
diff --git a/include/follow.php b/include/follow.php
index 56d8294c5..0843802c5 100644
--- a/include/follow.php
+++ b/include/follow.php
@@ -226,6 +226,8 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
}
+ $profile_assign = get_pconfig($uid,'system','profile_assign','');
+
$r = q("select abook_id, abook_xchan, abook_pending, abook_instance from abook
where abook_xchan = '%s' and abook_channel = %d limit 1",
@@ -265,6 +267,7 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
'abook_channel' => intval($uid),
'abook_closeness' => intval($closeness),
'abook_xchan' => $xchan_hash,
+ 'abook_profile' => $profile_assign,
'abook_feed' => intval(($xchan['xchan_network'] === 'rss') ? 1 : 0),
'abook_created' => datetime_convert(),
'abook_updated' => datetime_convert(),
diff --git a/include/zot.php b/include/zot.php
index 40e303bf1..d60494d94 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -394,6 +394,7 @@ function zot_refresh($them, $channel = null, $force = false) {
$next_birthday = NULL_DATE;
}
+ $profile_assign = get_pconfig($channel['channel_id'],'system','profile_assign','');
// Keep original perms to check if we need to notify them
$previous_perms = get_all_perms($channel['channel_id'],$x['hash']);
@@ -455,6 +456,7 @@ function zot_refresh($them, $channel = null, $force = false) {
'abook_channel' => intval($channel['channel_id']),
'abook_closeness' => intval($closeness),
'abook_xchan' => $x['hash'],
+ 'abook_profile' => $profile_assign,
'abook_created' => datetime_convert(),
'abook_updated' => datetime_convert(),
'abook_dob' => $next_birthday,
diff --git a/view/tpl/settings.tpl b/view/tpl/settings.tpl
index 33e0aa925..0f42a6e8a 100755
--- a/view/tpl/settings.tpl
+++ b/view/tpl/settings.tpl
@@ -167,6 +167,10 @@
</div>
<div id="miscellaneous-settings-collapse" class="collapse" role="tabpanel" aria-labelledby="miscellaneous-settings">
<div class="section-content-tools-wrapper">
+ {{if $profselect}}
+ <label for="contact-profile-selector">{{$profseltxt}}</label>
+ {{$profselect}}
+ {{/if}}
{{if $menus}}
<div class="form-group channel-menu">
<label for="channel_menu">{{$menu_desc}}</label>