aboutsummaryrefslogtreecommitdiffstats
path: root/mod/new_channel.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/new_channel.php')
-rw-r--r--mod/new_channel.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/mod/new_channel.php b/mod/new_channel.php
index bec2a3c09..630984bf2 100644
--- a/mod/new_channel.php
+++ b/mod/new_channel.php
@@ -64,7 +64,14 @@ function new_channel_post(&$a) {
$arr = $_POST;
- if(($arr['account_id'] = get_account_id()) === false) {
+ $acc = $a->get_account();
+ $arr['account_id'] = get_account_id();
+
+ // prevent execution by delegated channels as well as those not logged in.
+ // get_account_id() returns the account_id from the session. But $a->account
+ // may point to the original authenticated account.
+
+ if((! $acc) || ($acc['account_id'] != $arr['account_id'])) {
notice( t('Permission denied.') . EOL );
return;
}
@@ -95,7 +102,10 @@ function new_channel_post(&$a) {
function new_channel_content(&$a) {
- if(! get_account_id()) {
+
+ $acc = $a->get_account();
+
+ if((! $acc) || $acc['account_id'] != get_account_id()) {
notice( t('Permission denied.') . EOL);
return;
}
@@ -123,6 +133,7 @@ function new_channel_content(&$a) {
'$label_name' => t('Channel Name'),
'$help_name' => t('Examples: "Bob Jameson", "Lisa and her Horses", "Soccer", "Aviation Group" '),
'$label_nick' => t('Choose a short nickname'),
+ '$nick_hub' => '@' . str_replace(array('http://','https://','/'), '', get_config('system','baseurl')),
'$nick_desc' => t('Your nickname will be used to create an easily remembered channel address (like an email address) which you can share with others.'),
'$label_import' => t('Or <a href="import">import an existing channel</a> from another location'),
'$name' => $name,