From d2c11925bfafa5a2842267cd90616aa7e1f4882b Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Wed, 17 Feb 2016 23:05:44 +0100 Subject: [PATCH] To-selector padlock only shown if site config notice/allowprivate is true --- lib/default.php | 1 + lib/toselector.php | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/default.php b/lib/default.php index 79480483ce..3518bb4cb9 100644 --- a/lib/default.php +++ b/lib/default.php @@ -291,6 +291,7 @@ $default = ), 'notice' => array('contentlimit' => null, + 'allowprivate' => false, // whether to allow users to "check the padlock" to publish notices available for their subscribers. 'defaultscope' => null, // null means 1 if site/private, 0 otherwise 'hidespam' => true), // Whether to hide silenced users from timelines 'message' => diff --git a/lib/toselector.php b/lib/toselector.php index 153d9001b5..aed38e1cf6 100644 --- a/lib/toselector.php +++ b/lib/toselector.php @@ -127,10 +127,12 @@ class ToSelector extends Widget $default); $this->out->elementStart('span', 'checkbox-wrapper'); - $this->out->checkbox('notice_private', - // TRANS: Checkbox label in widget for selecting potential addressees to mark the notice private. - _('Private?'), - $this->private); + if (common_config('notice', 'allowprivate')) { + $this->out->checkbox('notice_private', + // TRANS: Checkbox label in widget for selecting potential addressees to mark the notice private. + _('Private?'), + $this->private); + } $this->out->elementEnd('span'); } @@ -138,7 +140,7 @@ class ToSelector extends Widget { // XXX: make arg name selectable $toArg = $action->trimmed('notice_to'); - $private = $action->boolean('notice_private'); + $private = common_config('notice', 'allowprivate') ? $action->boolean('notice_private') : false; if (empty($toArg)) { return;