From dbcd09033d4b4948f01918ad9d3c163756e92e4b Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 30 Jan 2016 22:25:36 -0500 Subject: [PATCH 01/10] OCA Transbot updated translations from Transifex --- auth_admin_passkey/i18n/de.po | 25 ++++++----- auth_admin_passkey/i18n/es.po | 15 ++++--- auth_admin_passkey/i18n/fi.po | 84 ++++++++++++++++++++++++++++++++++ auth_admin_passkey/i18n/it.po | 85 +++++++++++++++++++++++++++++++++++ auth_admin_passkey/i18n/tr.po | 85 +++++++++++++++++++++++++++++++++++ 5 files changed, 275 insertions(+), 19 deletions(-) create mode 100644 auth_admin_passkey/i18n/fi.po create mode 100644 auth_admin_passkey/i18n/it.po create mode 100644 auth_admin_passkey/i18n/tr.po diff --git a/auth_admin_passkey/i18n/de.po b/auth_admin_passkey/i18n/de.po index 9c0fbe653..30159c73a 100644 --- a/auth_admin_passkey/i18n/de.po +++ b/auth_admin_passkey/i18n/de.po @@ -3,13 +3,14 @@ # * auth_admin_passkey # # Translators: +# Rudolf Schnapka , 2016 msgid "" msgstr "" "Project-Id-Version: server-tools (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-29 11:14+0000\n" -"PO-Revision-Date: 2015-09-18 13:53+0000\n" -"Last-Translator: <>\n" +"POT-Creation-Date: 2016-01-19 14:44+0000\n" +"PO-Revision-Date: 2016-01-26 10:39+0000\n" +"Last-Translator: Rudolf Schnapka \n" "Language-Team: German (http://www.transifex.com/oca/OCA-server-tools-8-0/language/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -21,7 +22,7 @@ msgstr "" #: code:addons/auth_admin_passkey/model/res_users.py:88 #, python-format msgid "
User with login '%s' has the same password as you.
" -msgstr "" +msgstr "
Benutzer mit Anmeldename '%s' hat das gleiche Passwort wie Sie.
" #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/model/res_users.py:64 @@ -35,28 +36,28 @@ msgid "" "\n" "- Login date : %s\n" "\n" -msgstr "" +msgstr "Admin-Benutzer hat seinen PassKey verwendet, um sich als '%s' anzumelden.\n\n\n\nTechnische Information folgt : \n\n- Login-Datum: %s\n\n" #. module: auth_admin_passkey #: view:base.config.settings:auth_admin_passkey.view_res_config_settings msgid "Passkey" -msgstr "" +msgstr "PassKey" #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/model/res_users.py:61 #, python-format msgid "Passkey used" -msgstr "" +msgstr "Verwendeter PassKey" #. module: auth_admin_passkey #: field:base.config.settings,auth_admin_passkey_send_to_admin:0 msgid "Send email to admin user." -msgstr "" +msgstr "Sende Email an Admin-Benutzer." #. module: auth_admin_passkey #: field:base.config.settings,auth_admin_passkey_send_to_user:0 msgid "Send email to user." -msgstr "" +msgstr "Sende Email an Benutzer" #. module: auth_admin_passkey #: model:ir.model,name:auth_admin_passkey.model_res_users @@ -68,17 +69,17 @@ msgstr "Benutzer" msgid "" "When the administrator use his password to login in with a different " "account, OpenERP will send an email to the account user." -msgstr "" +msgstr "Wenn der Administrator sein Passwort verwendet, um sich mit anderem Konto anzumelden, sendet das System dem Kontoinhaber eine Email." #. module: auth_admin_passkey #: help:base.config.settings,auth_admin_passkey_send_to_admin:0 msgid "" "When the administrator use his password to login in with a different " "account, OpenERP will send an email to the admin user." -msgstr "" +msgstr "Wenn der Administrator sein Passwort verwendet, um sich als anderer Benutzer anzumelden, wird Oddoeine entsprechende Email an den Admin-Nutzer senden." #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/model/res_users.py:86 #, python-format msgid "[WARNING] OpenERP Security Risk" -msgstr "" +msgstr "[Warnung] Odoo Sicherheitsrisiko" diff --git a/auth_admin_passkey/i18n/es.po b/auth_admin_passkey/i18n/es.po index 9cabcda2d..fd0d06a79 100644 --- a/auth_admin_passkey/i18n/es.po +++ b/auth_admin_passkey/i18n/es.po @@ -3,13 +3,14 @@ # * auth_admin_passkey # # Translators: +# Antonio Trueba, 2016 msgid "" msgstr "" "Project-Id-Version: server-tools (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-29 11:14+0000\n" -"PO-Revision-Date: 2015-09-18 13:53+0000\n" -"Last-Translator: <>\n" +"POT-Creation-Date: 2016-01-19 14:44+0000\n" +"PO-Revision-Date: 2016-02-16 15:15+0000\n" +"Last-Translator: Antonio Trueba\n" "Language-Team: Spanish (http://www.transifex.com/oca/OCA-server-tools-8-0/language/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -21,7 +22,7 @@ msgstr "" #: code:addons/auth_admin_passkey/model/res_users.py:88 #, python-format msgid "
User with login '%s' has the same password as you.
" -msgstr "" +msgstr "
El usuario con identificador '%s' tiene la misma contraseña que usted.
" #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/model/res_users.py:64 @@ -35,7 +36,7 @@ msgid "" "\n" "- Login date : %s\n" "\n" -msgstr "" +msgstr "El usuario administrador ha usado su contraseña para acceder a '%s'.\n\n\n\nDatos técnicos a continuación : \n\n- Fecha de acceso : %s\n\n" #. module: auth_admin_passkey #: view:base.config.settings:auth_admin_passkey.view_res_config_settings @@ -51,12 +52,12 @@ msgstr "" #. module: auth_admin_passkey #: field:base.config.settings,auth_admin_passkey_send_to_admin:0 msgid "Send email to admin user." -msgstr "" +msgstr "Enviar email al usuario administrador." #. module: auth_admin_passkey #: field:base.config.settings,auth_admin_passkey_send_to_user:0 msgid "Send email to user." -msgstr "" +msgstr "Enviar email al usuario." #. module: auth_admin_passkey #: model:ir.model,name:auth_admin_passkey.model_res_users diff --git a/auth_admin_passkey/i18n/fi.po b/auth_admin_passkey/i18n/fi.po new file mode 100644 index 000000000..3c6fb209b --- /dev/null +++ b/auth_admin_passkey/i18n/fi.po @@ -0,0 +1,84 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_admin_passkey +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-04-14 07:01+0000\n" +"PO-Revision-Date: 2016-04-04 11:03+0000\n" +"Last-Translator: Jarmo Kortetjärvi \n" +"Language-Team: Finnish (http://www.transifex.com/oca/OCA-server-tools-8-0/language/fi/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fi\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/model/res_users.py:88 +#, python-format +msgid "
User with login '%s' has the same password as you.
" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/model/res_users.py:64 +#, python-format +msgid "" +"Admin user used his passkey to login with '%s'.\n" +"\n" +"\n" +"\n" +"Technicals informations belows : \n" +"\n" +"- Login date : %s\n" +"\n" +msgstr "" + +#. module: auth_admin_passkey +#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +msgid "Passkey" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/model/res_users.py:61 +#, python-format +msgid "Passkey used" +msgstr "" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "Send email to admin user." +msgstr "" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "Send email to user." +msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_res_users +msgid "Users" +msgstr "Käyttäjät" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, OpenERP will send an email to the account user." +msgstr "" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, OpenERP will send an email to the admin user." +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/model/res_users.py:86 +#, python-format +msgid "[WARNING] OpenERP Security Risk" +msgstr "" diff --git a/auth_admin_passkey/i18n/it.po b/auth_admin_passkey/i18n/it.po new file mode 100644 index 000000000..99ce54fbe --- /dev/null +++ b/auth_admin_passkey/i18n/it.po @@ -0,0 +1,85 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_admin_passkey +# +# Translators: +# Paolo Valier, 2016 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-03-17 15:36+0000\n" +"PO-Revision-Date: 2016-03-13 08:47+0000\n" +"Last-Translator: Paolo Valier\n" +"Language-Team: Italian (http://www.transifex.com/oca/OCA-server-tools-8-0/language/it/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: it\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/model/res_users.py:88 +#, python-format +msgid "
User with login '%s' has the same password as you.
" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/model/res_users.py:64 +#, python-format +msgid "" +"Admin user used his passkey to login with '%s'.\n" +"\n" +"\n" +"\n" +"Technicals informations belows : \n" +"\n" +"- Login date : %s\n" +"\n" +msgstr "" + +#. module: auth_admin_passkey +#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +msgid "Passkey" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/model/res_users.py:61 +#, python-format +msgid "Passkey used" +msgstr "" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "Send email to admin user." +msgstr "Invia email all'utente amministratore." + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "Send email to user." +msgstr "Invia email all'utente." + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_res_users +msgid "Users" +msgstr "Utenti" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, OpenERP will send an email to the account user." +msgstr "" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, OpenERP will send an email to the admin user." +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/model/res_users.py:86 +#, python-format +msgid "[WARNING] OpenERP Security Risk" +msgstr "" diff --git a/auth_admin_passkey/i18n/tr.po b/auth_admin_passkey/i18n/tr.po new file mode 100644 index 000000000..28f690911 --- /dev/null +++ b/auth_admin_passkey/i18n/tr.po @@ -0,0 +1,85 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_admin_passkey +# +# Translators: +# Ahmet Altınışık , 2016 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-01-19 14:44+0000\n" +"PO-Revision-Date: 2016-01-31 12:00+0000\n" +"Last-Translator: Ahmet Altınışık \n" +"Language-Team: Turkish (http://www.transifex.com/oca/OCA-server-tools-8-0/language/tr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: tr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/model/res_users.py:88 +#, python-format +msgid "
User with login '%s' has the same password as you.
" +msgstr "
 '%s' kullanıcısının şifresi sizinkiyle aynı.
" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/model/res_users.py:64 +#, python-format +msgid "" +"Admin user used his passkey to login with '%s'.\n" +"\n" +"\n" +"\n" +"Technicals informations belows : \n" +"\n" +"- Login date : %s\n" +"\n" +msgstr "Yönetici şifresini kullanarak '%s'. kullanıcısıyla giriş yaptı.\n\n\n\nTeknik detaylar aşağıda : \n\n- Giriş zamanı : %s\n\n" + +#. module: auth_admin_passkey +#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +msgid "Passkey" +msgstr "Parola" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/model/res_users.py:61 +#, python-format +msgid "Passkey used" +msgstr "Kullanılan parola" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "Send email to admin user." +msgstr "Yöneticiye e-posta gönder." + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "Send email to user." +msgstr "Kullanıcıya e-posta gönder." + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_res_users +msgid "Users" +msgstr "Kullanıcılar" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, OpenERP will send an email to the account user." +msgstr "Yönetici farklı bir hesaba şifresiyle giriş yaparsa. Odoo hesap sahibine e-posta gönderecek." + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, OpenERP will send an email to the admin user." +msgstr "Yönetici şifresiyle farklı bir kullanıcının hesabına giriş yaparsa, Odoo yöneticiye e-posta gönderir." + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/model/res_users.py:86 +#, python-format +msgid "[WARNING] OpenERP Security Risk" +msgstr "[UYARI] Odoo Güvenlik Riski" From 64bdce95fdb2b204df465d96496e4dce55e6e6ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Tue, 22 Nov 2016 12:21:14 +0000 Subject: [PATCH 02/10] auth_admin_passkey to new API (#519) --- auth_admin_passkey/__init__.py | 27 +--- auth_admin_passkey/__manifest__.py | 27 +--- auth_admin_passkey/model/res_config.py | 76 ---------- auth_admin_passkey/model/res_users.py | 137 ------------------ .../{model => models}/__init__.py | 0 auth_admin_passkey/models/res_config.py | 53 +++++++ auth_admin_passkey/models/res_users.py | 118 +++++++++++++++ .../tests/test_auth_admin_passkey.py | 25 +--- .../{view => views}/res_config_view.xml | 0 9 files changed, 185 insertions(+), 278 deletions(-) delete mode 100644 auth_admin_passkey/model/res_config.py delete mode 100644 auth_admin_passkey/model/res_users.py rename auth_admin_passkey/{model => models}/__init__.py (100%) create mode 100644 auth_admin_passkey/models/res_config.py create mode 100644 auth_admin_passkey/models/res_users.py rename auth_admin_passkey/{view => views}/res_config_view.xml (100%) diff --git a/auth_admin_passkey/__init__.py b/auth_admin_passkey/__init__.py index 088e71f64..6751b2be1 100644 --- a/auth_admin_passkey/__init__.py +++ b/auth_admin_passkey/__init__.py @@ -1,23 +1,6 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Admin Passkey module for OpenERP -# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) -# @author Sylvain LE GAL (https://twitter.com/legalsylvain) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# -*- coding: utf-8 -*- +# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) +# @author Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html -from . import model +from . import models diff --git a/auth_admin_passkey/__manifest__.py b/auth_admin_passkey/__manifest__.py index 69b7c8b1c..2122d131f 100644 --- a/auth_admin_passkey/__manifest__.py +++ b/auth_admin_passkey/__manifest__.py @@ -1,24 +1,7 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Admin Passkey module for OpenERP -# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) -# @author Sylvain LE GAL (https://twitter.com/legalsylvain) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# -*- coding: utf-8 -*- +# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) +# @author Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { 'name': 'Authentification - Admin Passkey', @@ -32,7 +15,7 @@ ], 'data': [ 'data/ir_config_parameter.xml', - 'view/res_config_view.xml', + 'views/res_config_view.xml', ], 'demo': [], 'js': [], diff --git a/auth_admin_passkey/model/res_config.py b/auth_admin_passkey/model/res_config.py deleted file mode 100644 index 11c7fa083..000000000 --- a/auth_admin_passkey/model/res_config.py +++ /dev/null @@ -1,76 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Admin Passkey module for OpenERP -# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) -# @author Sylvain LE GAL (https://twitter.com/legalsylvain) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from openerp.osv import fields -from openerp.osv.orm import TransientModel -from openerp.tools.safe_eval import safe_eval - - -class base_config_settings(TransientModel): - _inherit = 'base.config.settings' - - # Getter / Setter Section - def get_default_auth_admin_passkey_send_to_admin( - self, cr, uid, ids, context=None): - icp = self.pool['ir.config_parameter'] - return { - 'auth_admin_passkey_send_to_admin': safe_eval(icp.get_param( - cr, uid, 'auth_admin_passkey.send_to_admin', 'True')), - } - - def set_auth_admin_passkey_send_to_admin(self, cr, uid, ids, context=None): - config = self.browse(cr, uid, ids[0], context=context) - icp = self.pool['ir.config_parameter'] - icp.set_param( - cr, uid, 'auth_admin_passkey.send_to_admin', - repr(config.auth_admin_passkey_send_to_admin)) - - def get_default_auth_admin_passkey_send_to_user( - self, cr, uid, ids, context=None): - icp = self.pool['ir.config_parameter'] - return { - 'auth_admin_passkey_send_to_user': safe_eval(icp.get_param( - cr, uid, 'auth_admin_passkey.send_to_user', 'True')), - } - - def set_auth_admin_passkey_send_to_user(self, cr, uid, ids, context=None): - config = self.browse(cr, uid, ids[0], context=context) - icp = self.pool['ir.config_parameter'] - icp.set_param( - cr, uid, 'auth_admin_passkey.send_to_user', - repr(config.auth_admin_passkey_send_to_user)) - - # Columns Section - _columns = { - 'auth_admin_passkey_send_to_admin': fields.boolean( - 'Send email to admin user.', - help="""When the administrator use his password to login in """ - """with a different account, OpenERP will send an email """ - """to the admin user.""", - ), - 'auth_admin_passkey_send_to_user': fields.boolean( - string='Send email to user.', - help="""When the administrator use his password to login in """ - """with a different account, OpenERP will send an email """ - """to the account user.""", - ), - } diff --git a/auth_admin_passkey/model/res_users.py b/auth_admin_passkey/model/res_users.py deleted file mode 100644 index d0a5a8aa2..000000000 --- a/auth_admin_passkey/model/res_users.py +++ /dev/null @@ -1,137 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Admin Passkey module for OpenERP -# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) -# @author Sylvain LE GAL (https://twitter.com/legalsylvain) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -import datetime - -from openerp import SUPERUSER_ID -from openerp import pooler -from openerp import exceptions -from openerp.osv.orm import Model -from openerp.tools.translate import _ -from openerp.tools.safe_eval import safe_eval - - -class res_users(Model): - _inherit = "res.users" - - # Private Function section - def _get_translation(self, cr, lang, text): - context = {'lang': lang} # noqa: _() checks page for locals - return _(text) - - def _send_email_passkey(self, cr, user_id, user_agent_env): - """ Send a email to the admin of the system and / or the user - to inform passkey use.""" - mails = [] - mail_obj = self.pool['mail.mail'] - icp_obj = self.pool['ir.config_parameter'] - admin_user = self.browse(cr, SUPERUSER_ID, SUPERUSER_ID) - login_user = self.browse(cr, SUPERUSER_ID, user_id) - send_to_admin = safe_eval(icp_obj.get_param( - cr, SUPERUSER_ID, 'auth_admin_passkey.send_to_admin', 'True')) - send_to_user = safe_eval(icp_obj.get_param( - cr, SUPERUSER_ID, 'auth_admin_passkey.send_to_user', 'True')) - - if send_to_admin and admin_user.email: - mails.append({'email': admin_user.email, 'lang': admin_user.lang}) - if send_to_user and login_user.email: - mails.append({'email': login_user.email, 'lang': login_user.lang}) - - for mail in mails: - subject = self._get_translation( - cr, mail['lang'], _('Passkey used')) - body = self._get_translation( - cr, mail['lang'], - _("""Admin user used his passkey to login with '%s'.\n\n""" - """\n\nTechnicals informations belows : \n\n""" - """- Login date : %s\n\n""")) % ( - login_user.login, - datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")) - for k, v in user_agent_env.iteritems(): - body += ("- %s : %s\n\n") % (k, v) - mail_obj.create( - cr, SUPERUSER_ID, { - 'email_to': mail['email'], - 'subject': subject, - 'body_html': '
%s
' % body}) - - def _send_email_same_password(self, cr, login_user): - """ Send a email to the admin user to inform that another user has the - same password as him.""" - mail_obj = self.pool['mail.mail'] - admin_user = self.browse(cr, SUPERUSER_ID, SUPERUSER_ID) - if admin_user.email: - mail_obj.create(cr, SUPERUSER_ID, { - 'email_to': admin_user.email, - 'subject': self._get_translation( - cr, admin_user.lang, _('[WARNING] OpenERP Security Risk')), - 'body_html': self._get_translation( - cr, admin_user.lang, _( - """
User with login '%s' has the same """
-                        """password as you.
""")) % (login_user), - }) - - # Overload Section - def authenticate(self, db, login, password, user_agent_env): - """ Authenticate the user 'login' is password is ok or if - is admin password. In the second case, send mail to user and admin.""" - user_id = super(res_users, self).authenticate( - db, login, password, user_agent_env) - if user_id and (user_id != SUPERUSER_ID): - same_password = False - cr = pooler.get_db(db).cursor() - try: - # directly use parent 'check_credentials' function - # to really know if credentials are ok - # or if it was admin password - super(res_users, self).check_credentials( - cr, SUPERUSER_ID, password) - try: - # Test now if the user has the same password as admin user - super(res_users, self).check_credentials( - cr, user_id, password) - same_password = True - except exceptions.AccessDenied: - pass - if not same_password: - self._send_email_passkey(cr, user_id, user_agent_env) - else: - self._send_email_same_password(cr, login) - cr.commit() - except exceptions.AccessDenied: - pass - finally: - cr.close() - return user_id - - def check_credentials(self, cr, uid, password): - """ Return now True if credentials are good OR if password is admin -password.""" - if uid != SUPERUSER_ID: - try: - super(res_users, self).check_credentials( - cr, uid, password) - return True - except exceptions.AccessDenied: - return self.check_credentials(cr, SUPERUSER_ID, password) - else: - return super(res_users, self).check_credentials(cr, uid, password) diff --git a/auth_admin_passkey/model/__init__.py b/auth_admin_passkey/models/__init__.py similarity index 100% rename from auth_admin_passkey/model/__init__.py rename to auth_admin_passkey/models/__init__.py diff --git a/auth_admin_passkey/models/res_config.py b/auth_admin_passkey/models/res_config.py new file mode 100644 index 000000000..62c34d287 --- /dev/null +++ b/auth_admin_passkey/models/res_config.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) +# @author Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from openerp import api, fields, models + + +class BaseConfigSettings(models.TransientModel): + _inherit = 'base.config.settings' + + # Getter / Setter Section + @api.model + def get_default_auth_admin_passkey_send_to_admin(self, fields): + return { + 'auth_admin_passkey_send_to_admin': + self.env["ir.config_parameter"].get_param( + "auth_admin_passkey.send_to_admin") + } + + @api.multi + def set_auth_admin_passkey_send_to_admin(self): + for config in self: + self.env['ir.config_parameter'].set_param( + "auth_admin_passkey.send_to_admin", + config.auth_admin_passkey_send_to_admin or '') + + @api.model + def get_default_auth_admin_passkey_send_to_user(self, fields): + return { + 'auth_admin_passkey_send_to_user': + self.env["ir.config_parameter"].get_param( + "auth_admin_passkey.send_to_user") + } + + @api.multi + def set_auth_admin_passkey_send_to_user(self): + for config in self: + self.env['ir.config_parameter'].set_param( + "auth_admin_passkey.send_to_user", + config.auth_admin_passkey_send_to_user or '') + + auth_admin_passkey_send_to_admin = fields.Boolean( + string='Send email to admin user.', + help="""When the administrator use his password to login in """ + """with a different account, OpenERP will send an email """ + """to the admin user.""") + + auth_admin_passkey_send_to_user = fields.Boolean( + string='Send email to user.', + help="""When the administrator use his password to login in """ + """with a different account, OpenERP will send an email """ + """to the account user.""") diff --git a/auth_admin_passkey/models/res_users.py b/auth_admin_passkey/models/res_users.py new file mode 100644 index 000000000..e2495143e --- /dev/null +++ b/auth_admin_passkey/models/res_users.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) +# @author Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +import datetime + +from openerp import _, api, exceptions, models, registry, SUPERUSER_ID +from openerp.tools.safe_eval import safe_eval + + +class ResUsers(models.Model): + _inherit = "res.users" + + def _get_translation(self, lang, text): + context = {'lang': lang} # noqa: _() checks page for locals + return _(text) + + @api.model + def _send_email_passkey(self, user_agent_env): + """ Send a email to the admin of the system and / or the user + to inform passkey use.""" + mails = [] + mail_obj = self.env['mail.mail'] + icp_obj = self.env['ir.config_parameter'] + admin_user = self.sudo().browse(SUPERUSER_ID) + login_user = self.sudo().browse(self.env.uid) + send_to_admin = safe_eval(icp_obj.sudo().get_param( + 'auth_admin_passkey.send_to_admin', + 'True')) + send_to_user = safe_eval(icp_obj.sudo().get_param( + 'auth_admin_passkey.send_to_user', + 'True')) + + if send_to_admin and admin_user.email: + mails.append({'email': admin_user.email, 'lang': admin_user.lang}) + if send_to_user and login_user.email: + mails.append({'email': login_user.email, 'lang': login_user.lang}) + for mail in mails: + subject = self._get_translation( + mail['lang'], _('Passkey used')) + body = self._get_translation( + mail['lang'], + _("""Admin user used his passkey to login with '%s'.\n\n""" + """\n\nTechnicals informations belows : \n\n""" + """- Login date : %s\n\n""")) % ( + login_user.login, + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")) + for k, v in user_agent_env.iteritems(): + body += ("- %s : %s\n\n") % (k, v) + mail = mail_obj.sudo().create({ + 'email_to': mail['email'], + 'subject': subject, + 'body_html': '
%s
' % body}) + mail.send(auto_commit=True) + + @api.cr + def _send_email_same_password(self, login_user): + """ Send a email to the admin user to inform that another user has the + same password as him.""" + mail_obj = self.env['mail.mail'] + admin_user = self.sudo().browse(SUPERUSER_ID) + if admin_user.email: + mail = mail_obj.sudo().create({ + 'email_to': admin_user.email, + 'subject': self._get_translation( + admin_user.lang, _('[WARNING] OpenERP Security Risk')), + 'body_html': self._get_translation( + admin_user.lang, _( + """
User with login '%s' has the same """
+                        """password as you.
""")) % (login_user), + }) + mail.send(auto_commit=True) + + # Overload Section + def authenticate(self, db, login, password, user_agent_env): + """ Authenticate the user 'login' is password is ok or if + is admin password. In the second case, send mail to user and admin.""" + user_id = super(ResUsers, self).authenticate( + db, login, password, user_agent_env) + if user_id and (user_id != SUPERUSER_ID): + same_password = False + cr = registry(db).cursor() + try: + # directly use parent 'check_credentials' function + # to really know if credentials are ok + # or if it was admin password + super(ResUsers, self).check_credentials( + cr, SUPERUSER_ID, password) + try: + # Test now if the user has the same password as admin user + super(ResUsers, self).check_credentials( + cr, user_id, password) + same_password = True + except exceptions.AccessDenied: + pass + if not same_password: + self._send_email_passkey(cr, user_id, user_agent_env) + else: + self._send_email_same_password(cr, login) + except exceptions.AccessDenied: + pass + finally: + cr.close() + return user_id + + @api.model + def check_credentials(self, password): + """ Return now True if credentials are good OR if password is admin +password.""" + if self.env.uid != SUPERUSER_ID: + try: + super(ResUsers, self).check_credentials(password) + return True + except exceptions.AccessDenied: + return self.sudo().check_credentials(password) + else: + return super(ResUsers, self).check_credentials(password) diff --git a/auth_admin_passkey/tests/test_auth_admin_passkey.py b/auth_admin_passkey/tests/test_auth_admin_passkey.py index 2ce02d26c..2f0edaf9d 100644 --- a/auth_admin_passkey/tests/test_auth_admin_passkey.py +++ b/auth_admin_passkey/tests/test_auth_admin_passkey.py @@ -1,24 +1,7 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Admin Passkey module for OpenERP -# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) -# @author Sylvain LE GAL (https://twitter.com/legalsylvain) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# -*- coding: utf-8 -*- +# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) +# @author Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html import threading diff --git a/auth_admin_passkey/view/res_config_view.xml b/auth_admin_passkey/views/res_config_view.xml similarity index 100% rename from auth_admin_passkey/view/res_config_view.xml rename to auth_admin_passkey/views/res_config_view.xml From db4cd934c370eb66e7ba21e8010f2868f15efd08 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Tue, 29 Nov 2016 12:25:36 -0500 Subject: [PATCH 03/10] OCA Transbot updated translations from Transifex --- auth_admin_passkey/i18n/de.po | 20 +++++--- auth_admin_passkey/i18n/es.po | 20 +++++--- auth_admin_passkey/i18n/fr.po | 19 +++++--- auth_admin_passkey/i18n/fr_CH.po | 84 ++++++++++++++++++++++++++++++++ auth_admin_passkey/i18n/pt_BR.po | 20 +++++--- auth_admin_passkey/i18n/sl.po | 22 ++++++--- auth_admin_passkey/i18n/tr.po | 23 ++++++--- auth_admin_passkey/i18n/tr_TR.po | 84 ++++++++++++++++++++++++++++++++ 8 files changed, 252 insertions(+), 40 deletions(-) create mode 100644 auth_admin_passkey/i18n/fr_CH.po create mode 100644 auth_admin_passkey/i18n/tr_TR.po diff --git a/auth_admin_passkey/i18n/de.po b/auth_admin_passkey/i18n/de.po index 30159c73a..7b4731add 100644 --- a/auth_admin_passkey/i18n/de.po +++ b/auth_admin_passkey/i18n/de.po @@ -3,13 +3,19 @@ # * auth_admin_passkey # # Translators: -# Rudolf Schnapka , 2016 +# FIRST AUTHOR , 2013-2014 +# Giacomo , 2015 +# Hotellook, 2014 +# Matjaž Mozetič , 2015-2016 +# Miku Laitinen , 2015 +# Pedro M. Baeza , 2015 +# Rudolf Schnapka , 2015-2016 msgid "" msgstr "" "Project-Id-Version: server-tools (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-01-19 14:44+0000\n" -"PO-Revision-Date: 2016-01-26 10:39+0000\n" +"POT-Creation-Date: 2016-11-28 21:28+0000\n" +"PO-Revision-Date: 2016-11-22 12:27+0000\n" "Last-Translator: Rudolf Schnapka \n" "Language-Team: German (http://www.transifex.com/oca/OCA-server-tools-8-0/language/de/)\n" "MIME-Version: 1.0\n" @@ -19,13 +25,13 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:88 +#: code:addons/auth_admin_passkey/models/res_users.py:69 #, python-format msgid "
User with login '%s' has the same password as you.
" msgstr "
Benutzer mit Anmeldename '%s' hat das gleiche Passwort wie Sie.
" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:64 +#: code:addons/auth_admin_passkey/models/res_users.py:44 #, python-format msgid "" "Admin user used his passkey to login with '%s'.\n" @@ -44,7 +50,7 @@ msgid "Passkey" msgstr "PassKey" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:61 +#: code:addons/auth_admin_passkey/models/res_users.py:41 #, python-format msgid "Passkey used" msgstr "Verwendeter PassKey" @@ -79,7 +85,7 @@ msgid "" msgstr "Wenn der Administrator sein Passwort verwendet, um sich als anderer Benutzer anzumelden, wird Oddoeine entsprechende Email an den Admin-Nutzer senden." #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:86 +#: code:addons/auth_admin_passkey/models/res_users.py:67 #, python-format msgid "[WARNING] OpenERP Security Risk" msgstr "[Warnung] Odoo Sicherheitsrisiko" diff --git a/auth_admin_passkey/i18n/es.po b/auth_admin_passkey/i18n/es.po index fd0d06a79..a5aec3564 100644 --- a/auth_admin_passkey/i18n/es.po +++ b/auth_admin_passkey/i18n/es.po @@ -3,13 +3,21 @@ # * auth_admin_passkey # # Translators: +# Ahmet Altinisik , 2016 # Antonio Trueba, 2016 +# Antonio Trueba, 2016 +# FIRST AUTHOR , 2013 +# Matjaž Mozetič , 2015-2016 +# Paolo Valier, 2016 +# Pedro M. Baeza , 2015 +# Rudolf Schnapka , 2015-2016 +# SaFi J. , 2015 msgid "" msgstr "" "Project-Id-Version: server-tools (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-01-19 14:44+0000\n" -"PO-Revision-Date: 2016-02-16 15:15+0000\n" +"POT-Creation-Date: 2016-11-28 21:28+0000\n" +"PO-Revision-Date: 2016-10-24 09:24+0000\n" "Last-Translator: Antonio Trueba\n" "Language-Team: Spanish (http://www.transifex.com/oca/OCA-server-tools-8-0/language/es/)\n" "MIME-Version: 1.0\n" @@ -19,13 +27,13 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:88 +#: code:addons/auth_admin_passkey/models/res_users.py:69 #, python-format msgid "
User with login '%s' has the same password as you.
" msgstr "
El usuario con identificador '%s' tiene la misma contraseña que usted.
" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:64 +#: code:addons/auth_admin_passkey/models/res_users.py:44 #, python-format msgid "" "Admin user used his passkey to login with '%s'.\n" @@ -44,7 +52,7 @@ msgid "Passkey" msgstr "" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:61 +#: code:addons/auth_admin_passkey/models/res_users.py:41 #, python-format msgid "Passkey used" msgstr "" @@ -79,7 +87,7 @@ msgid "" msgstr "" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:86 +#: code:addons/auth_admin_passkey/models/res_users.py:67 #, python-format msgid "[WARNING] OpenERP Security Risk" msgstr "" diff --git a/auth_admin_passkey/i18n/fr.po b/auth_admin_passkey/i18n/fr.po index 9cb88a83b..4ffa0a4b6 100644 --- a/auth_admin_passkey/i18n/fr.po +++ b/auth_admin_passkey/i18n/fr.po @@ -3,12 +3,19 @@ # * auth_admin_passkey # # Translators: +# Ahmet Altinisik , 2015 +# FIRST AUTHOR , 2012 +# Hotellook, 2014 +# Jarmo Kortetjärvi , 2016 +# Paolo Valier, 2016 +# Rudolf Schnapka , 2016 +# Thomas A. Jaeger, 2015 msgid "" msgstr "" "Project-Id-Version: server-tools (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-29 11:14+0000\n" -"PO-Revision-Date: 2015-09-18 13:53+0000\n" +"POT-Creation-Date: 2016-11-28 21:28+0000\n" +"PO-Revision-Date: 2016-11-22 12:24+0000\n" "Last-Translator: OCA Transbot \n" "Language-Team: French (http://www.transifex.com/oca/OCA-server-tools-8-0/language/fr/)\n" "MIME-Version: 1.0\n" @@ -18,13 +25,13 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:88 +#: code:addons/auth_admin_passkey/models/res_users.py:69 #, python-format msgid "
User with login '%s' has the same password as you.
" msgstr "
L'utilisateur dont l'identifiant est '%s' a le même mot de passe que vous.
" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:64 +#: code:addons/auth_admin_passkey/models/res_users.py:44 #, python-format msgid "" "Admin user used his passkey to login with '%s'.\n" @@ -43,7 +50,7 @@ msgid "Passkey" msgstr "Mot de passe \"bris de glace\"" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:61 +#: code:addons/auth_admin_passkey/models/res_users.py:41 #, python-format msgid "Passkey used" msgstr "Mot de passe \"bris de glace\" utilisé" @@ -78,7 +85,7 @@ msgid "" msgstr "Quand l'administrateur utilise son mot de passe pour s'authentifier avec un compte différent, OpenERP enverra un mail à l'utilisateur." #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:86 +#: code:addons/auth_admin_passkey/models/res_users.py:67 #, python-format msgid "[WARNING] OpenERP Security Risk" msgstr "[WARNING] Faille de sécurité sur OpenERP" diff --git a/auth_admin_passkey/i18n/fr_CH.po b/auth_admin_passkey/i18n/fr_CH.po new file mode 100644 index 000000000..794ebf864 --- /dev/null +++ b/auth_admin_passkey/i18n/fr_CH.po @@ -0,0 +1,84 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_admin_passkey +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-11-30 14:52+0000\n" +"PO-Revision-Date: 2015-09-18 13:53+0000\n" +"Last-Translator: <>\n" +"Language-Team: French (Switzerland) (http://www.transifex.com/oca/OCA-server-tools-8-0/language/fr_CH/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr_CH\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:69 +#, python-format +msgid "
User with login '%s' has the same password as you.
" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:44 +#, python-format +msgid "" +"Admin user used his passkey to login with '%s'.\n" +"\n" +"\n" +"\n" +"Technicals informations belows : \n" +"\n" +"- Login date : %s\n" +"\n" +msgstr "" + +#. module: auth_admin_passkey +#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +msgid "Passkey" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:41 +#, python-format +msgid "Passkey used" +msgstr "" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "Send email to admin user." +msgstr "" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "Send email to user." +msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_res_users +msgid "Users" +msgstr "Utilisateurs" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, OpenERP will send an email to the account user." +msgstr "" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, OpenERP will send an email to the admin user." +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:67 +#, python-format +msgid "[WARNING] OpenERP Security Risk" +msgstr "" diff --git a/auth_admin_passkey/i18n/pt_BR.po b/auth_admin_passkey/i18n/pt_BR.po index 361554e01..ac24c3633 100644 --- a/auth_admin_passkey/i18n/pt_BR.po +++ b/auth_admin_passkey/i18n/pt_BR.po @@ -4,12 +4,20 @@ # # Translators: # Armando Vulcano Junior , 2015 +# Bole , 2015 +# FIRST AUTHOR , 2012 +# Gustavo Lepri , 2015 +# Jarmo Kortetjärvi , 2016 +# Matjaž Mozetič , 2015-2016 +# Paolo Valier, 2016 +# Rudolf Schnapka , 2016 +# Thomas A. Jaeger, 2015 msgid "" msgstr "" "Project-Id-Version: server-tools (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-29 11:14+0000\n" -"PO-Revision-Date: 2015-09-18 20:59+0000\n" +"POT-Creation-Date: 2016-11-28 21:28+0000\n" +"PO-Revision-Date: 2016-10-24 09:24+0000\n" "Last-Translator: Armando Vulcano Junior \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-server-tools-8-0/language/pt_BR/)\n" "MIME-Version: 1.0\n" @@ -19,13 +27,13 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:88 +#: code:addons/auth_admin_passkey/models/res_users.py:69 #, python-format msgid "
User with login '%s' has the same password as you.
" msgstr "
Usuário com login '%s' tem a mesma senha que você.
" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:64 +#: code:addons/auth_admin_passkey/models/res_users.py:44 #, python-format msgid "" "Admin user used his passkey to login with '%s'.\n" @@ -44,7 +52,7 @@ msgid "Passkey" msgstr "Passkey" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:61 +#: code:addons/auth_admin_passkey/models/res_users.py:41 #, python-format msgid "Passkey used" msgstr "Passkey usada" @@ -79,7 +87,7 @@ msgid "" msgstr "Quando o administrador usa sua senha para dar login com uma conta diferente, OPENERP irá enviar um email para a conta do administrador." #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:86 +#: code:addons/auth_admin_passkey/models/res_users.py:67 #, python-format msgid "[WARNING] OpenERP Security Risk" msgstr "[AVISO] OpenERP Risco de Segurança" diff --git a/auth_admin_passkey/i18n/sl.po b/auth_admin_passkey/i18n/sl.po index 88c41d5f4..6763bec43 100644 --- a/auth_admin_passkey/i18n/sl.po +++ b/auth_admin_passkey/i18n/sl.po @@ -3,13 +3,21 @@ # * auth_admin_passkey # # Translators: -# Matjaž Mozetič , 2015 +# Artūras Griškonis , 2012,2015-2016 +# Artūras Griškonis , 2012 +# danimaribeiro , 2016 +# Dorin Hongu , 2015 +# FIRST AUTHOR , 2012 +# Jarmo Kortetjärvi , 2016 +# Matjaž Mozetič , 2015-2016 +# Rudolf Schnapka , 2016 +# Zapata11 , 2015 msgid "" msgstr "" "Project-Id-Version: server-tools (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-29 11:14+0000\n" -"PO-Revision-Date: 2015-09-26 07:15+0000\n" +"POT-Creation-Date: 2016-11-28 21:28+0000\n" +"PO-Revision-Date: 2016-10-24 09:24+0000\n" "Last-Translator: Matjaž Mozetič \n" "Language-Team: Slovenian (http://www.transifex.com/oca/OCA-server-tools-8-0/language/sl/)\n" "MIME-Version: 1.0\n" @@ -19,13 +27,13 @@ msgstr "" "Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:88 +#: code:addons/auth_admin_passkey/models/res_users.py:69 #, python-format msgid "
User with login '%s' has the same password as you.
" msgstr "
Uporabnik '%s' ima enako geslo kot vi.
" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:64 +#: code:addons/auth_admin_passkey/models/res_users.py:44 #, python-format msgid "" "Admin user used his passkey to login with '%s'.\n" @@ -44,7 +52,7 @@ msgid "Passkey" msgstr "Prijavni ključ" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:61 +#: code:addons/auth_admin_passkey/models/res_users.py:41 #, python-format msgid "Passkey used" msgstr "Uporabljen prijavni ključ" @@ -79,7 +87,7 @@ msgid "" msgstr "Ko administrator uporabi svoje geslo za prijavo v drug račun, bo OpenERP poslal e-pošto administratorju." #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:86 +#: code:addons/auth_admin_passkey/models/res_users.py:67 #, python-format msgid "[WARNING] OpenERP Security Risk" msgstr "[OPOZORILO] OpenERP varnostno tveganje" diff --git a/auth_admin_passkey/i18n/tr.po b/auth_admin_passkey/i18n/tr.po index 28f690911..9cf30e4ed 100644 --- a/auth_admin_passkey/i18n/tr.po +++ b/auth_admin_passkey/i18n/tr.po @@ -3,14 +3,21 @@ # * auth_admin_passkey # # Translators: -# Ahmet Altınışık , 2016 +# Ahmet Altinisik , 2016 +# FIRST AUTHOR , 2013-2014 +# Giacomo , 2015 +# Hotellook, 2014 +# Matjaž Mozetič , 2015-2016 +# Miku Laitinen , 2015 +# Pedro M. Baeza , 2015 +# Rudolf Schnapka , 2015-2016 msgid "" msgstr "" "Project-Id-Version: server-tools (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-01-19 14:44+0000\n" -"PO-Revision-Date: 2016-01-31 12:00+0000\n" -"Last-Translator: Ahmet Altınışık \n" +"POT-Creation-Date: 2016-11-28 21:28+0000\n" +"PO-Revision-Date: 2016-11-22 12:26+0000\n" +"Last-Translator: Ahmet Altinisik \n" "Language-Team: Turkish (http://www.transifex.com/oca/OCA-server-tools-8-0/language/tr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -19,13 +26,13 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:88 +#: code:addons/auth_admin_passkey/models/res_users.py:69 #, python-format msgid "
User with login '%s' has the same password as you.
" msgstr "
 '%s' kullanıcısının şifresi sizinkiyle aynı.
" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:64 +#: code:addons/auth_admin_passkey/models/res_users.py:44 #, python-format msgid "" "Admin user used his passkey to login with '%s'.\n" @@ -44,7 +51,7 @@ msgid "Passkey" msgstr "Parola" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:61 +#: code:addons/auth_admin_passkey/models/res_users.py:41 #, python-format msgid "Passkey used" msgstr "Kullanılan parola" @@ -79,7 +86,7 @@ msgid "" msgstr "Yönetici şifresiyle farklı bir kullanıcının hesabına giriş yaparsa, Odoo yöneticiye e-posta gönderir." #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:86 +#: code:addons/auth_admin_passkey/models/res_users.py:67 #, python-format msgid "[WARNING] OpenERP Security Risk" msgstr "[UYARI] Odoo Güvenlik Riski" diff --git a/auth_admin_passkey/i18n/tr_TR.po b/auth_admin_passkey/i18n/tr_TR.po new file mode 100644 index 000000000..941541286 --- /dev/null +++ b/auth_admin_passkey/i18n/tr_TR.po @@ -0,0 +1,84 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_admin_passkey +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-12-31 08:34+0000\n" +"PO-Revision-Date: 2015-09-18 13:53+0000\n" +"Last-Translator: <>\n" +"Language-Team: Turkish (Turkey) (http://www.transifex.com/oca/OCA-server-tools-8-0/language/tr_TR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: tr_TR\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:69 +#, python-format +msgid "
User with login '%s' has the same password as you.
" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:44 +#, python-format +msgid "" +"Admin user used his passkey to login with '%s'.\n" +"\n" +"\n" +"\n" +"Technicals informations belows : \n" +"\n" +"- Login date : %s\n" +"\n" +msgstr "" + +#. module: auth_admin_passkey +#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +msgid "Passkey" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:41 +#, python-format +msgid "Passkey used" +msgstr "" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "Send email to admin user." +msgstr "" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "Send email to user." +msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_res_users +msgid "Users" +msgstr "Kullanıcılar" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, OpenERP will send an email to the account user." +msgstr "" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, OpenERP will send an email to the admin user." +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:67 +#, python-format +msgid "[WARNING] OpenERP Security Risk" +msgstr "" From fd187bc8aee76dfbedde143676cf7beb62bcea49 Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Tue, 10 Jan 2017 13:29:58 +0100 Subject: [PATCH 04/10] replace OpenERP with Odoo this fixes an issue reported on Transifex --- auth_admin_passkey/README.rst | 2 +- auth_admin_passkey/data/ir_config_parameter.xml | 2 +- auth_admin_passkey/i18n/auth_admin_passkey.pot | 8 ++++---- auth_admin_passkey/i18n/de.po | 6 +++--- auth_admin_passkey/i18n/es.po | 6 +++--- auth_admin_passkey/i18n/fi.po | 6 +++--- auth_admin_passkey/i18n/fr.po | 12 ++++++------ auth_admin_passkey/i18n/fr_CH.po | 6 +++--- auth_admin_passkey/i18n/it.po | 6 +++--- auth_admin_passkey/i18n/pt_BR.po | 8 ++++---- auth_admin_passkey/i18n/sl.po | 12 ++++++------ auth_admin_passkey/i18n/tr.po | 6 +++--- auth_admin_passkey/i18n/tr_TR.po | 6 +++--- auth_admin_passkey/models/__init__.py | 2 +- auth_admin_passkey/models/res_config.py | 4 ++-- auth_admin_passkey/models/res_users.py | 2 +- auth_admin_passkey/tests/__init__.py | 2 +- auth_admin_passkey/views/res_config_view.xml | 2 +- 18 files changed, 49 insertions(+), 49 deletions(-) diff --git a/auth_admin_passkey/README.rst b/auth_admin_passkey/README.rst index 15be819dc..e49ec6635 100644 --- a/auth_admin_passkey/README.rst +++ b/auth_admin_passkey/README.rst @@ -4,7 +4,7 @@ Admin password become a passkey for all active logins Functionality : --------------- * Administrator has now the possibility to login in with any login; - * By default, OpenERP will send a mail to user and admin to indicate them; + * By default, Odoo will send a mail to user and admin to indicate them; * If a user and the admin have the same password, admin will be informed; Technical information : diff --git a/auth_admin_passkey/data/ir_config_parameter.xml b/auth_admin_passkey/data/ir_config_parameter.xml index 7c7f3625d..6b32557a3 100644 --- a/auth_admin_passkey/data/ir_config_parameter.xml +++ b/auth_admin_passkey/data/ir_config_parameter.xml @@ -1,6 +1,6 @@ - + diff --git a/auth_admin_passkey/i18n/auth_admin_passkey.pot b/auth_admin_passkey/i18n/auth_admin_passkey.pot index 04b30e9a5..1cef0a00a 100644 --- a/auth_admin_passkey/i18n/auth_admin_passkey.pot +++ b/auth_admin_passkey/i18n/auth_admin_passkey.pot @@ -1,6 +1,6 @@ ############################################################################## # -# Admin Passkey module for OpenERP +# Admin Passkey module for Odoo # Copyright (C) 2013-2014 GRAP (http://www.grap.coop) # @author Sylvain LE GAL (https://twitter.com/legalsylvain) # @@ -85,17 +85,17 @@ msgstr "" #. module: auth_admin_passkey #: help:base.config.settings,auth_admin_passkey_send_to_user:0 -msgid "When the administrator use his password to login in with a different account, OpenERP will send an email to the account user." +msgid "When the administrator use his password to login in with a different account, Odoo will send an email to the account user." msgstr "" #. module: auth_admin_passkey #: help:base.config.settings,auth_admin_passkey_send_to_admin:0 -msgid "When the administrator use his password to login in with a different account, OpenERP will send an email to the admin user." +msgid "When the administrator use his password to login in with a different account, Odoo will send an email to the admin user." msgstr "" #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/model/res_users.py:64 #, python-format -msgid "[WARNING] OpenERP Security Risk" +msgid "[WARNING] Odoo Security Risk" msgstr "" diff --git a/auth_admin_passkey/i18n/de.po b/auth_admin_passkey/i18n/de.po index 7b4731add..5396ea7f1 100644 --- a/auth_admin_passkey/i18n/de.po +++ b/auth_admin_passkey/i18n/de.po @@ -74,18 +74,18 @@ msgstr "Benutzer" #: help:base.config.settings,auth_admin_passkey_send_to_user:0 msgid "" "When the administrator use his password to login in with a different " -"account, OpenERP will send an email to the account user." +"account, Odoo will send an email to the account user." msgstr "Wenn der Administrator sein Passwort verwendet, um sich mit anderem Konto anzumelden, sendet das System dem Kontoinhaber eine Email." #. module: auth_admin_passkey #: help:base.config.settings,auth_admin_passkey_send_to_admin:0 msgid "" "When the administrator use his password to login in with a different " -"account, OpenERP will send an email to the admin user." +"account, Odoo will send an email to the admin user." msgstr "Wenn der Administrator sein Passwort verwendet, um sich als anderer Benutzer anzumelden, wird Oddoeine entsprechende Email an den Admin-Nutzer senden." #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/models/res_users.py:67 #, python-format -msgid "[WARNING] OpenERP Security Risk" +msgid "[WARNING] Odoo Security Risk" msgstr "[Warnung] Odoo Sicherheitsrisiko" diff --git a/auth_admin_passkey/i18n/es.po b/auth_admin_passkey/i18n/es.po index a5aec3564..313b5c154 100644 --- a/auth_admin_passkey/i18n/es.po +++ b/auth_admin_passkey/i18n/es.po @@ -76,18 +76,18 @@ msgstr "Usuarios" #: help:base.config.settings,auth_admin_passkey_send_to_user:0 msgid "" "When the administrator use his password to login in with a different " -"account, OpenERP will send an email to the account user." +"account, Odoo will send an email to the account user." msgstr "" #. module: auth_admin_passkey #: help:base.config.settings,auth_admin_passkey_send_to_admin:0 msgid "" "When the administrator use his password to login in with a different " -"account, OpenERP will send an email to the admin user." +"account, Odoo will send an email to the admin user." msgstr "" #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/models/res_users.py:67 #, python-format -msgid "[WARNING] OpenERP Security Risk" +msgid "[WARNING] Odoo Security Risk" msgstr "" diff --git a/auth_admin_passkey/i18n/fi.po b/auth_admin_passkey/i18n/fi.po index 3c6fb209b..3d8d95a0f 100644 --- a/auth_admin_passkey/i18n/fi.po +++ b/auth_admin_passkey/i18n/fi.po @@ -67,18 +67,18 @@ msgstr "Käyttäjät" #: help:base.config.settings,auth_admin_passkey_send_to_user:0 msgid "" "When the administrator use his password to login in with a different " -"account, OpenERP will send an email to the account user." +"account, Odoo will send an email to the account user." msgstr "" #. module: auth_admin_passkey #: help:base.config.settings,auth_admin_passkey_send_to_admin:0 msgid "" "When the administrator use his password to login in with a different " -"account, OpenERP will send an email to the admin user." +"account, Odoo will send an email to the admin user." msgstr "" #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/model/res_users.py:86 #, python-format -msgid "[WARNING] OpenERP Security Risk" +msgid "[WARNING] Odoo Security Risk" msgstr "" diff --git a/auth_admin_passkey/i18n/fr.po b/auth_admin_passkey/i18n/fr.po index 4ffa0a4b6..c5354f83d 100644 --- a/auth_admin_passkey/i18n/fr.po +++ b/auth_admin_passkey/i18n/fr.po @@ -74,18 +74,18 @@ msgstr "Utilisateurs" #: help:base.config.settings,auth_admin_passkey_send_to_user:0 msgid "" "When the administrator use his password to login in with a different " -"account, OpenERP will send an email to the account user." -msgstr "Quand l'administrateur utilise son mot de passe pour s'authentifier avec un compte différent, OpenERP lui enverra un mail." +"account, Odoo will send an email to the account user." +msgstr "Quand l'administrateur utilise son mot de passe pour s'authentifier avec un compte différent, Odoo lui enverra un mail." #. module: auth_admin_passkey #: help:base.config.settings,auth_admin_passkey_send_to_admin:0 msgid "" "When the administrator use his password to login in with a different " -"account, OpenERP will send an email to the admin user." -msgstr "Quand l'administrateur utilise son mot de passe pour s'authentifier avec un compte différent, OpenERP enverra un mail à l'utilisateur." +"account, Odoo will send an email to the admin user." +msgstr "Quand l'administrateur utilise son mot de passe pour s'authentifier avec un compte différent, Odoo enverra un mail à l'utilisateur." #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/models/res_users.py:67 #, python-format -msgid "[WARNING] OpenERP Security Risk" -msgstr "[WARNING] Faille de sécurité sur OpenERP" +msgid "[WARNING] Odoo Security Risk" +msgstr "[WARNING] Faille de sécurité sur Odoo" diff --git a/auth_admin_passkey/i18n/fr_CH.po b/auth_admin_passkey/i18n/fr_CH.po index 794ebf864..57e68351f 100644 --- a/auth_admin_passkey/i18n/fr_CH.po +++ b/auth_admin_passkey/i18n/fr_CH.po @@ -67,18 +67,18 @@ msgstr "Utilisateurs" #: help:base.config.settings,auth_admin_passkey_send_to_user:0 msgid "" "When the administrator use his password to login in with a different " -"account, OpenERP will send an email to the account user." +"account, Odoo will send an email to the account user." msgstr "" #. module: auth_admin_passkey #: help:base.config.settings,auth_admin_passkey_send_to_admin:0 msgid "" "When the administrator use his password to login in with a different " -"account, OpenERP will send an email to the admin user." +"account, Odoo will send an email to the admin user." msgstr "" #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/models/res_users.py:67 #, python-format -msgid "[WARNING] OpenERP Security Risk" +msgid "[WARNING] Odoo Security Risk" msgstr "" diff --git a/auth_admin_passkey/i18n/it.po b/auth_admin_passkey/i18n/it.po index 99ce54fbe..880e1e2db 100644 --- a/auth_admin_passkey/i18n/it.po +++ b/auth_admin_passkey/i18n/it.po @@ -68,18 +68,18 @@ msgstr "Utenti" #: help:base.config.settings,auth_admin_passkey_send_to_user:0 msgid "" "When the administrator use his password to login in with a different " -"account, OpenERP will send an email to the account user." +"account, Odoo will send an email to the account user." msgstr "" #. module: auth_admin_passkey #: help:base.config.settings,auth_admin_passkey_send_to_admin:0 msgid "" "When the administrator use his password to login in with a different " -"account, OpenERP will send an email to the admin user." +"account, Odoo will send an email to the admin user." msgstr "" #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/model/res_users.py:86 #, python-format -msgid "[WARNING] OpenERP Security Risk" +msgid "[WARNING] Odoo Security Risk" msgstr "" diff --git a/auth_admin_passkey/i18n/pt_BR.po b/auth_admin_passkey/i18n/pt_BR.po index ac24c3633..c38ebaead 100644 --- a/auth_admin_passkey/i18n/pt_BR.po +++ b/auth_admin_passkey/i18n/pt_BR.po @@ -76,18 +76,18 @@ msgstr "Usuários" #: help:base.config.settings,auth_admin_passkey_send_to_user:0 msgid "" "When the administrator use his password to login in with a different " -"account, OpenERP will send an email to the account user." +"account, Odoo will send an email to the account user." msgstr "Quando o administrador usa sua senha para dar login com uma conta diferente, OPENERP irá enviar um email para a conta do usuário." #. module: auth_admin_passkey #: help:base.config.settings,auth_admin_passkey_send_to_admin:0 msgid "" "When the administrator use his password to login in with a different " -"account, OpenERP will send an email to the admin user." +"account, Odoo will send an email to the admin user." msgstr "Quando o administrador usa sua senha para dar login com uma conta diferente, OPENERP irá enviar um email para a conta do administrador." #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/models/res_users.py:67 #, python-format -msgid "[WARNING] OpenERP Security Risk" -msgstr "[AVISO] OpenERP Risco de Segurança" +msgid "[WARNING] Odoo Security Risk" +msgstr "[AVISO] Odoo Risco de Segurança" diff --git a/auth_admin_passkey/i18n/sl.po b/auth_admin_passkey/i18n/sl.po index 6763bec43..906144241 100644 --- a/auth_admin_passkey/i18n/sl.po +++ b/auth_admin_passkey/i18n/sl.po @@ -76,18 +76,18 @@ msgstr "Uporabniki" #: help:base.config.settings,auth_admin_passkey_send_to_user:0 msgid "" "When the administrator use his password to login in with a different " -"account, OpenERP will send an email to the account user." -msgstr "Ko administrator uporabi svoje geslo za prijavo v drug račun, bo OpenERP poslal e-pošto uporabniku računa." +"account, Odoo will send an email to the account user." +msgstr "Ko administrator uporabi svoje geslo za prijavo v drug račun, bo Odoo poslal e-pošto uporabniku računa." #. module: auth_admin_passkey #: help:base.config.settings,auth_admin_passkey_send_to_admin:0 msgid "" "When the administrator use his password to login in with a different " -"account, OpenERP will send an email to the admin user." -msgstr "Ko administrator uporabi svoje geslo za prijavo v drug račun, bo OpenERP poslal e-pošto administratorju." +"account, Odoo will send an email to the admin user." +msgstr "Ko administrator uporabi svoje geslo za prijavo v drug račun, bo Odoo poslal e-pošto administratorju." #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/models/res_users.py:67 #, python-format -msgid "[WARNING] OpenERP Security Risk" -msgstr "[OPOZORILO] OpenERP varnostno tveganje" +msgid "[WARNING] Odoo Security Risk" +msgstr "[OPOZORILO] Odoo varnostno tveganje" diff --git a/auth_admin_passkey/i18n/tr.po b/auth_admin_passkey/i18n/tr.po index 9cf30e4ed..aa2cb2a96 100644 --- a/auth_admin_passkey/i18n/tr.po +++ b/auth_admin_passkey/i18n/tr.po @@ -75,18 +75,18 @@ msgstr "Kullanıcılar" #: help:base.config.settings,auth_admin_passkey_send_to_user:0 msgid "" "When the administrator use his password to login in with a different " -"account, OpenERP will send an email to the account user." +"account, Odoo will send an email to the account user." msgstr "Yönetici farklı bir hesaba şifresiyle giriş yaparsa. Odoo hesap sahibine e-posta gönderecek." #. module: auth_admin_passkey #: help:base.config.settings,auth_admin_passkey_send_to_admin:0 msgid "" "When the administrator use his password to login in with a different " -"account, OpenERP will send an email to the admin user." +"account, Odoo will send an email to the admin user." msgstr "Yönetici şifresiyle farklı bir kullanıcının hesabına giriş yaparsa, Odoo yöneticiye e-posta gönderir." #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/models/res_users.py:67 #, python-format -msgid "[WARNING] OpenERP Security Risk" +msgid "[WARNING] Odoo Security Risk" msgstr "[UYARI] Odoo Güvenlik Riski" diff --git a/auth_admin_passkey/i18n/tr_TR.po b/auth_admin_passkey/i18n/tr_TR.po index 941541286..0b2214a0f 100644 --- a/auth_admin_passkey/i18n/tr_TR.po +++ b/auth_admin_passkey/i18n/tr_TR.po @@ -67,18 +67,18 @@ msgstr "Kullanıcılar" #: help:base.config.settings,auth_admin_passkey_send_to_user:0 msgid "" "When the administrator use his password to login in with a different " -"account, OpenERP will send an email to the account user." +"account, Odoo will send an email to the account user." msgstr "" #. module: auth_admin_passkey #: help:base.config.settings,auth_admin_passkey_send_to_admin:0 msgid "" "When the administrator use his password to login in with a different " -"account, OpenERP will send an email to the admin user." +"account, Odoo will send an email to the admin user." msgstr "" #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/models/res_users.py:67 #, python-format -msgid "[WARNING] OpenERP Security Risk" +msgid "[WARNING] Odoo Security Risk" msgstr "" diff --git a/auth_admin_passkey/models/__init__.py b/auth_admin_passkey/models/__init__.py index 60c3790aa..364290a16 100644 --- a/auth_admin_passkey/models/__init__.py +++ b/auth_admin_passkey/models/__init__.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Admin Passkey module for OpenERP +# Admin Passkey module for Odoo # Copyright (C) 2013-2014 GRAP (http://www.grap.coop) # @author Sylvain LE GAL (https://twitter.com/legalsylvain) # diff --git a/auth_admin_passkey/models/res_config.py b/auth_admin_passkey/models/res_config.py index 62c34d287..f521bf7d9 100644 --- a/auth_admin_passkey/models/res_config.py +++ b/auth_admin_passkey/models/res_config.py @@ -43,11 +43,11 @@ class BaseConfigSettings(models.TransientModel): auth_admin_passkey_send_to_admin = fields.Boolean( string='Send email to admin user.', help="""When the administrator use his password to login in """ - """with a different account, OpenERP will send an email """ + """with a different account, Odoo will send an email """ """to the admin user.""") auth_admin_passkey_send_to_user = fields.Boolean( string='Send email to user.', help="""When the administrator use his password to login in """ - """with a different account, OpenERP will send an email """ + """with a different account, Odoo will send an email """ """to the account user.""") diff --git a/auth_admin_passkey/models/res_users.py b/auth_admin_passkey/models/res_users.py index e2495143e..44f84859f 100644 --- a/auth_admin_passkey/models/res_users.py +++ b/auth_admin_passkey/models/res_users.py @@ -64,7 +64,7 @@ class ResUsers(models.Model): mail = mail_obj.sudo().create({ 'email_to': admin_user.email, 'subject': self._get_translation( - admin_user.lang, _('[WARNING] OpenERP Security Risk')), + admin_user.lang, _('[WARNING] Odoo Security Risk')), 'body_html': self._get_translation( admin_user.lang, _( """
User with login '%s' has the same """
diff --git a/auth_admin_passkey/tests/__init__.py b/auth_admin_passkey/tests/__init__.py
index 8150785b1..48547d84d 100644
--- a/auth_admin_passkey/tests/__init__.py
+++ b/auth_admin_passkey/tests/__init__.py
@@ -1,7 +1,7 @@
 # -*- encoding: utf-8 -*-
 ##############################################################################
 #
-#    Admin Passkey module for OpenERP
+#    Admin Passkey module for Odoo
 #    Copyright (C) 2013-2014 GRAP (http://www.grap.coop)
 #    @author Sylvain LE GAL (https://twitter.com/legalsylvain)
 #
diff --git a/auth_admin_passkey/views/res_config_view.xml b/auth_admin_passkey/views/res_config_view.xml
index 990729705..2fec2a6ff 100644
--- a/auth_admin_passkey/views/res_config_view.xml
+++ b/auth_admin_passkey/views/res_config_view.xml
@@ -1,6 +1,6 @@
 
 
-
+
 
 
 

From 118c4592bb621610a6a26d58087df90124fc91ee Mon Sep 17 00:00:00 2001
From: OCA Transbot 
Date: Sat, 14 Jan 2017 02:31:15 -0500
Subject: [PATCH 05/10] OCA Transbot updated translations from Transifex

---
 auth_admin_passkey/i18n/ar.po    | 84 ++++++++++++++++++++++++++++++++
 auth_admin_passkey/i18n/ca.po    | 84 ++++++++++++++++++++++++++++++++
 auth_admin_passkey/i18n/el_GR.po | 84 ++++++++++++++++++++++++++++++++
 auth_admin_passkey/i18n/es_ES.po | 84 ++++++++++++++++++++++++++++++++
 auth_admin_passkey/i18n/hr.po    | 84 ++++++++++++++++++++++++++++++++
 auth_admin_passkey/i18n/hr_HR.po | 84 ++++++++++++++++++++++++++++++++
 auth_admin_passkey/i18n/nl.po    | 84 ++++++++++++++++++++++++++++++++
 auth_admin_passkey/i18n/zh_CN.po | 84 ++++++++++++++++++++++++++++++++
 8 files changed, 672 insertions(+)
 create mode 100644 auth_admin_passkey/i18n/ar.po
 create mode 100644 auth_admin_passkey/i18n/ca.po
 create mode 100644 auth_admin_passkey/i18n/el_GR.po
 create mode 100644 auth_admin_passkey/i18n/es_ES.po
 create mode 100644 auth_admin_passkey/i18n/hr.po
 create mode 100644 auth_admin_passkey/i18n/hr_HR.po
 create mode 100644 auth_admin_passkey/i18n/nl.po
 create mode 100644 auth_admin_passkey/i18n/zh_CN.po

diff --git a/auth_admin_passkey/i18n/ar.po b/auth_admin_passkey/i18n/ar.po
new file mode 100644
index 000000000..1cc1d0fdd
--- /dev/null
+++ b/auth_admin_passkey/i18n/ar.po
@@ -0,0 +1,84 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * auth_admin_passkey
+# 
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: server-tools (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-01-12 03:50+0000\n"
+"PO-Revision-Date: 2017-01-11 15:36+0000\n"
+"Last-Translator: OCA Transbot \n"
+"Language-Team: Arabic (http://www.transifex.com/oca/OCA-server-tools-8-0/language/ar/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: ar\n"
+"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
+
+#. module: auth_admin_passkey
+#: code:addons/auth_admin_passkey/models/res_users.py:69
+#, python-format
+msgid "
User with login '%s' has the same password as you.
" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:44 +#, python-format +msgid "" +"Admin user used his passkey to login with '%s'.\n" +"\n" +"\n" +"\n" +"Technicals informations belows : \n" +"\n" +"- Login date : %s\n" +"\n" +msgstr "" + +#. module: auth_admin_passkey +#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +msgid "Passkey" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:41 +#, python-format +msgid "Passkey used" +msgstr "" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "Send email to admin user." +msgstr "" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "Send email to user." +msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_res_users +msgid "Users" +msgstr "المستخدمون" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, Odoo will send an email to the account user." +msgstr "" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, Odoo will send an email to the admin user." +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:67 +#, python-format +msgid "[WARNING] Odoo Security Risk" +msgstr "" diff --git a/auth_admin_passkey/i18n/ca.po b/auth_admin_passkey/i18n/ca.po new file mode 100644 index 000000000..ed06ecf5d --- /dev/null +++ b/auth_admin_passkey/i18n/ca.po @@ -0,0 +1,84 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_admin_passkey +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-01-17 07:51+0000\n" +"PO-Revision-Date: 2015-09-18 13:53+0000\n" +"Last-Translator: <>\n" +"Language-Team: Catalan (http://www.transifex.com/oca/OCA-server-tools-8-0/language/ca/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: ca\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:69 +#, python-format +msgid "
User with login '%s' has the same password as you.
" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:44 +#, python-format +msgid "" +"Admin user used his passkey to login with '%s'.\n" +"\n" +"\n" +"\n" +"Technicals informations belows : \n" +"\n" +"- Login date : %s\n" +"\n" +msgstr "" + +#. module: auth_admin_passkey +#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +msgid "Passkey" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:41 +#, python-format +msgid "Passkey used" +msgstr "" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "Send email to admin user." +msgstr "" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "Send email to user." +msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_res_users +msgid "Users" +msgstr "Usuaris" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, Odoo will send an email to the account user." +msgstr "" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, Odoo will send an email to the admin user." +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:67 +#, python-format +msgid "[WARNING] Odoo Security Risk" +msgstr "" diff --git a/auth_admin_passkey/i18n/el_GR.po b/auth_admin_passkey/i18n/el_GR.po new file mode 100644 index 000000000..24cec4001 --- /dev/null +++ b/auth_admin_passkey/i18n/el_GR.po @@ -0,0 +1,84 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_admin_passkey +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-01-12 03:50+0000\n" +"PO-Revision-Date: 2015-09-18 13:53+0000\n" +"Last-Translator: <>\n" +"Language-Team: Greek (Greece) (http://www.transifex.com/oca/OCA-server-tools-8-0/language/el_GR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: el_GR\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:69 +#, python-format +msgid "
User with login '%s' has the same password as you.
" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:44 +#, python-format +msgid "" +"Admin user used his passkey to login with '%s'.\n" +"\n" +"\n" +"\n" +"Technicals informations belows : \n" +"\n" +"- Login date : %s\n" +"\n" +msgstr "" + +#. module: auth_admin_passkey +#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +msgid "Passkey" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:41 +#, python-format +msgid "Passkey used" +msgstr "" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "Send email to admin user." +msgstr "" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "Send email to user." +msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_res_users +msgid "Users" +msgstr "Χρήστες" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, Odoo will send an email to the account user." +msgstr "" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, Odoo will send an email to the admin user." +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:67 +#, python-format +msgid "[WARNING] Odoo Security Risk" +msgstr "" diff --git a/auth_admin_passkey/i18n/es_ES.po b/auth_admin_passkey/i18n/es_ES.po new file mode 100644 index 000000000..46ac03bae --- /dev/null +++ b/auth_admin_passkey/i18n/es_ES.po @@ -0,0 +1,84 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_admin_passkey +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-01-12 03:50+0000\n" +"PO-Revision-Date: 2015-09-18 13:53+0000\n" +"Last-Translator: <>\n" +"Language-Team: Spanish (Spain) (http://www.transifex.com/oca/OCA-server-tools-8-0/language/es_ES/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es_ES\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:69 +#, python-format +msgid "
User with login '%s' has the same password as you.
" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:44 +#, python-format +msgid "" +"Admin user used his passkey to login with '%s'.\n" +"\n" +"\n" +"\n" +"Technicals informations belows : \n" +"\n" +"- Login date : %s\n" +"\n" +msgstr "" + +#. module: auth_admin_passkey +#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +msgid "Passkey" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:41 +#, python-format +msgid "Passkey used" +msgstr "" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "Send email to admin user." +msgstr "" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "Send email to user." +msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_res_users +msgid "Users" +msgstr "Usuarios" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, Odoo will send an email to the account user." +msgstr "" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, Odoo will send an email to the admin user." +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:67 +#, python-format +msgid "[WARNING] Odoo Security Risk" +msgstr "" diff --git a/auth_admin_passkey/i18n/hr.po b/auth_admin_passkey/i18n/hr.po new file mode 100644 index 000000000..f17e58925 --- /dev/null +++ b/auth_admin_passkey/i18n/hr.po @@ -0,0 +1,84 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_admin_passkey +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-01-12 03:50+0000\n" +"PO-Revision-Date: 2015-09-18 13:53+0000\n" +"Last-Translator: <>\n" +"Language-Team: Croatian (http://www.transifex.com/oca/OCA-server-tools-8-0/language/hr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:69 +#, python-format +msgid "
User with login '%s' has the same password as you.
" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:44 +#, python-format +msgid "" +"Admin user used his passkey to login with '%s'.\n" +"\n" +"\n" +"\n" +"Technicals informations belows : \n" +"\n" +"- Login date : %s\n" +"\n" +msgstr "" + +#. module: auth_admin_passkey +#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +msgid "Passkey" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:41 +#, python-format +msgid "Passkey used" +msgstr "" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "Send email to admin user." +msgstr "" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "Send email to user." +msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_res_users +msgid "Users" +msgstr "Korisnici" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, Odoo will send an email to the account user." +msgstr "" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, Odoo will send an email to the admin user." +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:67 +#, python-format +msgid "[WARNING] Odoo Security Risk" +msgstr "" diff --git a/auth_admin_passkey/i18n/hr_HR.po b/auth_admin_passkey/i18n/hr_HR.po new file mode 100644 index 000000000..310b083ce --- /dev/null +++ b/auth_admin_passkey/i18n/hr_HR.po @@ -0,0 +1,84 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_admin_passkey +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-01-12 03:50+0000\n" +"PO-Revision-Date: 2017-01-11 15:38+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Croatian (Croatia) (http://www.transifex.com/oca/OCA-server-tools-8-0/language/hr_HR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr_HR\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:69 +#, python-format +msgid "
User with login '%s' has the same password as you.
" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:44 +#, python-format +msgid "" +"Admin user used his passkey to login with '%s'.\n" +"\n" +"\n" +"\n" +"Technicals informations belows : \n" +"\n" +"- Login date : %s\n" +"\n" +msgstr "" + +#. module: auth_admin_passkey +#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +msgid "Passkey" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:41 +#, python-format +msgid "Passkey used" +msgstr "" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "Send email to admin user." +msgstr "" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "Send email to user." +msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_res_users +msgid "Users" +msgstr "Korisnici" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, Odoo will send an email to the account user." +msgstr "" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, Odoo will send an email to the admin user." +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:67 +#, python-format +msgid "[WARNING] Odoo Security Risk" +msgstr "" diff --git a/auth_admin_passkey/i18n/nl.po b/auth_admin_passkey/i18n/nl.po new file mode 100644 index 000000000..bda1f748e --- /dev/null +++ b/auth_admin_passkey/i18n/nl.po @@ -0,0 +1,84 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_admin_passkey +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-01-12 03:50+0000\n" +"PO-Revision-Date: 2015-09-18 13:53+0000\n" +"Last-Translator: <>\n" +"Language-Team: Dutch (http://www.transifex.com/oca/OCA-server-tools-8-0/language/nl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: nl\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:69 +#, python-format +msgid "
User with login '%s' has the same password as you.
" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:44 +#, python-format +msgid "" +"Admin user used his passkey to login with '%s'.\n" +"\n" +"\n" +"\n" +"Technicals informations belows : \n" +"\n" +"- Login date : %s\n" +"\n" +msgstr "" + +#. module: auth_admin_passkey +#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +msgid "Passkey" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:41 +#, python-format +msgid "Passkey used" +msgstr "" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "Send email to admin user." +msgstr "" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "Send email to user." +msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_res_users +msgid "Users" +msgstr "Gebruikers" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, Odoo will send an email to the account user." +msgstr "" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, Odoo will send an email to the admin user." +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:67 +#, python-format +msgid "[WARNING] Odoo Security Risk" +msgstr "" diff --git a/auth_admin_passkey/i18n/zh_CN.po b/auth_admin_passkey/i18n/zh_CN.po new file mode 100644 index 000000000..e4ab77353 --- /dev/null +++ b/auth_admin_passkey/i18n/zh_CN.po @@ -0,0 +1,84 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_admin_passkey +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-01-12 03:50+0000\n" +"PO-Revision-Date: 2015-09-18 13:53+0000\n" +"Last-Translator: <>\n" +"Language-Team: Chinese (China) (http://www.transifex.com/oca/OCA-server-tools-8-0/language/zh_CN/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: zh_CN\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:69 +#, python-format +msgid "
User with login '%s' has the same password as you.
" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:44 +#, python-format +msgid "" +"Admin user used his passkey to login with '%s'.\n" +"\n" +"\n" +"\n" +"Technicals informations belows : \n" +"\n" +"- Login date : %s\n" +"\n" +msgstr "" + +#. module: auth_admin_passkey +#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +msgid "Passkey" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:41 +#, python-format +msgid "Passkey used" +msgstr "" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "Send email to admin user." +msgstr "" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "Send email to user." +msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_res_users +msgid "Users" +msgstr "用户" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, Odoo will send an email to the account user." +msgstr "" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, Odoo will send an email to the admin user." +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:67 +#, python-format +msgid "[WARNING] Odoo Security Risk" +msgstr "" From 8c8fea08949d29f48f4ec39eb5b7f8dbff49d830 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 28 Feb 2017 12:53:34 +0100 Subject: [PATCH 06/10] auth_admin_passkey bug #699 --- auth_admin_passkey/models/res_users.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/auth_admin_passkey/models/res_users.py b/auth_admin_passkey/models/res_users.py index 44f84859f..5ce02da5d 100644 --- a/auth_admin_passkey/models/res_users.py +++ b/auth_admin_passkey/models/res_users.py @@ -55,13 +55,13 @@ class ResUsers(models.Model): mail.send(auto_commit=True) @api.cr - def _send_email_same_password(self, login_user): + def _send_email_same_password(self, cr, login_user): """ Send a email to the admin user to inform that another user has the same password as him.""" - mail_obj = self.env['mail.mail'] - admin_user = self.sudo().browse(SUPERUSER_ID) + mail_obj = self.pool['mail.mail'] + admin_user = self.browse(cr, SUPERUSER_ID, SUPERUSER_ID) if admin_user.email: - mail = mail_obj.sudo().create({ + mail_id = mail_obj.create(cr, SUPERUSER_ID, { 'email_to': admin_user.email, 'subject': self._get_translation( admin_user.lang, _('[WARNING] Odoo Security Risk')), @@ -70,7 +70,7 @@ class ResUsers(models.Model): """
User with login '%s' has the same """
                         """password as you.
""")) % (login_user), }) - mail.send(auto_commit=True) + mail_obj.send(cr, SUPERUSER_ID, [mail_id], auto_commit=True) # Overload Section def authenticate(self, db, login, password, user_agent_env): From 1fe54a4b62fb7dae504ad18271b2114f7142ae18 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 28 Feb 2017 16:21:57 +0100 Subject: [PATCH 07/10] crash when the options "Send email to ..." on the configuration page are unchecked --- auth_admin_passkey/models/res_users.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/auth_admin_passkey/models/res_users.py b/auth_admin_passkey/models/res_users.py index 5ce02da5d..d0f8dbcdd 100644 --- a/auth_admin_passkey/models/res_users.py +++ b/auth_admin_passkey/models/res_users.py @@ -25,12 +25,10 @@ class ResUsers(models.Model): icp_obj = self.env['ir.config_parameter'] admin_user = self.sudo().browse(SUPERUSER_ID) login_user = self.sudo().browse(self.env.uid) - send_to_admin = safe_eval(icp_obj.sudo().get_param( - 'auth_admin_passkey.send_to_admin', - 'True')) - send_to_user = safe_eval(icp_obj.sudo().get_param( - 'auth_admin_passkey.send_to_user', - 'True')) + send_to_admin = icp_obj.sudo().get_param( + 'auth_admin_passkey.send_to_admin') == 'True' and True or False + send_to_user = icp_obj.sudo().get_param( + 'auth_admin_passkey.send_to_user') == 'True' and True or False if send_to_admin and admin_user.email: mails.append({'email': admin_user.email, 'lang': admin_user.lang}) From d899724310ffaf476734cc03105619c402ea65d7 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 2 Mar 2017 10:22:46 +0100 Subject: [PATCH 08/10] PEP8 fix --- auth_admin_passkey/models/res_users.py | 1 - 1 file changed, 1 deletion(-) diff --git a/auth_admin_passkey/models/res_users.py b/auth_admin_passkey/models/res_users.py index d0f8dbcdd..8bb598fe3 100644 --- a/auth_admin_passkey/models/res_users.py +++ b/auth_admin_passkey/models/res_users.py @@ -6,7 +6,6 @@ import datetime from openerp import _, api, exceptions, models, registry, SUPERUSER_ID -from openerp.tools.safe_eval import safe_eval class ResUsers(models.Model): From 20d41386a42f1d2723acbc1f8a8aa544d609ca3e Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 4 Mar 2017 02:23:28 -0500 Subject: [PATCH 09/10] OCA Transbot updated translations from Transifex --- auth_admin_passkey/i18n/da.po | 84 ++++++++++++++++++++++++++++++++ auth_admin_passkey/i18n/de.po | 14 +++--- auth_admin_passkey/i18n/es.po | 15 +++--- auth_admin_passkey/i18n/fr.po | 13 ++--- auth_admin_passkey/i18n/pt_BR.po | 15 +++--- auth_admin_passkey/i18n/sl.po | 12 ++--- auth_admin_passkey/i18n/tr.po | 15 +++--- 7 files changed, 128 insertions(+), 40 deletions(-) create mode 100644 auth_admin_passkey/i18n/da.po diff --git a/auth_admin_passkey/i18n/da.po b/auth_admin_passkey/i18n/da.po new file mode 100644 index 000000000..61748c6eb --- /dev/null +++ b/auth_admin_passkey/i18n/da.po @@ -0,0 +1,84 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_admin_passkey +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-03-18 02:08+0000\n" +"PO-Revision-Date: 2015-09-18 13:53+0000\n" +"Last-Translator: <>\n" +"Language-Team: Danish (http://www.transifex.com/oca/OCA-server-tools-8-0/language/da/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: da\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:66 +#, python-format +msgid "
User with login '%s' has the same password as you.
" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:41 +#, python-format +msgid "" +"Admin user used his passkey to login with '%s'.\n" +"\n" +"\n" +"\n" +"Technicals informations belows : \n" +"\n" +"- Login date : %s\n" +"\n" +msgstr "" + +#. module: auth_admin_passkey +#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +msgid "Passkey" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:38 +#, python-format +msgid "Passkey used" +msgstr "" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "Send email to admin user." +msgstr "" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "Send email to user." +msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_res_users +msgid "Users" +msgstr "Brugere" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, Odoo will send an email to the account user." +msgstr "" + +#. module: auth_admin_passkey +#: help:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "" +"When the administrator use his password to login in with a different " +"account, Odoo will send an email to the admin user." +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/models/res_users.py:64 +#, python-format +msgid "[WARNING] Odoo Security Risk" +msgstr "" diff --git a/auth_admin_passkey/i18n/de.po b/auth_admin_passkey/i18n/de.po index 5396ea7f1..0ffea7afa 100644 --- a/auth_admin_passkey/i18n/de.po +++ b/auth_admin_passkey/i18n/de.po @@ -14,9 +14,9 @@ msgid "" msgstr "" "Project-Id-Version: server-tools (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-11-28 21:28+0000\n" -"PO-Revision-Date: 2016-11-22 12:27+0000\n" -"Last-Translator: Rudolf Schnapka \n" +"POT-Creation-Date: 2017-03-02 09:58+0000\n" +"PO-Revision-Date: 2017-01-10 14:40+0000\n" +"Last-Translator: OCA Transbot \n" "Language-Team: German (http://www.transifex.com/oca/OCA-server-tools-8-0/language/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -25,13 +25,13 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:69 +#: code:addons/auth_admin_passkey/models/res_users.py:66 #, python-format msgid "
User with login '%s' has the same password as you.
" msgstr "
Benutzer mit Anmeldename '%s' hat das gleiche Passwort wie Sie.
" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:44 +#: code:addons/auth_admin_passkey/models/res_users.py:41 #, python-format msgid "" "Admin user used his passkey to login with '%s'.\n" @@ -50,7 +50,7 @@ msgid "Passkey" msgstr "PassKey" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:41 +#: code:addons/auth_admin_passkey/models/res_users.py:38 #, python-format msgid "Passkey used" msgstr "Verwendeter PassKey" @@ -85,7 +85,7 @@ msgid "" msgstr "Wenn der Administrator sein Passwort verwendet, um sich als anderer Benutzer anzumelden, wird Oddoeine entsprechende Email an den Admin-Nutzer senden." #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:67 +#: code:addons/auth_admin_passkey/models/res_users.py:64 #, python-format msgid "[WARNING] Odoo Security Risk" msgstr "[Warnung] Odoo Sicherheitsrisiko" diff --git a/auth_admin_passkey/i18n/es.po b/auth_admin_passkey/i18n/es.po index 313b5c154..d1acd42b6 100644 --- a/auth_admin_passkey/i18n/es.po +++ b/auth_admin_passkey/i18n/es.po @@ -4,6 +4,7 @@ # # Translators: # Ahmet Altinisik , 2016 +# Ahmet Altinisik , 2016 # Antonio Trueba, 2016 # Antonio Trueba, 2016 # FIRST AUTHOR , 2013 @@ -16,9 +17,9 @@ msgid "" msgstr "" "Project-Id-Version: server-tools (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-11-28 21:28+0000\n" -"PO-Revision-Date: 2016-10-24 09:24+0000\n" -"Last-Translator: Antonio Trueba\n" +"POT-Creation-Date: 2017-03-02 09:58+0000\n" +"PO-Revision-Date: 2017-01-11 15:36+0000\n" +"Last-Translator: OCA Transbot \n" "Language-Team: Spanish (http://www.transifex.com/oca/OCA-server-tools-8-0/language/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -27,13 +28,13 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:69 +#: code:addons/auth_admin_passkey/models/res_users.py:66 #, python-format msgid "
User with login '%s' has the same password as you.
" msgstr "
El usuario con identificador '%s' tiene la misma contraseña que usted.
" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:44 +#: code:addons/auth_admin_passkey/models/res_users.py:41 #, python-format msgid "" "Admin user used his passkey to login with '%s'.\n" @@ -52,7 +53,7 @@ msgid "Passkey" msgstr "" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:41 +#: code:addons/auth_admin_passkey/models/res_users.py:38 #, python-format msgid "Passkey used" msgstr "" @@ -87,7 +88,7 @@ msgid "" msgstr "" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:67 +#: code:addons/auth_admin_passkey/models/res_users.py:64 #, python-format msgid "[WARNING] Odoo Security Risk" msgstr "" diff --git a/auth_admin_passkey/i18n/fr.po b/auth_admin_passkey/i18n/fr.po index c5354f83d..4884e8837 100644 --- a/auth_admin_passkey/i18n/fr.po +++ b/auth_admin_passkey/i18n/fr.po @@ -4,6 +4,7 @@ # # Translators: # Ahmet Altinisik , 2015 +# Ahmet Altinisik , 2015 # FIRST AUTHOR , 2012 # Hotellook, 2014 # Jarmo Kortetjärvi , 2016 @@ -14,8 +15,8 @@ msgid "" msgstr "" "Project-Id-Version: server-tools (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-11-28 21:28+0000\n" -"PO-Revision-Date: 2016-11-22 12:24+0000\n" +"POT-Creation-Date: 2017-03-02 09:58+0000\n" +"PO-Revision-Date: 2017-01-12 18:08+0000\n" "Last-Translator: OCA Transbot \n" "Language-Team: French (http://www.transifex.com/oca/OCA-server-tools-8-0/language/fr/)\n" "MIME-Version: 1.0\n" @@ -25,13 +26,13 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:69 +#: code:addons/auth_admin_passkey/models/res_users.py:66 #, python-format msgid "
User with login '%s' has the same password as you.
" msgstr "
L'utilisateur dont l'identifiant est '%s' a le même mot de passe que vous.
" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:44 +#: code:addons/auth_admin_passkey/models/res_users.py:41 #, python-format msgid "" "Admin user used his passkey to login with '%s'.\n" @@ -50,7 +51,7 @@ msgid "Passkey" msgstr "Mot de passe \"bris de glace\"" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:41 +#: code:addons/auth_admin_passkey/models/res_users.py:38 #, python-format msgid "Passkey used" msgstr "Mot de passe \"bris de glace\" utilisé" @@ -85,7 +86,7 @@ msgid "" msgstr "Quand l'administrateur utilise son mot de passe pour s'authentifier avec un compte différent, Odoo enverra un mail à l'utilisateur." #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:67 +#: code:addons/auth_admin_passkey/models/res_users.py:64 #, python-format msgid "[WARNING] Odoo Security Risk" msgstr "[WARNING] Faille de sécurité sur Odoo" diff --git a/auth_admin_passkey/i18n/pt_BR.po b/auth_admin_passkey/i18n/pt_BR.po index c38ebaead..cfdb9fc64 100644 --- a/auth_admin_passkey/i18n/pt_BR.po +++ b/auth_admin_passkey/i18n/pt_BR.po @@ -5,6 +5,7 @@ # Translators: # Armando Vulcano Junior , 2015 # Bole , 2015 +# Bole , 2015 # FIRST AUTHOR , 2012 # Gustavo Lepri , 2015 # Jarmo Kortetjärvi , 2016 @@ -16,9 +17,9 @@ msgid "" msgstr "" "Project-Id-Version: server-tools (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-11-28 21:28+0000\n" -"PO-Revision-Date: 2016-10-24 09:24+0000\n" -"Last-Translator: Armando Vulcano Junior \n" +"POT-Creation-Date: 2017-03-02 09:58+0000\n" +"PO-Revision-Date: 2017-01-11 15:39+0000\n" +"Last-Translator: OCA Transbot \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-server-tools-8-0/language/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -27,13 +28,13 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:69 +#: code:addons/auth_admin_passkey/models/res_users.py:66 #, python-format msgid "
User with login '%s' has the same password as you.
" msgstr "
Usuário com login '%s' tem a mesma senha que você.
" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:44 +#: code:addons/auth_admin_passkey/models/res_users.py:41 #, python-format msgid "" "Admin user used his passkey to login with '%s'.\n" @@ -52,7 +53,7 @@ msgid "Passkey" msgstr "Passkey" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:41 +#: code:addons/auth_admin_passkey/models/res_users.py:38 #, python-format msgid "Passkey used" msgstr "Passkey usada" @@ -87,7 +88,7 @@ msgid "" msgstr "Quando o administrador usa sua senha para dar login com uma conta diferente, OPENERP irá enviar um email para a conta do administrador." #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:67 +#: code:addons/auth_admin_passkey/models/res_users.py:64 #, python-format msgid "[WARNING] Odoo Security Risk" msgstr "[AVISO] Odoo Risco de Segurança" diff --git a/auth_admin_passkey/i18n/sl.po b/auth_admin_passkey/i18n/sl.po index 906144241..fbe9059ff 100644 --- a/auth_admin_passkey/i18n/sl.po +++ b/auth_admin_passkey/i18n/sl.po @@ -16,8 +16,8 @@ msgid "" msgstr "" "Project-Id-Version: server-tools (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-11-28 21:28+0000\n" -"PO-Revision-Date: 2016-10-24 09:24+0000\n" +"POT-Creation-Date: 2017-03-02 09:58+0000\n" +"PO-Revision-Date: 2017-01-12 08:24+0000\n" "Last-Translator: Matjaž Mozetič \n" "Language-Team: Slovenian (http://www.transifex.com/oca/OCA-server-tools-8-0/language/sl/)\n" "MIME-Version: 1.0\n" @@ -27,13 +27,13 @@ msgstr "" "Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:69 +#: code:addons/auth_admin_passkey/models/res_users.py:66 #, python-format msgid "
User with login '%s' has the same password as you.
" msgstr "
Uporabnik '%s' ima enako geslo kot vi.
" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:44 +#: code:addons/auth_admin_passkey/models/res_users.py:41 #, python-format msgid "" "Admin user used his passkey to login with '%s'.\n" @@ -52,7 +52,7 @@ msgid "Passkey" msgstr "Prijavni ključ" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:41 +#: code:addons/auth_admin_passkey/models/res_users.py:38 #, python-format msgid "Passkey used" msgstr "Uporabljen prijavni ključ" @@ -87,7 +87,7 @@ msgid "" msgstr "Ko administrator uporabi svoje geslo za prijavo v drug račun, bo Odoo poslal e-pošto administratorju." #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:67 +#: code:addons/auth_admin_passkey/models/res_users.py:64 #, python-format msgid "[WARNING] Odoo Security Risk" msgstr "[OPOZORILO] Odoo varnostno tveganje" diff --git a/auth_admin_passkey/i18n/tr.po b/auth_admin_passkey/i18n/tr.po index aa2cb2a96..0fc18c1d2 100644 --- a/auth_admin_passkey/i18n/tr.po +++ b/auth_admin_passkey/i18n/tr.po @@ -4,6 +4,7 @@ # # Translators: # Ahmet Altinisik , 2016 +# Ahmet Altinisik , 2016 # FIRST AUTHOR , 2013-2014 # Giacomo , 2015 # Hotellook, 2014 @@ -15,9 +16,9 @@ msgid "" msgstr "" "Project-Id-Version: server-tools (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-11-28 21:28+0000\n" -"PO-Revision-Date: 2016-11-22 12:26+0000\n" -"Last-Translator: Ahmet Altinisik \n" +"POT-Creation-Date: 2017-03-02 09:58+0000\n" +"PO-Revision-Date: 2017-01-11 15:35+0000\n" +"Last-Translator: OCA Transbot \n" "Language-Team: Turkish (http://www.transifex.com/oca/OCA-server-tools-8-0/language/tr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -26,13 +27,13 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:69 +#: code:addons/auth_admin_passkey/models/res_users.py:66 #, python-format msgid "
User with login '%s' has the same password as you.
" msgstr "
 '%s' kullanıcısının şifresi sizinkiyle aynı.
" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:44 +#: code:addons/auth_admin_passkey/models/res_users.py:41 #, python-format msgid "" "Admin user used his passkey to login with '%s'.\n" @@ -51,7 +52,7 @@ msgid "Passkey" msgstr "Parola" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:41 +#: code:addons/auth_admin_passkey/models/res_users.py:38 #, python-format msgid "Passkey used" msgstr "Kullanılan parola" @@ -86,7 +87,7 @@ msgid "" msgstr "Yönetici şifresiyle farklı bir kullanıcının hesabına giriş yaparsa, Odoo yöneticiye e-posta gönderir." #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:67 +#: code:addons/auth_admin_passkey/models/res_users.py:64 #, python-format msgid "[WARNING] Odoo Security Risk" msgstr "[UYARI] Odoo Güvenlik Riski" From e16b37ae6d9c1cf71915d5a34a9b3651d0a23d12 Mon Sep 17 00:00:00 2001 From: Alexandre Papin Date: Mon, 13 Mar 2017 23:44:29 +0100 Subject: [PATCH 10/10] auth_admin_passkey: Migrate module for odoo 10 Remove authenticate as check_credentials is dedicated for this purpose. Removed mail translations maybe possible in some way ? Give some space to the code Make the addon compliant to OCA guidelines Adapt readme to new template and compress header in tests Make the addon a python package NOTE: authenticate() method cannot be used in tests because a new cr is created in _login method that does not contains our user. Signed-off-by: Eugen Don --- auth_admin_passkey/README.rst | 98 ++++++++-- auth_admin_passkey/__manifest__.py | 6 +- .../data/ir_config_parameter.xml | 22 +-- .../i18n/auth_admin_passkey.pot | 48 ++--- auth_admin_passkey/models/__init__.py | 31 +--- auth_admin_passkey/models/res_config.py | 65 ++++--- auth_admin_passkey/models/res_users.py | 149 +++++++-------- auth_admin_passkey/tests/__init__.py | 26 +-- .../tests/test_auth_admin_passkey.py | 103 +++++------ auth_admin_passkey/tests/test_ui.py | 171 ++++++++++++++++++ auth_admin_passkey/views/res_config_view.xml | 42 ++--- setup/auth_admin_passkey/odoo/__init__.py | 1 + .../odoo/addons/__init__.py | 1 + .../odoo/addons/auth_admin_passkey | 1 + setup/auth_admin_passkey/setup.py | 6 + 15 files changed, 444 insertions(+), 326 deletions(-) create mode 100644 auth_admin_passkey/tests/test_ui.py create mode 100644 setup/auth_admin_passkey/odoo/__init__.py create mode 100644 setup/auth_admin_passkey/odoo/addons/__init__.py create mode 120000 setup/auth_admin_passkey/odoo/addons/auth_admin_passkey create mode 100644 setup/auth_admin_passkey/setup.py diff --git a/auth_admin_passkey/README.rst b/auth_admin_passkey/README.rst index e49ec6635..00b5f1d2f 100644 --- a/auth_admin_passkey/README.rst +++ b/auth_admin_passkey/README.rst @@ -1,18 +1,80 @@ -Admin password become a passkey for all active logins -===================================================== - -Functionality : ---------------- - * Administrator has now the possibility to login in with any login; - * By default, Odoo will send a mail to user and admin to indicate them; - * If a user and the admin have the same password, admin will be informed; - -Technical information : ------------------------ - * Create two ir_config_parameter to enable / disable mail sending; - -Copyright, Author and Licence : -------------------------------- - * Copyright : 2014, Groupement Régional Alimentaire de Proximité; - * Author : Sylvain LE GAL (https://twitter.com/legalsylvain); - * Licence : AGPL-3 (http://www.gnu.org/licenses/) +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +==================== +Auth Admin - Passkey +==================== + +This module extends the functionality of users module to support loging in with the administrator password +in other user accounts. + +* Administrator has now the possibility to login in with any login; +* By default, Odoo will send a mail to user and admin to indicate them; +* If a user and the admin have the same password, admin will be informed; + + +Configuration +============= + +To enable notifications for login attempts, you need to: + +Go to Settings > General Settings. + +Enable the "Send email to admin user" and / or "Send email to user" checkbox + + +Usage +===== + +To login into a different user account type in the user name of the account and the password of the administrator at the login screen + + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/149/10.0 + + +Known issues / Roadmap +====================== + +None + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smash it by providing detailed and welcomed feedback. + +Credits +======= + +Images +------ + +* Odoo Community Association: `Icon `_. + +Contributors +------------ + +* Eugen Don +* Alexandre Papin (https://twitter.com/Fenkiou) +* Sylvain LE GAL (https://twitter.com/legalsylvain) + + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/auth_admin_passkey/__manifest__.py b/auth_admin_passkey/__manifest__.py index 2122d131f..d42e5171f 100644 --- a/auth_admin_passkey/__manifest__.py +++ b/auth_admin_passkey/__manifest__.py @@ -5,14 +5,14 @@ { 'name': 'Authentification - Admin Passkey', - 'version': '8.0.2.1.1', + 'version': '10.0.1.0.0', 'category': 'base', 'author': "GRAP,Odoo Community Association (OCA)", 'website': 'http://www.grap.coop', 'license': 'AGPL-3', 'depends': [ 'mail', - ], + ], 'data': [ 'data/ir_config_parameter.xml', 'views/res_config_view.xml', @@ -24,6 +24,6 @@ 'images': [], 'post_load': '', 'application': False, - 'installable': False, + 'installable': True, 'auto_install': False, } diff --git a/auth_admin_passkey/data/ir_config_parameter.xml b/auth_admin_passkey/data/ir_config_parameter.xml index 6b32557a3..c5b16ff72 100644 --- a/auth_admin_passkey/data/ir_config_parameter.xml +++ b/auth_admin_passkey/data/ir_config_parameter.xml @@ -1,23 +1,5 @@ - - - - - - - - - - - - - - - - - - - + @@ -31,4 +13,4 @@ - + diff --git a/auth_admin_passkey/i18n/auth_admin_passkey.pot b/auth_admin_passkey/i18n/auth_admin_passkey.pot index 1cef0a00a..82290c954 100644 --- a/auth_admin_passkey/i18n/auth_admin_passkey.pot +++ b/auth_admin_passkey/i18n/auth_admin_passkey.pot @@ -1,33 +1,13 @@ -############################################################################## -# -# Admin Passkey module for Odoo -# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) -# @author Sylvain LE GAL (https://twitter.com/legalsylvain) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## -# Translation of OpenERP Server. +# Translation of Odoo Server. # This file contains the translation of the following modules: # * auth_admin_passkey # msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-03-23 20:41+0000\n" -"PO-Revision-Date: 2014-03-23 20:41+0000\n" +"POT-Creation-Date: 2017-03-15 19:43+0000\n" +"PO-Revision-Date: 2017-03-15 19:43+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -36,13 +16,13 @@ msgstr "" "Plural-Forms: \n" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:66 +#: code:addons/auth_admin_passkey/models/res_users.py:64 #, python-format msgid "
User with login '%s' has the same password as you.
" msgstr "" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:44 +#: code:addons/auth_admin_passkey/models/res_users.py:39 #, python-format msgid "Admin user used his passkey to login with '%s'.\n" "\n" @@ -56,45 +36,43 @@ msgid "Admin user used his passkey to login with '%s'.\n" msgstr "" #. module: auth_admin_passkey -#: view:base.config.settings:0 +#: model:ir.ui.view,arch_db:auth_admin_passkey.view_res_config_settings msgid "Passkey" msgstr "" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:42 +#: code:addons/auth_admin_passkey/models/res_users.py:38 #, python-format msgid "Passkey used" msgstr "" #. module: auth_admin_passkey -#: field:base.config.settings,auth_admin_passkey_send_to_admin:0 +#: model:ir.model.fields,field_description:auth_admin_passkey.field_base_config_settings_auth_admin_passkey_send_to_admin msgid "Send email to admin user." msgstr "" #. module: auth_admin_passkey -#: field:base.config.settings,auth_admin_passkey_send_to_user:0 +#: model:ir.model.fields,field_description:auth_admin_passkey.field_base_config_settings_auth_admin_passkey_send_to_user msgid "Send email to user." msgstr "" #. module: auth_admin_passkey -#: code:_description:0 #: model:ir.model,name:auth_admin_passkey.model_res_users -#, python-format msgid "Users" msgstr "" #. module: auth_admin_passkey -#: help:base.config.settings,auth_admin_passkey_send_to_user:0 +#: model:ir.model.fields,help:auth_admin_passkey.field_base_config_settings_auth_admin_passkey_send_to_user msgid "When the administrator use his password to login in with a different account, Odoo will send an email to the account user." msgstr "" #. module: auth_admin_passkey -#: help:base.config.settings,auth_admin_passkey_send_to_admin:0 +#: model:ir.model.fields,help:auth_admin_passkey.field_base_config_settings_auth_admin_passkey_send_to_admin msgid "When the administrator use his password to login in with a different account, Odoo will send an email to the admin user." msgstr "" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:64 +#: code:addons/auth_admin_passkey/models/res_users.py:62 #, python-format msgid "[WARNING] Odoo Security Risk" msgstr "" diff --git a/auth_admin_passkey/models/__init__.py b/auth_admin_passkey/models/__init__.py index 364290a16..272a6e850 100644 --- a/auth_admin_passkey/models/__init__.py +++ b/auth_admin_passkey/models/__init__.py @@ -1,24 +1,9 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Admin Passkey module for Odoo -# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) -# @author Sylvain LE GAL (https://twitter.com/legalsylvain) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# -*- coding: utf-8 -*- +# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) +# @author Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html -from . import res_config -from . import res_users +from . import ( + res_config, + res_users, + ) diff --git a/auth_admin_passkey/models/res_config.py b/auth_admin_passkey/models/res_config.py index f521bf7d9..06aed172f 100644 --- a/auth_admin_passkey/models/res_config.py +++ b/auth_admin_passkey/models/res_config.py @@ -3,51 +3,56 @@ # @author Sylvain LE GAL (https://twitter.com/legalsylvain) # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html -from openerp import api, fields, models +from odoo import api, fields, models +from odoo.tools import safe_eval class BaseConfigSettings(models.TransientModel): _inherit = 'base.config.settings' - # Getter / Setter Section @api.model def get_default_auth_admin_passkey_send_to_admin(self, fields): + icp = self.env['ir.config_parameter'] return { - 'auth_admin_passkey_send_to_admin': - self.env["ir.config_parameter"].get_param( - "auth_admin_passkey.send_to_admin") + 'auth_admin_passkey_send_to_admin': safe_eval(icp.get_param( + 'auth_admin_passkey.send_to_admin', 'True')), } - @api.multi - def set_auth_admin_passkey_send_to_admin(self): - for config in self: - self.env['ir.config_parameter'].set_param( - "auth_admin_passkey.send_to_admin", - config.auth_admin_passkey_send_to_admin or '') - @api.model def get_default_auth_admin_passkey_send_to_user(self, fields): + icp = self.env['ir.config_parameter'] return { - 'auth_admin_passkey_send_to_user': - self.env["ir.config_parameter"].get_param( - "auth_admin_passkey.send_to_user") + 'auth_admin_passkey_send_to_user': safe_eval(icp.get_param( + 'auth_admin_passkey.send_to_user', 'True')), } - @api.multi - def set_auth_admin_passkey_send_to_user(self): - for config in self: - self.env['ir.config_parameter'].set_param( - "auth_admin_passkey.send_to_user", - config.auth_admin_passkey_send_to_user or '') - auth_admin_passkey_send_to_admin = fields.Boolean( - string='Send email to admin user.', - help="""When the administrator use his password to login in """ - """with a different account, Odoo will send an email """ - """to the admin user.""") - + 'Send email to admin user.', + help=('When the administrator use his password to login in ' + 'with a different account, Odoo will send an email ' + 'to the admin user.'), + ) auth_admin_passkey_send_to_user = fields.Boolean( string='Send email to user.', - help="""When the administrator use his password to login in """ - """with a different account, Odoo will send an email """ - """to the account user.""") + help=('When the administrator use his password to login in ' + 'with a different account, Odoo will send an email ' + 'to the account user.'), + ) + + @api.multi + def set_auth_admin_passkey_send_to_admin(self): + self.ensure_one() + + icp = self.env['ir.config_parameter'] + icp.set_param( + 'auth_admin_passkey.send_to_admin', + repr(self.auth_admin_passkey_send_to_admin)) + + @api.multi + def set_auth_admin_passkey_send_to_user(self): + self.ensure_one() + + icp = self.env['ir.config_parameter'] + icp.set_param( + 'auth_admin_passkey.send_to_user', + repr(self.auth_admin_passkey_send_to_user)) diff --git a/auth_admin_passkey/models/res_users.py b/auth_admin_passkey/models/res_users.py index 8bb598fe3..ee68c8dfa 100644 --- a/auth_admin_passkey/models/res_users.py +++ b/auth_admin_passkey/models/res_users.py @@ -5,111 +5,94 @@ import datetime -from openerp import _, api, exceptions, models, registry, SUPERUSER_ID +from odoo import SUPERUSER_ID, _, api, exceptions, models +from odoo.tools.safe_eval import safe_eval class ResUsers(models.Model): _inherit = "res.users" - def _get_translation(self, lang, text): - context = {'lang': lang} # noqa: _() checks page for locals - return _(text) - @api.model - def _send_email_passkey(self, user_agent_env): + def _send_email_passkey(self, user_id): """ Send a email to the admin of the system and / or the user - to inform passkey use.""" - mails = [] - mail_obj = self.env['mail.mail'] + to inform passkey use.""" + mail_obj = self.env['mail.mail'].sudo() icp_obj = self.env['ir.config_parameter'] - admin_user = self.sudo().browse(SUPERUSER_ID) - login_user = self.sudo().browse(self.env.uid) - send_to_admin = icp_obj.sudo().get_param( - 'auth_admin_passkey.send_to_admin') == 'True' and True or False - send_to_user = icp_obj.sudo().get_param( - 'auth_admin_passkey.send_to_user') == 'True' and True or False + admin_user = self.browse(SUPERUSER_ID) + login_user = self.browse(user_id) + + send_to_admin = safe_eval( + icp_obj.get_param('auth_admin_passkey.send_to_admin') + ) + send_to_user = safe_eval( + icp_obj.get_param('auth_admin_passkey.send_to_user') + ) + + mails = [] if send_to_admin and admin_user.email: mails.append({'email': admin_user.email, 'lang': admin_user.lang}) if send_to_user and login_user.email: mails.append({'email': login_user.email, 'lang': login_user.lang}) for mail in mails: - subject = self._get_translation( - mail['lang'], _('Passkey used')) - body = self._get_translation( - mail['lang'], - _("""Admin user used his passkey to login with '%s'.\n\n""" - """\n\nTechnicals informations belows : \n\n""" - """- Login date : %s\n\n""")) % ( - login_user.login, - datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")) - for k, v in user_agent_env.iteritems(): - body += ("- %s : %s\n\n") % (k, v) - mail = mail_obj.sudo().create({ + subject = _('Passkey used') + body = _( + "Admin user used his passkey to login with '%s'.\n\n" + "\n\nTechnicals informations belows : \n\n" + "- Login date : %s\n\n" + ) % (login_user.login, + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")) + + mail_obj.create({ 'email_to': mail['email'], 'subject': subject, - 'body_html': '
%s
' % body}) - mail.send(auto_commit=True) - - @api.cr - def _send_email_same_password(self, cr, login_user): - """ Send a email to the admin user to inform that another user has the - same password as him.""" - mail_obj = self.pool['mail.mail'] - admin_user = self.browse(cr, SUPERUSER_ID, SUPERUSER_ID) + 'body_html': '
%s
' % body + }) + + @api.model + def _send_email_same_password(self, login): + """ Send an email to the admin user to inform that + another user has the same password as him.""" + mail_obj = self.env['mail.mail'].sudo() + admin_user = self.browse(SUPERUSER_ID) + if admin_user.email: - mail_id = mail_obj.create(cr, SUPERUSER_ID, { + mail_obj.create({ 'email_to': admin_user.email, - 'subject': self._get_translation( - admin_user.lang, _('[WARNING] Odoo Security Risk')), - 'body_html': self._get_translation( - admin_user.lang, _( - """
User with login '%s' has the same """
-                        """password as you.
""")) % (login_user), + 'subject': _('[WARNING] Odoo Security Risk'), + 'body_html': + _("
User with login '%s' has the same "
+                      "password as you.
") % (login), }) - mail_obj.send(cr, SUPERUSER_ID, [mail_id], auto_commit=True) - - # Overload Section - def authenticate(self, db, login, password, user_agent_env): - """ Authenticate the user 'login' is password is ok or if - is admin password. In the second case, send mail to user and admin.""" - user_id = super(ResUsers, self).authenticate( - db, login, password, user_agent_env) - if user_id and (user_id != SUPERUSER_ID): - same_password = False - cr = registry(db).cursor() - try: - # directly use parent 'check_credentials' function - # to really know if credentials are ok - # or if it was admin password - super(ResUsers, self).check_credentials( - cr, SUPERUSER_ID, password) + + @api.model + def check_credentials(self, password): + """ Despite using @api.model decorator, this method + is always called by a res.users record""" + try: + super(ResUsers, self).check_credentials(password) + + # If credentials are ok, try to log with user password as admin + # user and send email if they are equal + if self._uid != SUPERUSER_ID: try: - # Test now if the user has the same password as admin user - super(ResUsers, self).check_credentials( - cr, user_id, password) - same_password = True + super(ResUsers, self).sudo().check_credentials(password) + self._send_email_same_password(self.login) except exceptions.AccessDenied: pass - if not same_password: - self._send_email_passkey(cr, user_id, user_agent_env) - else: - self._send_email_same_password(cr, login) - except exceptions.AccessDenied: - pass - finally: - cr.close() - return user_id - @api.model - def check_credentials(self, password): - """ Return now True if credentials are good OR if password is admin -password.""" - if self.env.uid != SUPERUSER_ID: + except exceptions.AccessDenied: + if self._uid == SUPERUSER_ID: + raise + + # Just be sure that parent methods aren't wrong + user = self.sudo().search([('id', '=', self._uid)]) + if not user: + raise + + # Our user isn't using its own password, check if its admin one try: - super(ResUsers, self).check_credentials(password) - return True + super(ResUsers, self).sudo().check_credentials(password) + self._send_email_passkey(self._uid) except exceptions.AccessDenied: - return self.sudo().check_credentials(password) - else: - return super(ResUsers, self).check_credentials(password) + raise diff --git a/auth_admin_passkey/tests/__init__.py b/auth_admin_passkey/tests/__init__.py index 48547d84d..7f702bd24 100644 --- a/auth_admin_passkey/tests/__init__.py +++ b/auth_admin_passkey/tests/__init__.py @@ -1,23 +1,7 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Admin Passkey module for Odoo -# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) -# @author Sylvain LE GAL (https://twitter.com/legalsylvain) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# -*- coding: utf-8 -*- +# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) +# @author Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from . import test_auth_admin_passkey +from . import test_ui diff --git a/auth_admin_passkey/tests/test_auth_admin_passkey.py b/auth_admin_passkey/tests/test_auth_admin_passkey.py index 2f0edaf9d..4bc6ef849 100644 --- a/auth_admin_passkey/tests/test_auth_admin_passkey.py +++ b/auth_admin_passkey/tests/test_auth_admin_passkey.py @@ -3,80 +3,59 @@ # @author Sylvain LE GAL (https://twitter.com/legalsylvain) # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html -import threading +from odoo import SUPERUSER_ID, exceptions +from odoo.tests import common -from openerp.tests.common import TransactionCase - -class TestAuthAdminPasskey(TransactionCase): +@common.post_install(True) +class TestAuthAdminPasskey(common.TransactionCase): """Tests for 'Auth Admin Passkey' Module""" - # Overload Section def setUp(self): super(TestAuthAdminPasskey, self).setUp() - # Get Registries - self.imd_obj = self.registry('ir.model.data') - self.ru_obj = self.registry('res.users') + self.ru_obj = self.env['res.users'] - # Get Database name - self.db = threading.current_thread().dbname + self.db = self.env.cr.dbname - # Get ids from xml_ids - self.admin_user_id = self.imd_obj.get_object_reference( - self.cr, self.uid, 'base', 'user_root')[1] - self.demo_user_id = self.imd_obj.get_object_reference( - self.cr, self.uid, 'base', 'user_demo')[1] + self.admin_user = self.ru_obj.search([('id', '=', SUPERUSER_ID)]) + self.passkey_user = self.ru_obj.create({ + 'login': 'passkey', + 'password': 'PasskeyPa$$w0rd', + 'name': 'passkey' + }) - # Test Section def test_01_normal_login_admin_succeed(self): - """[Regression Test] - Test the succeed of login with 'admin' / 'admin'""" - res = self.ru_obj.authenticate(self.db, 'admin', 'admin', {}) - self.assertEqual( - res, self.admin_user_id, - "'admin' / 'admin' login must succeed.") + # NOTE: Can fail if admin password changed + self.admin_user.check_credentials('admin') def test_02_normal_login_admin_fail(self): - """[Regression Test] - Test the fail of login with 'admin' / 'bad_password'""" - res = self.ru_obj.authenticate(self.db, 'admin', 'bad_password', {}) - self.assertEqual( - res, False, - "'admin' / 'bad_password' login must fail.") - - def test_03_normal_login_demo_succeed(self): - """[Regression Test] - Test the succeed of login with 'demo' / 'demo'""" - res = self.ru_obj.authenticate(self.db, 'demo', 'demo', {}) - self.assertEqual( - res, self.demo_user_id, - "'demo' / 'demo' login must succeed.") - - def test_04_normal_login_demo_fail(self): - """[Regression Test] - Test the fail of login with 'demo' / 'bad_password'""" - res = self.ru_obj.authenticate(self.db, 'demo', 'bad_password', {}) - self.assertEqual( - res, False, - "'demo' / 'bad_password' login must fail.") - - def test_05_passkey_login_demo_succeed(self): - """[New Feature] - Test the succeed of login with 'demo' / 'admin'""" - res = self.ru_obj.authenticate(self.db, 'demo', 'admin', {}) - self.assertEqual( - res, self.demo_user_id, - "'demo' / 'admin' login must succeed.") - - def test_06_passkey_login_demo_succeed(self): + with self.assertRaises(exceptions.AccessDenied): + self.admin_user.check_credentials('bad_password') + + def test_03_normal_login_passkey_succeed(self): + """ This test cannot pass because in some way the the _uid of + passkey_user is equal to admin one so when entering the + original check_credentials() method, it raises an exception + """ + try: + self.passkey_user.check_credentials('passkey') + except exceptions.AccessDenied: + # This exception is raised from the origin check_credentials() + # method and its an expected behaviour as we catch this in our + # check_credentials() + pass + + def test_04_normal_login_passkey_fail(self): + with self.assertRaises(exceptions.AccessDenied): + self.passkey_user.check_credentials('bad_password') + + def test_05_passkey_login_passkey_with_admin_password_succeed(self): + # NOTE: Can fail if admin password changed + self.passkey_user.check_credentials('admin') + + def test_06_passkey_login_passkey_succeed(self): """[Bug #1319391] Test the correct behaviour of login with 'bad_login' / 'admin'""" - exception_raised = False - try: - self.ru_obj.authenticate(self.db, 'bad_login', 'admin', {}) - except: - exception_raised = True - self.assertEqual( - exception_raised, False, - "'bad_login' / 'admin' musn't raise Error.") + res = self.ru_obj.authenticate(self.db, 'bad_login', 'admin', {}) + self.assertFalse(res) diff --git a/auth_admin_passkey/tests/test_ui.py b/auth_admin_passkey/tests/test_ui.py new file mode 100644 index 000000000..80f98d4de --- /dev/null +++ b/auth_admin_passkey/tests/test_ui.py @@ -0,0 +1,171 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) +# @author Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from lxml import html + +from werkzeug.test import Client +from werkzeug.wrappers import BaseResponse + +from odoo.tests import common +from odoo.service import wsgi_server + + +@common.post_install(True) +class TestUI(common.HttpCase): + + def setUp(self): + super(TestUI, self).setUp() + + with self.registry.cursor() as test_cursor: + env = self.env(test_cursor) + + self.admin_password = 'AdminPa$$w0rd' + env.ref('base.user_root').password = self.admin_password + self.passkey_password = 'PasskeyPa$$w0rd' + self.passkey_user = env['res.users'].create({ + 'name': 'passkey', + 'login': 'passkey', + 'email': 'passkey', + 'password': self.passkey_password + }) + self.dbname = env.cr.dbname + + self.werkzeug_environ = {'REMOTE_ADDR': '127.0.0.1'} + self.test_client = Client(wsgi_server.application, BaseResponse) + self.test_client.get('/web/session/logout') + + def html_doc(self, response): + """Get an HTML LXML document.""" + return html.fromstring(response.data) + + def csrf_token(self, response): + """Get a valid CSRF token.""" + doc = self.html_doc(response) + return doc.xpath("//input[@name='csrf_token']")[0].get('value') + + def get_request(self, url, data=None): + return self.test_client.get( + url, query_string=data, follow_redirects=True) + + def post_request(self, url, data=None): + return self.test_client.post( + url, data=data, follow_redirects=True, + environ_base=self.werkzeug_environ) + + def test_01_normal_login_admin_succeed(self): + # Our admin user wants to go to backoffice part of Odoo + response = self.get_request('/web/', data={'db': self.dbname}) + + # He notices that his redirected to login page as not authenticated + self.assertIn('oe_login_form', response.data) + + # He needs to enters his credentials and submit the form + data = { + 'login': 'admin', + 'password': self.admin_password, + 'csrf_token': self.csrf_token(response), + 'db': self.dbname + } + response = self.post_request('/web/login/', data=data) + + # He notices that his redirected to backoffice + self.assertNotIn('oe_login_form', response.data) + + def test_02_normal_login_admin_fail(self): + # Our admin user wants to go to backoffice part of Odoo + response = self.get_request('/web/', data={'db': self.dbname}) + + # He notices that he's redirected to login page as not authenticated + self.assertIn('oe_login_form', response.data) + + # He needs to enter his credentials and submit the form + data = { + 'login': 'admin', + 'password': 'password', + 'csrf_token': self.csrf_token(response), + 'db': self.dbname + } + response = self.post_request('/web/login/', data=data) + + # He mistyped his password so he's redirected to login page again + self.assertIn('Wrong login/password', response.data) + + def test_03_normal_login_passkey_succeed(self): + # Our passkey user wants to go to backoffice part of Odoo + response = self.get_request('/web/', data={'db': self.dbname}) + + # He notices that he's redirected to login page as not authenticated + self.assertIn('oe_login_form', response.data) + + # He needs to enter his credentials and submit the form + data = { + 'login': self.passkey_user.login, + 'password': self.passkey_password, + 'csrf_token': self.csrf_token(response), + 'db': self.dbname + } + response = self.post_request('/web/login/', data=data) + + # He notices that his redirected to backoffice + self.assertNotIn('oe_login_form', response.data) + + def test_04_normal_login_passkey_fail(self): + # Our passkey user wants to go to backoffice part of Odoo + response = self.get_request('/web/', data={'db': self.dbname}) + + # He notices that he's redirected to login page as not authenticated + self.assertIn('oe_login_form', response.data) + + # He needs to enter his credentials and submit the form + data = { + 'login': self.passkey_user.login, + 'password': 'password', + 'csrf_token': self.csrf_token(response), + 'db': self.dbname + } + response = self.post_request('/web/login/', data=data) + + # He mistyped his password so he's redirected to login page again + self.assertIn('Wrong login/password', response.data) + + def test_05_passkey_login_with_admin_password_succeed(self): + # Our admin user wants to login as passkey user + response = self.get_request('/web/', data={'db': self.dbname}) + + # He notices that his redirected to login page as not authenticated + self.assertIn('oe_login_form', response.data) + + # He needs to enters its password with passkey user's login + data = { + 'login': self.passkey_user.login, + 'password': self.admin_password, + 'csrf_token': self.csrf_token(response), + 'db': self.dbname + } + response = self.post_request('/web/login/', data=data) + + # He notices that his redirected to backoffice + self.assertNotIn('oe_login_form', response.data) + + def test_06_passkey_login_with_same_password_as_admin(self): + self.passkey_user.password = self.admin_password + + # Our passkey user wants to go to backoffice part of Odoo + response = self.get_request('/web/', data={'db': self.dbname}) + + # He notices that his redirected to login page as not authenticated + self.assertIn('oe_login_form', response.data) + + # He needs to enters his credentials and submit the form + data = { + 'login': self.passkey_user.login, + 'password': self.admin_password, + 'csrf_token': self.csrf_token(response), + 'db': self.dbname + } + response = self.post_request('/web/login/', data=data) + + # He notices that his redirected to backoffice + self.assertNotIn('oe_login_form', response.data) diff --git a/auth_admin_passkey/views/res_config_view.xml b/auth_admin_passkey/views/res_config_view.xml index 2fec2a6ff..be6cc35c8 100644 --- a/auth_admin_passkey/views/res_config_view.xml +++ b/auth_admin_passkey/views/res_config_view.xml @@ -1,47 +1,27 @@ - - - - - - - - - - - - - - - - - - - - + base.config.settings.view base.config.settings - + - - + diff --git a/setup/auth_admin_passkey/odoo/__init__.py b/setup/auth_admin_passkey/odoo/__init__.py new file mode 100644 index 000000000..de40ea7ca --- /dev/null +++ b/setup/auth_admin_passkey/odoo/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/auth_admin_passkey/odoo/addons/__init__.py b/setup/auth_admin_passkey/odoo/addons/__init__.py new file mode 100644 index 000000000..de40ea7ca --- /dev/null +++ b/setup/auth_admin_passkey/odoo/addons/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/auth_admin_passkey/odoo/addons/auth_admin_passkey b/setup/auth_admin_passkey/odoo/addons/auth_admin_passkey new file mode 120000 index 000000000..c9a369736 --- /dev/null +++ b/setup/auth_admin_passkey/odoo/addons/auth_admin_passkey @@ -0,0 +1 @@ +../../../../auth_admin_passkey \ No newline at end of file diff --git a/setup/auth_admin_passkey/setup.py b/setup/auth_admin_passkey/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/auth_admin_passkey/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)