From 8afd448def5b075272d9db0a9b29f54d31c23651 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 14 Sep 2020 15:05:35 +0200 Subject: [PATCH] Add warning if a hidden option is on to encourage to remove it. --- htdocs/core/lib/functions.lib.php | 4 ++-- htdocs/langs/en_US/errors.lang | 3 ++- htdocs/stripe/admin/stripe.php | 7 ++++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8fb8ec3be57..22f1990799b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3036,7 +3036,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp', 'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', 'commercial', 'companies', 'generic', 'home', 'hrm', 'members', 'products', 'invoicing', - 'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'supplier_invoice', 'ticket', + 'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'refresh', 'supplier_invoice', 'ticket', 'error', 'warning', 'recruitmentcandidature', 'recruitmentjobposition', 'supplier_proposal', 'supplier_order', 'supplier_invoice', @@ -3077,7 +3077,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge', 'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature', 'payment'=>'money-check-alt', 'phoning'=>'phone', 'phoning_mobile'=>'mobile-alt', 'phoning_fax'=>'fax', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell', - 'resource'=>'laptop-house', + 'refresh'=>'redo', 'resource'=>'laptop-house', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'supplier_invoice'=>'file-invoice-dollar', 'technic'=>'cogs', 'ticket'=>'ticket-alt', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt', diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 13a4581fc38..dfb6a9b83ca 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -269,4 +269,5 @@ WarningNumberOfRecipientIsRestrictedInMassAction=Warning, number of different re WarningDateOfLineMustBeInExpenseReportRange=Warning, the date of line is not in the range of the expense report WarningProjectClosed=Project is closed. You must re-open it first. WarningSomeBankTransactionByChequeWereRemovedAfter=Some bank transaction were removed after that the receipt including them were generated. So nb of cheques and total of receipt may differ from number and total in list. -WarningFailedToAddFileIntoDatabaseIndex=Warnin, failed to add file entry into ECM database index table \ No newline at end of file +WarningFailedToAddFileIntoDatabaseIndex=Warning, failed to add file entry into ECM database index table +WarningTheHiddenOptionIsOn=Warning, the hidden option %s is on. \ No newline at end of file diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index 693f02b480c..e00047be775 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -441,8 +441,13 @@ print ''; print ''; print $langs->trans("SecurityToken").''; print ''; -if (!empty($conf->use_javascript_ajax)) +if (!empty($conf->use_javascript_ajax)) { print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"'); +} +if (! empty($conf->global->PAYMENT_SECURITY_ACCEPT_ANY_TOKEN)) { + $langs->load("errors"); + print img_warning($langs->trans("WarningTheHiddenOptionIsOn", PAYMENT_SECURITY_ACCEPT_ANY_TOKEN), '', 'pictowarning marginleftonly'); +} print ''; print '';