Skip to content

Commit 3e1206f

Browse files
committed
Merge branch 'reviewApiKeyTokenErrorMessageFor330' into 'stable-3_3_0'
Changes credential encryption configuration text to make it clearer. See merge request softwares-pkp/plugins_ojs/OASwitchboard!50
2 parents 4ea0614 + 9ab6733 commit 3e1206f

File tree

9 files changed

+37
-21
lines changed

9 files changed

+37
-21
lines changed

OASwitchboardPlugin.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function register($category, $path, $mainContextId = null)
2626
$message = new Message($this);
2727
$resources = new Resources($this);
2828
HookRegistry::register('Publication::publish', [$message, 'sendToOASwitchboard']);
29-
HookRegistry::register('Form::config::before', [$message, 'validateRegister']);
29+
HookRegistry::register('Form::config::before', [$message, 'validateBeforePublicationEvent']);
3030
HookRegistry::register('TemplateManager::display', [$resources, 'addWorkflowNotificationsJavaScript']);
3131
HookRegistry::register('NotificationManager::getNotificationMessage', [$resources, 'addMessageToInformationNotification']);
3232
}

classes/Message.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function sendToOASwitchboard($hookName, $args)
3434
}
3535
}
3636

37-
public function validateRegister($hookName, $form)
37+
public function validateBeforePublicationEvent($hookName, $form)
3838
{
3939
if ($form->id !== 'publish' || !empty($form->errors)) {
4040
return;

classes/settings/OASwitchboardSettingsForm.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function __construct($plugin, $contextId)
1616
$this->contextId = $contextId;
1717
$this->addFormValidators();
1818

19-
$template = APIKeyEncryption::secretConfigExists() ? 'settingsForm.tpl' : 'tokenError.tpl';
19+
$template = APIKeyEncryption::secretConfigExists() ? 'settingsForm.tpl' : 'missingSecretConfigWarning.tpl';
2020
parent::__construct($plugin->getTemplateResource($template));
2121
}
2222

locale/en_US/locale.po

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
msgid "plugins.generic.OASwitchboard.displayName"
22
msgstr "OA Switchboard Plugin"
33

4-
msgid "plugins.generic.OASwitchboard.settings.apiKeyIsEmpty"
5-
msgstr "Your site administrator must set a secret in the config file ('api_key_secret')."
4+
msgid "plugins.generic.OASwitchboard.settings.apiKeySecretMissing"
5+
msgstr "Your OJS is missing a security setting ('api_key_secret'). You may contact your system administrator to set it up in the config file."
6+
7+
msgid "plugins.generic.OASwitchboard.settings.apiKeySecretInfomration"
8+
msgstr ""
9+
"The 'api_key_secret' is use to safely store your OA Switchboard credentials.<br>More information on how to set it up can be found in <a href=\"https://forum.pkp.sfu.ca/t/how-to-generate-a-api-key-secret-code-in-ojs-3/72008/\" target=\"_blank\">this PKP Community Forum thread</a>."
10+
"<br><br>Once it's set up, come back here to enter your credentials."
611

712
msgid "plugins.generic.OASwitchboard.settings.issnMissing"
813
msgstr "Until an ISSN or eISSN is assigned to the journal, the OA Switchboard plugin will not be able to send messages."

locale/es_ES/locale.po

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
msgid "plugins.generic.OASwitchboard.displayName"
22
msgstr "Módulo de OA Switchboard"
33

4-
msgid "plugins.generic.OASwitchboard.settings.apiKeyIsEmpty"
5-
msgstr "El administrador de su sitio debe establecer un secreto en el archivo de configuración ('api_key_secret')."
4+
msgid "plugins.generic.OASwitchboard.settings.apiKeySecretMissing"
5+
msgstr "A su OJS le falta una configuración de seguridad ('api_key_secret'). Puede ponerse en contacto con su administrador del sistema para configurarlo en el archivo de configuración."
6+
7+
msgid "plugins.generic.OASwitchboard.settings.apiKeySecretInfomration"
8+
msgstr ""
9+
"El 'api_key_secret' se utiliza para almacenar de forma segura sus credenciales de OA Switchboard.<br>Más información sobre cómo configurarlo se puede encontrar en este <a href=\"https://forum.pkp.sfu.ca/t/how-to-generate-a-api-key-secret-code-in-ojs-3/72008/\" target=\"_blank\">tema del Foro de la Comunidad PKP</a>."
10+
"<br><br>Una vez configurado, vuelva aquí para introducir sus credenciales."
611

712
msgid "plugins.generic.OASwitchboard.settings.issnMissing"
813
msgstr "Hasta que se asigne un ISSN o eISSN a la revista, el módulo de OA Switchboard no podrá enviar mensajes."

locale/pt_BR/locale.po

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
msgid "plugins.generic.OASwitchboard.displayName"
22
msgstr "Plugin OA Switchboard"
33

4-
msgid "plugins.generic.OASwitchboard.settings.apiKeyIsEmpty"
5-
msgstr "O administrador do seu site deve definir um segredo no arquivo de configuração ('api_key_secret')."
4+
msgid "plugins.generic.OASwitchboard.settings.apiKeySecretMissing"
5+
msgstr "Seu OJS está sem uma configuração de segurança ('api_key_secret'). Você pode contactar o administrador do sistema para defini-la no arquivo de configuração."
6+
7+
msgid "plugins.generic.OASwitchboard.settings.apiKeySecretInfomration"
8+
msgstr "A configuração api_key_secret é usada para armazenar suas credenciais do OA Switchboard com segurança. Mais informações sobre como configurá-la podem ser encontradas <a href=\"https://forum.pkp.sfu.ca/t/how-to-generate-a-api-key-secret-code-in-ojs-3/72008/\" target=\"_blank\">neste tópico do Fórum da Comunidade PKP</a>."
69

710
msgid "plugins.generic.OASwitchboard.settings.issnMissing"
811
msgstr "Até que um ISSN ou eISSN seja atribuído à revista, o plugin OA Switchboard não poderá enviar mensagens."
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{**
2+
* templates/tokenError.tpl
3+
*
4+
* Copyright (c) 2024 Lepidus Tecnologia
5+
* Distributed under the GNU GPL v3. For full terms see the file LICENSE.
6+
*
7+
*}
8+
<div id="OASwitchboardApiKeyError">
9+
<div class="pkpNotification pkpNotification--warning">
10+
<p>{translate key="plugins.generic.OASwitchboard.settings.apiKeySecretMissing"}</p>
11+
<p>{translate key="plugins.generic.OASwitchboard.settings.apiKeySecretInfomration"}</p>
12+
</div>
13+
</div>

templates/tokenError.tpl

Lines changed: 0 additions & 10 deletions
This file was deleted.

version.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<version>
1313
<application>OASwitchboard</application>
1414
<type>plugins.generic</type>
15-
<release>1.1.1.7</release>
16-
<date>2024-10-30</date>
15+
<release>1.1.1.8</release>
16+
<date>2024-11-04</date>
1717
<lazy-load>1</lazy-load>
1818
<class>OASwitchboardPlugin</class>
1919
</version>

0 commit comments

Comments
 (0)