diff options
author | Thomas Bruederli <thomas@roundcube.net> | 2013-09-19 17:56:14 +0200 |
---|---|---|
committer | Thomas Bruederli <thomas@roundcube.net> | 2013-09-19 17:56:14 +0200 |
commit | 9c41ba3c9ebbb14d01abe961c420f71f9463e61a (patch) | |
tree | 43c2d4c12bbb24a05c7edea7a91f0e01c375c543 /program/steps/settings/responses.inc | |
parent | cc041fe11c1997902f68f4ca8e95577e963a0053 (diff) |
Allow sysadmins to define static responses which are immutable for the user
Diffstat (limited to 'program/steps/settings/responses.inc')
-rw-r--r-- | program/steps/settings/responses.inc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/program/steps/settings/responses.inc b/program/steps/settings/responses.inc index 330b4fde4..cfc4148c3 100644 --- a/program/steps/settings/responses.inc +++ b/program/steps/settings/responses.inc @@ -26,7 +26,7 @@ if (!empty($_POST['_insert'])) { if (!empty($name) && !empty($text)) { $dupes = 0; - $responses = $RCMAIL->get_compose_responses(); + $responses = $RCMAIL->get_compose_responses(false, true); foreach ($responses as $resp) { if (strcasecmp($name, preg_replace('/\s\(\d+\)$/', '', $resp['name'])) == 0) $dupes++; @@ -54,7 +54,7 @@ if (!empty($_POST['_insert'])) { if ($RCMAIL->action == 'delete-response') { if ($key = get_input_value('_key', RCUBE_INPUT_GPC)) { - $responses = $RCMAIL->get_compose_responses(); + $responses = $RCMAIL->get_compose_responses(false, true); foreach ($responses as $i => $response) { if (empty($response['key'])) $response['key'] = substr(md5($response['name']), 0, 16); @@ -67,7 +67,7 @@ if ($RCMAIL->action == 'delete-response') { } if ($deleted) { - $RCMAIL->output->command('display_message', rcube_label('successfullydeleted'), 'confirmation'); + $RCMAIL->output->command('display_message', rcube_label('deletedsuccessfully'), 'confirmation'); $RCMAIL->output->command('remove_response', $key); } @@ -99,6 +99,8 @@ function rcmail_responses_list($attrib) // set client env $OUTPUT->add_gui_object('responseslist', $attrib['id']); + $OUTPUT->set_env('readonly_responses', array_values(array_map(function($rec){ return $rec['key']; }, + array_filter($plugin['list'], function($item){ return !empty($item['static']); })))); return $out; } |