aboutsummaryrefslogtreecommitdiffstats
path: root/mod/new_channel.php
diff options
context:
space:
mode:
authormrjive <mrjive@mrjive.it>2016-01-03 09:52:37 +0100
committermrjive <mrjive@mrjive.it>2016-01-03 09:52:37 +0100
commit07f5bdde60f55e3b217aee9e33c3175e90a5f0f1 (patch)
tree2b5988c7661c9a5a67f5da8797ca57381e2aad7a /mod/new_channel.php
parent051346325609f5f2e78ef0deaf182c65d7823bbc (diff)
parent5b0a17359d6b5b3e27219c9e56117f1017996175 (diff)
downloadvolse-hubzilla-07f5bdde60f55e3b217aee9e33c3175e90a5f0f1.tar.gz
volse-hubzilla-07f5bdde60f55e3b217aee9e33c3175e90a5f0f1.tar.bz2
volse-hubzilla-07f5bdde60f55e3b217aee9e33c3175e90a5f0f1.zip
Merge pull request #10 from redmatrix/master
updating from original codebase
Diffstat (limited to 'mod/new_channel.php')
-rw-r--r--mod/new_channel.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/mod/new_channel.php b/mod/new_channel.php
index 047048f0a..bec2a3c09 100644
--- a/mod/new_channel.php
+++ b/mod/new_channel.php
@@ -100,6 +100,17 @@ function new_channel_content(&$a) {
return;
}
+ $default_role = '';
+ $aid = get_account_id();
+ if($aid) {
+ $r = q("select count(channel_id) as total from channel where channel_account_id = %d",
+ intval($aid)
+ );
+ if($r && (! intval($r[0]['total']))) {
+ $default_role = get_config('system','default_permissions_role');
+ }
+ }
+
$name = ((x($_REQUEST,'name')) ? $_REQUEST['name'] : "" );
$nickname = ((x($_REQUEST,'nickname')) ? $_REQUEST['nickname'] : "" );
$privacy_role = ((x($_REQUEST,'permissions_role')) ? $_REQUEST['permissions_role'] : "" );
@@ -117,6 +128,7 @@ function new_channel_content(&$a) {
'$name' => $name,
'$help_role' => t('Please choose a channel type (such as social networking or community forum) and privacy requirements so we can select the best permissions for you'),
'$role' => array('permissions_role' , t('Channel Type'), ($privacy_role) ? $privacy_role : 'social', '<a href="help/roles" target="_blank">'.t('Read more about roles').'</a>',get_roles()),
+ '$default_role' => $default_role,
'$nickname' => $nickname,
'$submit' => t('Create')
));