From 5a5797dc56187982f9e81d0d75d915031498a21d Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Mon, 17 Mar 2014 16:41:20 +0100 Subject: [PATCH 01/91] [ADD] new module 'auth_admin_passkey' that allow admin user (uid=1) to login with any login and his password. --- auth_admin_passkey/__init__.py | 6 ++ auth_admin_passkey/__openerp__.py | 63 ++++++++++++++++ .../data/ir_config_parameter.xml | 16 ++++ auth_admin_passkey/i18n/fr.po | 42 +++++++++++ auth_admin_passkey/model/__init__.py | 7 ++ auth_admin_passkey/model/res_config.py | 48 ++++++++++++ auth_admin_passkey/model/res_users.py | 71 ++++++++++++++++++ auth_admin_passkey/static/src/img/icon.png | Bin 0 -> 4113 bytes auth_admin_passkey/view/res_config_view.xml | 29 +++++++ 9 files changed, 282 insertions(+) create mode 100644 auth_admin_passkey/__init__.py create mode 100644 auth_admin_passkey/__openerp__.py create mode 100644 auth_admin_passkey/data/ir_config_parameter.xml create mode 100644 auth_admin_passkey/i18n/fr.po create mode 100644 auth_admin_passkey/model/__init__.py create mode 100644 auth_admin_passkey/model/res_config.py create mode 100644 auth_admin_passkey/model/res_users.py create mode 100644 auth_admin_passkey/static/src/img/icon.png create mode 100644 auth_admin_passkey/view/res_config_view.xml diff --git a/auth_admin_passkey/__init__.py b/auth_admin_passkey/__init__.py new file mode 100644 index 0000000000..12135a3332 --- /dev/null +++ b/auth_admin_passkey/__init__.py @@ -0,0 +1,6 @@ +# -*- encoding: utf-8 -*- +################################################################################ +# See __openerp__.py file for Copyright and Licence Informations. +################################################################################ + +import model diff --git a/auth_admin_passkey/__openerp__.py b/auth_admin_passkey/__openerp__.py new file mode 100644 index 0000000000..dd9e30ac64 --- /dev/null +++ b/auth_admin_passkey/__openerp__.py @@ -0,0 +1,63 @@ +# -*- encoding: utf-8 -*- +################################################################################ +# See Copyright and Licence Informations undermentioned. +################################################################################ + +{ + 'name': 'Authentification - Admin Passkey', + 'version': '2.1', + 'category': 'base', + 'description': """ +Admin password become a passkey for all active logins +===================================================== + +Functionnalities : +------------------ + * 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; + +Technical informations : +------------------------ + * Create two ir_config_parameter to enable / disable mail sending; + +Limits : +-------- + * For the moment, this module doesn't manage translations for the mails; + * This module is compatible with 'auth_crypt' depending of the order of the installation: + * if 'auth_crypt' is first installed, it will work; + * if 'auth_admin_passkey' is first installed, it won't work; +If you want to install 'auth_crypt', please uninstall 'auth_admin_passkey' and +reinstall it after the installation of 'auth_crypt'. + +Otherwise, you can propose the merge of a glue module that manage this case. + +Copyright and Licence : +----------------------- + * 2014, Groupement Régional Alimentaire de Proximité + * Licence : AGPL-3 (http://www.gnu.org/licenses/) + +Contacts : +---------- + * Sylvain LE GAL (https://twitter.com/legalsylvain); + * for any help or question about this module. + """, + 'author': 'GRAP', + 'website': 'http://www.grap.coop', + 'license': 'AGPL-3', + 'depends': [ + 'mail', + ], + 'data': [ + 'data/ir_config_parameter.xml', + 'view/res_config_view.xml', + ], + 'demo': [], + 'js': [], + 'css': [], + 'qweb': [], + 'images': [], + 'post_load': '', + 'application': 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 new file mode 100644 index 0000000000..6cb75828ca --- /dev/null +++ b/auth_admin_passkey/data/ir_config_parameter.xml @@ -0,0 +1,16 @@ + + + + + + auth_admin_passkey.send_to_admin + True + + + + auth_admin_passkey.send_to_user + True + + + + diff --git a/auth_admin_passkey/i18n/fr.po b/auth_admin_passkey/i18n/fr.po new file mode 100644 index 0000000000..c352d40a55 --- /dev/null +++ b/auth_admin_passkey/i18n/fr.po @@ -0,0 +1,42 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * auth_admin_passkey +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-03-17 12:04+0000\n" +"PO-Revision-Date: 2014-03-17 12:04+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: auth_admin_passkey +#: view:base.config.settings:0 +msgid "Passkey" +msgstr "Mot de passe bris de glace" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "Send email to admin user." +msgstr "Envoyer un email à l'administrateur." + +#. 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 "Quand l'administrateur utilise son mot de passe pour s'authentifier avec un compte différent, OpenERP 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." + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "Send email to user." +msgstr "Envoyer un email à l'utilisateur." + diff --git a/auth_admin_passkey/model/__init__.py b/auth_admin_passkey/model/__init__.py new file mode 100644 index 0000000000..c672ffa174 --- /dev/null +++ b/auth_admin_passkey/model/__init__.py @@ -0,0 +1,7 @@ +# -*- encoding: utf-8 -*- +################################################################################ +# See __openerp__.py file for Copyright and Licence Informations. +################################################################################ + +import res_config +import res_users diff --git a/auth_admin_passkey/model/res_config.py b/auth_admin_passkey/model/res_config.py new file mode 100644 index 0000000000..53e5d99b92 --- /dev/null +++ b/auth_admin_passkey/model/res_config.py @@ -0,0 +1,48 @@ +# -*- encoding: utf-8 -*- +################################################################################ +# See __openerp__.py file for Copyright and Licence Informations. +################################################################################ + +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.get('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.get('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.get('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.get('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 new file mode 100644 index 0000000000..9cc6599dc3 --- /dev/null +++ b/auth_admin_passkey/model/res_users.py @@ -0,0 +1,71 @@ +# -*- encoding: utf-8 -*- +################################################################################ +# See __openerp__.py file for Copyright and Licence Informations. +################################################################################ + +import datetime +from ast import literal_eval + +from openerp import SUPERUSER_ID +from openerp import pooler +from openerp import exceptions +from openerp.osv.orm import Model + +class res_users(Model): + _inherit = "res.users" + + ### Private Function section + def _send_email_passkey(self, cr, user_id, user_agent_env): + """ Send a email to the admin of the system to inform passkey use """ + mail_obj = self.pool.get('mail.mail') + icp_obj = self.pool.get('ir.config_parameter') + admin_user = self.browse(cr, SUPERUSER_ID, SUPERUSER_ID) + login_user = self.browse(cr, SUPERUSER_ID, user_id) + send_to_admin = literal_eval(icp_obj.get_param(cr, SUPERUSER_ID, + 'auth_admin_passkey.send_to_admin', 'True')) + send_to_user = literal_eval(icp_obj.get_param(cr, SUPERUSER_ID, + 'auth_admin_passkey.send_to_user', 'True')) + emails_to = [] + if send_to_admin and admin_user.email: + emails_to.append(admin_user.email) + if send_to_user and login_user.email: + emails_to.append(login_user.email) + if emails_to: + body = "Admin user used his passkey to login with '%s'.\n\n" %(login_user.login) + body += "\n\nTechnicals informations belows : \n\n" + body += "- Login date : %s\n\n" %(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")) + for key, value in user_agent_env.iteritems(): + body +=("- %s : %s\n\n") % (key, value) + for email_to in emails_to: + mail_obj.create(cr, SUPERUSER_ID, { + 'email_to': email_to, + 'subject': "Passkey used", + 'body_html': '
%s
' % body}) + + ### 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) + cr = pooler.get_db(db).cursor() + try: + # directly use parent 'check_credentials' function + # to really know if credentials are ok and if it's admin password + super(res_users, self).check_credentials(cr, SUPERUSER_ID, password) + if user_id != SUPERUSER_ID: + self._send_email_passkey(cr, user_id, user_agent_env) + 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""" + try: + super(res_users, self).check_credentials(cr, SUPERUSER_ID, password) + return True + except exceptions.AccessDenied: + return super(res_users, self).check_credentials(cr, uid, password) + diff --git a/auth_admin_passkey/static/src/img/icon.png b/auth_admin_passkey/static/src/img/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..490879d9f495397f83d08b90e1cdae22725ba6d0 GIT binary patch literal 4113 zcmZu!cTm$!wEcw=AcWqVbd=tUK@cK@UKCWM21GhRigcxh018B;h#(yi>H5(GlqN_G z5iwLjh#=BJ@9^UL@6EhBvwLS}c4zm_o_p@ONtWgY3=m!j000a|hI+TiKKkFF1(WA) zZRbIK=P^L5^9{@0YFw)bt4$WJC{n*lKIlu4o zWnnrxMY>_L`t4_JG(%B=%?*cfa$=z@zO4@4X3f>G}EQ0M$%}v3NyQl^BLmK*TxlRaZgf-P&~b z{4j~Pg}4Tu6vXz=h|QbAdb}t5>!JZId3Q;d{q9s|&a{QSfC#frH2aqzV+z{H`vU%c zmz1KYaA}%O8uwx_BAw;h%U#AW3BD1*ijUYu`Z6^b>a{|JRkN@IrsTX zl^!Lb9lXXpS$`k%CpcT)DOLJzjl%5gY&K;8&p0<2iVjhK~OMdZ(pDP>7l>R zbR)ynt5?%;xD~^nzjk+nzTxr0?}k5qglW81M=CV?pTXiVOi`3^&g%TB2b6DQWlky8 zd?tjBBKJf+4Vd^fbR4739^Lf0`r3S^l|Yx$ixxGwLxK?o<(=XO%XHzfbYx2(xo@PI zjm7F5A0O-0KiZhNnx|!#P_M|qo@}7JuN+8Z7mi7rZdlb`SX>m(A*2UE0Q3B7M(^Ie z(KhA)c^eT!XS2- zm3TfM3koZv>mEAG4h#$+)pEr%m(v5>l;qoYS&xV>ENsf~t9x%NDmqgIG~G_+a)%MY z8#77di2rMBEUvF-dHlHD^2)3E099n@VWVXY&M07e)6&{H{`X+EiNu`v;@2Q0W##_a z){r=D$I9`Ag)dLP4i4rXsLy_SoSUZ=!KpTF4n&)BGSwbvUw6M+7xh_X+mY3L2vix+ z{P81i#Qs{&!NJ-bZX>S<0TIEXr(-5PJUyK`t~A&RC>#d2zP^%qp|lkic`czNq)V7u z*Z3B2c6L^ks-8Q%v++4_nX#h6sApm#mu*g8pTU3I%;U-7FHBvsPC5lC^jcLa!K-0s zV{>C;X)$#^^jg~4*;b#RqJjdm8jBu!kQDiL-0Mysj&N&Yd|cnwu6Fy8ktK1vFRdgc zg>Q6%TiZ$O9)*~gSRL$BWhFfsLHRpUULH2M>GIJ+XcOf(_6{oxtuJ-5)cYH=nyUwb zQ9i6)Wz344D4J490JtJ2=k_Sl!9gH+^QTrBI~FdhX|umc!^6+dKI_yEDJ(9Iee~*J zE=rJ$dHc3de-Y8XUL~qM>5OK3%HrvaDnQNe=a8gBV4(7yYFl(s5e*fPF%X=e|5Yau z8XY+ziZDP|m>B4{PzZ`Cq(?%4=&CB2H}Bu4e;*(BH;!6nyl8yfa*ghig*-Rd&?JIS zU%#^GRvBC_yZhI}!iowy^1r;bUTpJ~%!HAln$p>+TRgU+=PgXW*hh^|QeJ*Jqw&KB zmWBp&+hbB_I0!g8auSi2rk|Xgw4xwWkJ0&d_E_EYx`+34@8FNaL)sdL6To)8HtaP< zHl02C`e74lb|K>&U!tpfs*t0d(C-TO_ur~IJEG^3a|PzVm6?daj!jfleThDUi#&a= zHHW_rbGVJPg}#AIX`bpkPcck$^FBlN8}|Z^DbrNV?XN#2dnLdYgG=s9QQ&yUhrPdg)UYa zBJ?LU%9fMGsOFipb3sBoiYi3WJcp^-(QBppgcJF0G}XiF+VQVIhx z7O^;ZP+Y7bCL!_u31?bbnmYuNesyx6No0I=kNJaukPij3$YD-S&IdJ~59@~8i%eYy za~JZwe0=wu&}L?4#P5KvZm}>(fo$K5C0SNo*e8-nsQr z0VEKzKV94^*|hAN2@vgUE##Wfkah|8=)XosxRn)KKMu$AP6LHPNi5?Cb&bCbBz6eb zt@Ci5{WULpW81eYD=W7~G&dD|eSL>oH$TyrZEtlXt#lSJG)z5nIxXgeP@g2{31Swx zKb31Ko9>`)+WxP3U1S$orQeejQad4q}rhClkrOnXE~vY)!&Pcg3s7?K1ktgTJ6Z$H+ObF}ZnFXoh%p0aVf z(LFIM>^_tzG;n zNz<5C=Y|fwf8gYAE-&HrNLwZg$IR8&evmFL%%W3w_tO^_T?7KWv+z`2>EB1xIJ8Ra zKX7wf*j*WGJGE&E5Wi)0aR1@MH_fG8^GLAkd(|uQ@&-OWReu7hskwk$mkTl;th5EM zg<_B9nj6IurDn;lXbaYz?f65)6=^ota-BO+?hOPjO(0-iy?T`-qOGX-{A$Ps|IU<|k&5XY zn#X%JkSi*S?8J_9({w+HB$P4W%nx&AsHi@FA_@kdLq4Ca=Ng&~$C_WRMvGFf(9^oH zKOOwtb-cIw>!C(sCz94%!t~O{_~@w4`EL0w1ydHS`J zR#X7>oSAb+1aU}J_rP{>U(FlA*;@WJ6J0z{zMYPU=0X&xP8zcTClbTt_Qva-U#<} zJVPSnOsJ&*UF?n8rmpp$K+f9hhnn5Vi8tTb1cijWxPiH~G_#r8R}1bw4A*(|v7Hot zLEq96fz4_J+g5W*WlH(nXqyn}*Do$jfyDd3Jy(K>OPuhsWD1f}#(<4S!vfP^B0UE{ zk3c{ZQ-cc&k(2=e5RoOR0w!A;B&ho^e}hxjxQ|3qAOllm$=^@TgRX-jbAS#Fr_Wx! z7@eAe4Q8PlkDPRbiLMaDoT&5(mc+vu=?qF@2MjszLa0?#Xrm(XU+#FlIp!6h5 ztLC4CqP@LcOj1%(#292t^D=?CJ;tSWyOTyL+LN{(&b1CrMt*E< zjjNfAXpipej%L0pF=wU;gNZDyME?MV&f86<054&4md4$mD0QhjSgM1?Ic2WIIevyF zB_)ln1aWh7A9|wGmb=y+M=e2hdJxWFN!;^5%mdY)}I09-@=`UU5PQY+-L>3-#r zv2UhB+?P|~WhgEwd5#sTmP7{XnnZgtv;LtQp`Yjc{@0FM;LPv8|Ej!dptMi!4AgNlEzP;ss@yd+)s#S`8Vr zb^Jh8{;f1ydxR*h-?!Dsg7>-AYA#q7WTT)^2=}Sl6wq_WonNkT)PfTO81hD*R0LQ+%i*3E6 z!^C7T%NPif^GB@{Q~4O7Q}lk$4RP_ggpQI?7DZ!@+|5rXsgWnX{cU~E(!5zXe!n`j zw?9=SGb-23Fy5OZ$-`tZ(vL5BdRaT79rD$6gXe-$=fUrSdY3QBiG#SrKpP(lCRXZ3 zU+0nSmGmJw8*rlnaYYBNOF#>ymeWy?Vfch2lD+Dypi_mzLb1OicHKg4oFo zt + + + + + base.config.settings.view + base.config.settings + + + + + + + + + + + From 8da835346afb4936af8a5e014875202c83362446 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Fri, 21 Mar 2014 14:03:56 +0100 Subject: [PATCH 02/91] [IMP] move 'if' test to avoid useless call to check_credentials function if user_id == SUPERUSER_ID. (Courtesy of Stefan Rijnhart). --- auth_admin_passkey/model/res_users.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/auth_admin_passkey/model/res_users.py b/auth_admin_passkey/model/res_users.py index 9cc6599dc3..3172a1f400 100644 --- a/auth_admin_passkey/model/res_users.py +++ b/auth_admin_passkey/model/res_users.py @@ -47,18 +47,18 @@ 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) - cr = pooler.get_db(db).cursor() - try: - # directly use parent 'check_credentials' function - # to really know if credentials are ok and if it's admin password - super(res_users, self).check_credentials(cr, SUPERUSER_ID, password) - if user_id != SUPERUSER_ID: + if user_id != SUPERUSER_ID: + 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) self._send_email_passkey(cr, user_id, user_agent_env) cr.commit() - except exceptions.AccessDenied: - pass - finally: - cr.close() + except exceptions.AccessDenied: + pass + finally: + cr.close() return user_id def check_credentials(self, cr, uid, password): From 322f1f11f7f0e2a7fc19c5d581f5a5c574f02cc4 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Sun, 23 Mar 2014 18:42:14 +0100 Subject: [PATCH 03/91] [IMP] 'auth_admin_passkey' : Manage the special case where an user has the same password as the admin user, sending a mail to admin user. --- auth_admin_passkey/model/res_users.py | 29 +++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/auth_admin_passkey/model/res_users.py b/auth_admin_passkey/model/res_users.py index 3172a1f400..1de139277a 100644 --- a/auth_admin_passkey/model/res_users.py +++ b/auth_admin_passkey/model/res_users.py @@ -16,7 +16,8 @@ class res_users(Model): ### Private Function section def _send_email_passkey(self, cr, user_id, user_agent_env): - """ Send a email to the admin of the system to inform passkey use """ + """ Send a email to the admin of the system and / or the user + to inform passkey use """ mail_obj = self.pool.get('mail.mail') icp_obj = self.pool.get('ir.config_parameter') admin_user = self.browse(cr, SUPERUSER_ID, SUPERUSER_ID) @@ -42,18 +43,42 @@ def _send_email_passkey(self, cr, user_id, user_agent_env): 'subject': "Passkey used", '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.get('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': "[WARNING] OpenERP Security Risk", + 'body_html': """
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 != 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) - self._send_email_passkey(cr, user_id, user_agent_env) + 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 From 4f726e930d23ba0aadbfbcaf6a659c7a8370a5b1 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Sun, 23 Mar 2014 18:45:28 +0100 Subject: [PATCH 04/91] [ADD] 'auth_admin_passkey' : add '.pot' file. --- .../i18n/auth_admin_passkey.pot | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 auth_admin_passkey/i18n/auth_admin_passkey.pot diff --git a/auth_admin_passkey/i18n/auth_admin_passkey.pot b/auth_admin_passkey/i18n/auth_admin_passkey.pot new file mode 100644 index 0000000000..1e20c237bf --- /dev/null +++ b/auth_admin_passkey/i18n/auth_admin_passkey.pot @@ -0,0 +1,56 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * auth_admin_passkey +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-03-23 17:43+0000\n" +"PO-Revision-Date: 2014-03-23 17:43+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: auth_admin_passkey +#: view:base.config.settings:0 +msgid "Passkey" +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 +#: 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 +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:_description:0 +#: model:ir.model,name:auth_admin_passkey.model_base_config_settings +#, python-format +msgid "base.config.settings" +msgstr "" + From d42a8620f078dd458ffb5b528d05586d72ffda7a Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Sun, 23 Mar 2014 20:26:09 +0100 Subject: [PATCH 05/91] [IMP] 'auth_admin_passkey' works now indepently from the order of the installation of modules 'auth_admin_passkey' and 'auth_crypt'. (Courtesy of Stefan Rijnhart). --- auth_admin_passkey/__openerp__.py | 7 ------- auth_admin_passkey/model/res_users.py | 13 +++++++------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/auth_admin_passkey/__openerp__.py b/auth_admin_passkey/__openerp__.py index dd9e30ac64..3b62dca746 100644 --- a/auth_admin_passkey/__openerp__.py +++ b/auth_admin_passkey/__openerp__.py @@ -23,13 +23,6 @@ Limits : -------- * For the moment, this module doesn't manage translations for the mails; - * This module is compatible with 'auth_crypt' depending of the order of the installation: - * if 'auth_crypt' is first installed, it will work; - * if 'auth_admin_passkey' is first installed, it won't work; -If you want to install 'auth_crypt', please uninstall 'auth_admin_passkey' and -reinstall it after the installation of 'auth_crypt'. - -Otherwise, you can propose the merge of a glue module that manage this case. Copyright and Licence : ----------------------- diff --git a/auth_admin_passkey/model/res_users.py b/auth_admin_passkey/model/res_users.py index 1de139277a..eab27e9cd0 100644 --- a/auth_admin_passkey/model/res_users.py +++ b/auth_admin_passkey/model/res_users.py @@ -55,7 +55,6 @@ def _send_email_same_password(self, cr, login_user): 'body_html': """
User with login '%s' has the same """\
                     """password as you.
""" %(login_user) }) - ### Overload Section def authenticate(self, db, login, password, user_agent_env): @@ -88,9 +87,11 @@ def authenticate(self, db, login, password, user_agent_env): def check_credentials(self, cr, uid, password): """ Return now True if credentials are good OR if password is admin password""" - try: - super(res_users, self).check_credentials(cr, SUPERUSER_ID, password) - return True - except exceptions.AccessDenied: + if uid != SUPERUSER_ID: + try: + self.check_credentials(cr, SUPERUSER_ID, password) + return True + except exceptions.AccessDenied: + return super(res_users, self).check_credentials(cr, uid, password) + else: return super(res_users, self).check_credentials(cr, uid, password) - From 005c3d11f481ff247296d73108fdc5be4e8c61b6 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Sun, 23 Mar 2014 21:45:12 +0100 Subject: [PATCH 06/91] [IMP] Emails are now translated. --- auth_admin_passkey/__openerp__.py | 5 +- .../i18n/auth_admin_passkey.pot | 35 +++++++++-- auth_admin_passkey/i18n/fr.po | 58 +++++++++++++++++-- auth_admin_passkey/model/res_users.py | 45 ++++++++------ 4 files changed, 111 insertions(+), 32 deletions(-) diff --git a/auth_admin_passkey/__openerp__.py b/auth_admin_passkey/__openerp__.py index 3b62dca746..10de4cdb65 100644 --- a/auth_admin_passkey/__openerp__.py +++ b/auth_admin_passkey/__openerp__.py @@ -15,15 +15,12 @@ ------------------ * 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; + * If a user has the same password as the admin, OpenERP will inform the admin; Technical informations : ------------------------ * Create two ir_config_parameter to enable / disable mail sending; -Limits : --------- - * For the moment, this module doesn't manage translations for the mails; - Copyright and Licence : ----------------------- * 2014, Groupement Régional Alimentaire de Proximité diff --git a/auth_admin_passkey/i18n/auth_admin_passkey.pot b/auth_admin_passkey/i18n/auth_admin_passkey.pot index 1e20c237bf..358c3a006e 100644 --- a/auth_admin_passkey/i18n/auth_admin_passkey.pot +++ b/auth_admin_passkey/i18n/auth_admin_passkey.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: OpenERP Server 7.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-03-23 17:43+0000\n" -"PO-Revision-Date: 2014-03-23 17:43+0000\n" +"POT-Creation-Date: 2014-03-23 20:41+0000\n" +"PO-Revision-Date: 2014-03-23 20:41+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -15,11 +15,37 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/model/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/model/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:0 msgid "Passkey" msgstr "" +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/model/res_users.py:42 +#, 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." @@ -48,9 +74,8 @@ msgid "When the administrator use his password to login in with a different acco msgstr "" #. module: auth_admin_passkey -#: code:_description:0 -#: model:ir.model,name:auth_admin_passkey.model_base_config_settings +#: code:addons/auth_admin_passkey/model/res_users.py:64 #, python-format -msgid "base.config.settings" +msgid "[WARNING] OpenERP Security Risk" msgstr "" diff --git a/auth_admin_passkey/i18n/fr.po b/auth_admin_passkey/i18n/fr.po index c352d40a55..2aa851e025 100644 --- a/auth_admin_passkey/i18n/fr.po +++ b/auth_admin_passkey/i18n/fr.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: OpenERP Server 7.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-03-17 12:04+0000\n" -"PO-Revision-Date: 2014-03-17 12:04+0000\n" +"POT-Creation-Date: 2014-03-23 20:38+0000\n" +"PO-Revision-Date: 2014-03-23 20:38+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -15,16 +15,62 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/model/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/model/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 "L'administrateur a utilisé son mot de passe bris de glace pour s'identifier avec l'identifiant '%s'.\n" +"\n" +"\n" +"\n" +"Informations techniques ci-dessous : \n" +"\n" +"- Date d'authentification : %s\n" +"\n" +"" + #. module: auth_admin_passkey #: view:base.config.settings:0 msgid "Passkey" msgstr "Mot de passe bris de glace" +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/model/res_users.py:42 +#, python-format +msgid "Passkey used" +msgstr "Mot de passe bris de glace utilisé" + #. module: auth_admin_passkey #: field:base.config.settings,auth_admin_passkey_send_to_admin:0 msgid "Send email to admin user." msgstr "Envoyer un email à l'administrateur." +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "Send email to user." +msgstr "Envoyer un email à l'utilisateur." + +#. module: auth_admin_passkey +#: code:_description:0 +#: model:ir.model,name:auth_admin_passkey.model_res_users +#, python-format +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." @@ -36,7 +82,7 @@ msgid "When the administrator use his password to login in with a different acco 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 -#: field:base.config.settings,auth_admin_passkey_send_to_user:0 -msgid "Send email to user." -msgstr "Envoyer un email à l'utilisateur." - +#: code:addons/auth_admin_passkey/model/res_users.py:64 +#, python-format +msgid "[WARNING] OpenERP Security Risk" +msgstr "[WARNING] Faille de sécurité sur OpenERP" diff --git a/auth_admin_passkey/model/res_users.py b/auth_admin_passkey/model/res_users.py index eab27e9cd0..5bfe8ac935 100644 --- a/auth_admin_passkey/model/res_users.py +++ b/auth_admin_passkey/model/res_users.py @@ -10,14 +10,20 @@ from openerp import pooler from openerp import exceptions from openerp.osv.orm import Model +from openerp.tools.translate import _ class res_users(Model): _inherit = "res.users" ### Private Function section + def _get_translation(self, cr, lang, text): + context = {'lang': lang} + 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.get('mail.mail') icp_obj = self.pool.get('ir.config_parameter') admin_user = self.browse(cr, SUPERUSER_ID, SUPERUSER_ID) @@ -26,21 +32,24 @@ def _send_email_passkey(self, cr, user_id, user_agent_env): 'auth_admin_passkey.send_to_admin', 'True')) send_to_user = literal_eval(icp_obj.get_param(cr, SUPERUSER_ID, 'auth_admin_passkey.send_to_user', 'True')) - emails_to = [] - if send_to_admin and admin_user.email: - emails_to.append(admin_user.email) + + 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: - emails_to.append(login_user.email) - if emails_to: - body = "Admin user used his passkey to login with '%s'.\n\n" %(login_user.login) - body += "\n\nTechnicals informations belows : \n\n" - body += "- Login date : %s\n\n" %(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")) - for key, value in user_agent_env.iteritems(): - body +=("- %s : %s\n\n") % (key, value) - for email_to in emails_to: - mail_obj.create(cr, SUPERUSER_ID, { - 'email_to': email_to, - 'subject': "Passkey used", + 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): @@ -51,9 +60,11 @@ def _send_email_same_password(self, cr, login_user): if admin_user.email: mail_obj.create(cr, SUPERUSER_ID, { 'email_to': admin_user.email, - 'subject': "[WARNING] OpenERP Security Risk", - 'body_html': """
User with login '%s' has the same """\
-                    """password as you.
""" %(login_user) + '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 From af08295af6bb4c219bad5d749e2dd6635e186f7e Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Sun, 23 Mar 2014 23:01:19 +0100 Subject: [PATCH 07/91] [REF] Pep8 and import conventions. --- auth_admin_passkey/__init__.py | 2 +- auth_admin_passkey/__openerp__.py | 20 ++++++-------- auth_admin_passkey/model/__init__.py | 4 +-- auth_admin_passkey/model/res_config.py | 36 ++++++++++++++++---------- auth_admin_passkey/model/res_users.py | 10 ++++--- 5 files changed, 39 insertions(+), 33 deletions(-) diff --git a/auth_admin_passkey/__init__.py b/auth_admin_passkey/__init__.py index 12135a3332..a2a665b1b9 100644 --- a/auth_admin_passkey/__init__.py +++ b/auth_admin_passkey/__init__.py @@ -3,4 +3,4 @@ # See __openerp__.py file for Copyright and Licence Informations. ################################################################################ -import model +from . import model diff --git a/auth_admin_passkey/__openerp__.py b/auth_admin_passkey/__openerp__.py index 10de4cdb65..f513954dcf 100644 --- a/auth_admin_passkey/__openerp__.py +++ b/auth_admin_passkey/__openerp__.py @@ -11,25 +11,21 @@ Admin password become a passkey for all active logins ===================================================== -Functionnalities : ------------------- +Functionnality : +---------------- * 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; * If a user has the same password as the admin, OpenERP will inform the admin; -Technical informations : ------------------------- +Technical information : +----------------------- * Create two ir_config_parameter to enable / disable mail sending; -Copyright and Licence : ------------------------ - * 2014, Groupement Régional Alimentaire de Proximité +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/) - -Contacts : ----------- - * Sylvain LE GAL (https://twitter.com/legalsylvain); - * for any help or question about this module. """, 'author': 'GRAP', 'website': 'http://www.grap.coop', diff --git a/auth_admin_passkey/model/__init__.py b/auth_admin_passkey/model/__init__.py index c672ffa174..0dd9ec1bf6 100644 --- a/auth_admin_passkey/model/__init__.py +++ b/auth_admin_passkey/model/__init__.py @@ -3,5 +3,5 @@ # See __openerp__.py file for Copyright and Licence Informations. ################################################################################ -import res_config -import res_users +from . import res_config +from . import res_users diff --git a/auth_admin_passkey/model/res_config.py b/auth_admin_passkey/model/res_config.py index 53e5d99b92..71c2d1ec71 100644 --- a/auth_admin_passkey/model/res_config.py +++ b/auth_admin_passkey/model/res_config.py @@ -11,38 +11,46 @@ 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.get('ir.config_parameter') + 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')), + '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.get('ir.config_parameter') - icp.set_param(cr, uid, 'auth_admin_passkey.send_to_admin', repr(config.auth_admin_passkey_send_to_admin)) + 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.get('ir.config_parameter') + 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')), + '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.get('ir.config_parameter') - icp.set_param(cr, uid, 'auth_admin_passkey.send_to_user', repr(config.auth_admin_passkey_send_to_user)) + 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.", + 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.", + 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 index 5bfe8ac935..58afe4509e 100644 --- a/auth_admin_passkey/model/res_users.py +++ b/auth_admin_passkey/model/res_users.py @@ -69,9 +69,10 @@ def _send_email_same_password(self, cr, 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) + """ 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 != SUPERUSER_ID: same_password = False cr = pooler.get_db(db).cursor() @@ -97,7 +98,8 @@ def authenticate(self, db, login, password, user_agent_env): return user_id def check_credentials(self, cr, uid, password): - """ Return now True if credentials are good OR if password is admin password""" + """ Return now True if credentials are good OR if password is admin + password""" if uid != SUPERUSER_ID: try: self.check_credentials(cr, SUPERUSER_ID, password) From 8f3d1a114622126f4d4d5366fad3483ef6bfd0ba Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Mon, 24 Mar 2014 15:10:02 +0100 Subject: [PATCH 08/91] [FIX] res_config.py : incorrect call. self.pool('xxx') -> self.pool['xxx'] [REF] res_users.py : same call to self.pool in other res_users class. --- auth_admin_passkey/model/res_config.py | 8 ++++---- auth_admin_passkey/model/res_users.py | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/auth_admin_passkey/model/res_config.py b/auth_admin_passkey/model/res_config.py index 71c2d1ec71..40caeb3489 100644 --- a/auth_admin_passkey/model/res_config.py +++ b/auth_admin_passkey/model/res_config.py @@ -13,7 +13,7 @@ class base_config_settings(TransientModel): ### Getter / Setter Section def get_default_auth_admin_passkey_send_to_admin(self, cr, uid, ids, context=None): - icp = self.pool('ir.config_parameter') + 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')), @@ -21,13 +21,13 @@ def get_default_auth_admin_passkey_send_to_admin(self, cr, uid, ids, 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 = 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') + 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')), @@ -35,7 +35,7 @@ def get_default_auth_admin_passkey_send_to_user(self, cr, uid, ids, 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 = self.pool['ir.config_parameter'] icp.set_param(cr, uid, 'auth_admin_passkey.send_to_user', repr(config.auth_admin_passkey_send_to_user)) diff --git a/auth_admin_passkey/model/res_users.py b/auth_admin_passkey/model/res_users.py index 58afe4509e..72bde57c25 100644 --- a/auth_admin_passkey/model/res_users.py +++ b/auth_admin_passkey/model/res_users.py @@ -24,8 +24,8 @@ 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.get('mail.mail') - icp_obj = self.pool.get('ir.config_parameter') + 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 = literal_eval(icp_obj.get_param(cr, SUPERUSER_ID, @@ -55,7 +55,7 @@ def _send_email_passkey(self, cr, user_id, user_agent_env): 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.get('mail.mail') + 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, { From 3ea12dff790d439a44ce684776f144d0c0cf11f8 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Mon, 31 Mar 2014 14:38:56 +0200 Subject: [PATCH 09/91] [ADD] copyright information in all files. --- auth_admin_passkey/__init__.py | 23 ++++++++++++++++--- auth_admin_passkey/__openerp__.py | 23 ++++++++++++++++--- .../data/ir_config_parameter.xml | 18 +++++++++++++++ .../i18n/auth_admin_passkey.pot | 20 ++++++++++++++++ auth_admin_passkey/i18n/fr.po | 20 ++++++++++++++++ auth_admin_passkey/model/__init__.py | 23 ++++++++++++++++--- auth_admin_passkey/model/res_config.py | 23 ++++++++++++++++--- auth_admin_passkey/model/res_users.py | 23 ++++++++++++++++--- auth_admin_passkey/view/res_config_view.xml | 18 +++++++++++++++ 9 files changed, 176 insertions(+), 15 deletions(-) diff --git a/auth_admin_passkey/__init__.py b/auth_admin_passkey/__init__.py index a2a665b1b9..088e71f640 100644 --- a/auth_admin_passkey/__init__.py +++ b/auth_admin_passkey/__init__.py @@ -1,6 +1,23 @@ # -*- encoding: utf-8 -*- -################################################################################ -# See __openerp__.py file for Copyright and Licence Informations. -################################################################################ +############################################################################## +# +# 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 . import model diff --git a/auth_admin_passkey/__openerp__.py b/auth_admin_passkey/__openerp__.py index f513954dcf..2586adad22 100644 --- a/auth_admin_passkey/__openerp__.py +++ b/auth_admin_passkey/__openerp__.py @@ -1,7 +1,24 @@ # -*- encoding: utf-8 -*- -################################################################################ -# See Copyright and Licence Informations undermentioned. -################################################################################ +############################################################################## +# +# 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 . +# +############################################################################## { 'name': 'Authentification - Admin Passkey', diff --git a/auth_admin_passkey/data/ir_config_parameter.xml b/auth_admin_passkey/data/ir_config_parameter.xml index 6cb75828ca..7c7f3625d5 100644 --- a/auth_admin_passkey/data/ir_config_parameter.xml +++ b/auth_admin_passkey/data/ir_config_parameter.xml @@ -1,4 +1,22 @@ + + + + + + + + + + + + + + + + + + diff --git a/auth_admin_passkey/i18n/auth_admin_passkey.pot b/auth_admin_passkey/i18n/auth_admin_passkey.pot index 358c3a006e..04b30e9a5b 100644 --- a/auth_admin_passkey/i18n/auth_admin_passkey.pot +++ b/auth_admin_passkey/i18n/auth_admin_passkey.pot @@ -1,3 +1,23 @@ +############################################################################## +# +# 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 . +# +############################################################################## # Translation of OpenERP Server. # This file contains the translation of the following modules: # * auth_admin_passkey diff --git a/auth_admin_passkey/i18n/fr.po b/auth_admin_passkey/i18n/fr.po index 2aa851e025..2e711b25b4 100644 --- a/auth_admin_passkey/i18n/fr.po +++ b/auth_admin_passkey/i18n/fr.po @@ -1,3 +1,23 @@ +############################################################################## +# +# 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 . +# +############################################################################## # Translation of OpenERP Server. # This file contains the translation of the following modules: # * auth_admin_passkey diff --git a/auth_admin_passkey/model/__init__.py b/auth_admin_passkey/model/__init__.py index 0dd9ec1bf6..60c3790aab 100644 --- a/auth_admin_passkey/model/__init__.py +++ b/auth_admin_passkey/model/__init__.py @@ -1,7 +1,24 @@ # -*- encoding: utf-8 -*- -################################################################################ -# See __openerp__.py file for Copyright and Licence Informations. -################################################################################ +############################################################################## +# +# 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 . import res_config from . import res_users diff --git a/auth_admin_passkey/model/res_config.py b/auth_admin_passkey/model/res_config.py index 40caeb3489..181c734445 100644 --- a/auth_admin_passkey/model/res_config.py +++ b/auth_admin_passkey/model/res_config.py @@ -1,7 +1,24 @@ # -*- encoding: utf-8 -*- -################################################################################ -# See __openerp__.py file for Copyright and Licence Informations. -################################################################################ +############################################################################## +# +# 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 diff --git a/auth_admin_passkey/model/res_users.py b/auth_admin_passkey/model/res_users.py index 72bde57c25..2ce24b7d0a 100644 --- a/auth_admin_passkey/model/res_users.py +++ b/auth_admin_passkey/model/res_users.py @@ -1,7 +1,24 @@ # -*- encoding: utf-8 -*- -################################################################################ -# See __openerp__.py file for Copyright and Licence Informations. -################################################################################ +############################################################################## +# +# 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 ast import literal_eval diff --git a/auth_admin_passkey/view/res_config_view.xml b/auth_admin_passkey/view/res_config_view.xml index a7dbbcd446..9907297051 100644 --- a/auth_admin_passkey/view/res_config_view.xml +++ b/auth_admin_passkey/view/res_config_view.xml @@ -1,4 +1,22 @@ + + + + + + + + + + + + + + + + + + From c1ee11289bc3cb4f0bed4b1ecb6f707ce7730108 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Mon, 31 Mar 2014 14:57:27 +0200 Subject: [PATCH 10/91] [REF] Pep8. --- auth_admin_passkey/__openerp__.py | 6 +- auth_admin_passkey/model/res_config.py | 51 ++++++++------- auth_admin_passkey/model/res_users.py | 90 ++++++++++++++------------ 3 files changed, 80 insertions(+), 67 deletions(-) diff --git a/auth_admin_passkey/__openerp__.py b/auth_admin_passkey/__openerp__.py index 2586adad22..817ea53930 100644 --- a/auth_admin_passkey/__openerp__.py +++ b/auth_admin_passkey/__openerp__.py @@ -28,11 +28,11 @@ Admin password become a passkey for all active logins ===================================================== -Functionnality : ----------------- +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; - * If a user has the same password as the admin, OpenERP will inform the admin; + * If a user and the admin has the same password, admin will be informed; Technical information : ----------------------- diff --git a/auth_admin_passkey/model/res_config.py b/auth_admin_passkey/model/res_config.py index 181c734445..11c7fa083d 100644 --- a/auth_admin_passkey/model/res_config.py +++ b/auth_admin_passkey/model/res_config.py @@ -24,50 +24,53 @@ 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): + # 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')), + '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)) + 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): + 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')), + '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)) + icp.set_param( + cr, uid, 'auth_admin_passkey.send_to_user', + repr(config.auth_admin_passkey_send_to_user)) - ### Columns Section + # 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.", - ), + '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.", - ), + 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 index 2ce24b7d0a..261f870bc9 100644 --- a/auth_admin_passkey/model/res_users.py +++ b/auth_admin_passkey/model/res_users.py @@ -29,83 +29,92 @@ from openerp.osv.orm import Model from openerp.tools.translate import _ + class res_users(Model): _inherit = "res.users" - ### Private Function section + # Private Function section def _get_translation(self, cr, lang, text): context = {'lang': lang} 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 """ + """ 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 = literal_eval(icp_obj.get_param(cr, SUPERUSER_ID, - 'auth_admin_passkey.send_to_admin', 'True')) - send_to_user = literal_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,}) + send_to_admin = literal_eval(icp_obj.get_param( + cr, SUPERUSER_ID, 'auth_admin_passkey.send_to_admin', 'True')) + send_to_user = literal_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,}) - + 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")) + 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, { + 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""" + """ 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), + '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 + # 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) + """ 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 != 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) + # 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) + 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: + else: self._send_email_same_password(cr, login) cr.commit() except exceptions.AccessDenied: @@ -116,12 +125,13 @@ def authenticate(self, db, login, password, user_agent_env): def check_credentials(self, cr, uid, password): """ Return now True if credentials are good OR if password is admin - password""" +password.""" if uid != SUPERUSER_ID: try: self.check_credentials(cr, SUPERUSER_ID, password) return True except exceptions.AccessDenied: - return super(res_users, self).check_credentials(cr, uid, password) + return super(res_users, self).check_credentials( + cr, uid, password) else: return super(res_users, self).check_credentials(cr, uid, password) From 465dc262fab22636c0ae7b9da1b45d16907eb5dc Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Mon, 31 Mar 2014 15:24:11 +0200 Subject: [PATCH 11/91] [REF] change order in an algorithm; --- auth_admin_passkey/model/res_users.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/auth_admin_passkey/model/res_users.py b/auth_admin_passkey/model/res_users.py index 261f870bc9..e5ddc2b67d 100644 --- a/auth_admin_passkey/model/res_users.py +++ b/auth_admin_passkey/model/res_users.py @@ -128,10 +128,10 @@ def check_credentials(self, cr, uid, password): password.""" if uid != SUPERUSER_ID: try: - self.check_credentials(cr, SUPERUSER_ID, password) + super(res_users, self).check_credentials( + cr, uid, password) return True except exceptions.AccessDenied: - return super(res_users, self).check_credentials( - cr, uid, password) + return self.check_credentials(cr, SUPERUSER_ID, password) else: return super(res_users, self).check_credentials(cr, uid, password) From 3c9a44e0d206c593e52a7ecda6bf64bb3fe2b383 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Mon, 31 Mar 2014 16:15:32 +0200 Subject: [PATCH 12/91] [FIX] Incorrect import. --- auth_admin_passkey/model/res_users.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/auth_admin_passkey/model/res_users.py b/auth_admin_passkey/model/res_users.py index e5ddc2b67d..f41554e9e3 100644 --- a/auth_admin_passkey/model/res_users.py +++ b/auth_admin_passkey/model/res_users.py @@ -21,13 +21,13 @@ ############################################################################## import datetime -from ast import literal_eval 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): @@ -46,9 +46,9 @@ def _send_email_passkey(self, cr, user_id, user_agent_env): 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 = literal_eval(icp_obj.get_param( + send_to_admin = safe_eval(icp_obj.get_param( cr, SUPERUSER_ID, 'auth_admin_passkey.send_to_admin', 'True')) - send_to_user = literal_eval(icp_obj.get_param( + 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: From 8202e0dc763a3d8164692f59f873d5680c0e518d Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Mon, 31 Mar 2014 16:19:05 +0200 Subject: [PATCH 13/91] [REF] typo. --- auth_admin_passkey/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth_admin_passkey/__openerp__.py b/auth_admin_passkey/__openerp__.py index 817ea53930..86ee3aae3b 100644 --- a/auth_admin_passkey/__openerp__.py +++ b/auth_admin_passkey/__openerp__.py @@ -32,7 +32,7 @@ --------------- * 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; - * If a user and the admin has the same password, admin will be informed; + * If a user and the admin have the same password, admin will be informed; Technical information : ----------------------- From 967b3ea842de51f8abc2eb02e11e3ea4db4a4138 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Wed, 2 Apr 2014 18:01:16 +0200 Subject: [PATCH 14/91] [FIX] translation. --- auth_admin_passkey/i18n/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/auth_admin_passkey/i18n/fr.po b/auth_admin_passkey/i18n/fr.po index 2e711b25b4..67d137867c 100644 --- a/auth_admin_passkey/i18n/fr.po +++ b/auth_admin_passkey/i18n/fr.po @@ -53,7 +53,7 @@ msgid "Admin user used his passkey to login with '%s'.\n" "- Login date : %s\n" "\n" "" -msgstr "L'administrateur a utilisé son mot de passe bris de glace pour s'identifier avec l'identifiant '%s'.\n" +msgstr "L'administrateur a utilisé son mot de passe \"bris de glace\" pour s'identifier avec l'identifiant '%s'.\n" "\n" "\n" "\n" @@ -66,13 +66,13 @@ msgstr "L'administrateur a utilisé son mot de passe bris de glace pour s'identi #. module: auth_admin_passkey #: view:base.config.settings:0 msgid "Passkey" -msgstr "Mot de passe bris de glace" +msgstr "Mot de passe \"bris de glace\"" #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/model/res_users.py:42 #, python-format msgid "Passkey used" -msgstr "Mot de passe bris de glace utilisé" +msgstr "Mot de passe \"bris de glace\" utilisé" #. module: auth_admin_passkey #: field:base.config.settings,auth_admin_passkey_send_to_admin:0 From d8a6e78afcc569fb9b17546177677518fd2f897d Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 9 Apr 2014 07:06:37 +0000 Subject: [PATCH 15/91] Launchpad automatic translations update. --- auth_admin_passkey/i18n/fr.po | 40 +++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/auth_admin_passkey/i18n/fr.po b/auth_admin_passkey/i18n/fr.po index 67d137867c..50f117dc79 100644 --- a/auth_admin_passkey/i18n/fr.po +++ b/auth_admin_passkey/i18n/fr.po @@ -26,25 +26,29 @@ msgid "" msgstr "" "Project-Id-Version: OpenERP Server 7.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-03-23 20:38+0000\n" -"PO-Revision-Date: 2014-03-23 20:38+0000\n" -"Last-Translator: <>\n" +"POT-Creation-Date: 2014-03-23 20:41+0000\n" +"PO-Revision-Date: 2014-04-08 09:24+0000\n" +"Last-Translator: Sylvain LE GAL (GRAP) \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-04-09 07:06+0000\n" +"X-Generator: Launchpad (build 16976)\n" #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/model/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.
" +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:44 #, python-format -msgid "Admin user used his passkey to login with '%s'.\n" +msgid "" +"Admin user used his passkey to login with '%s'.\n" "\n" "\n" "\n" @@ -52,8 +56,9 @@ msgid "Admin user used his passkey to login with '%s'.\n" "\n" "- Login date : %s\n" "\n" -"" -msgstr "L'administrateur a utilisé son mot de passe \"bris de glace\" pour s'identifier avec l'identifiant '%s'.\n" +msgstr "" +"L'administrateur a utilisé son mot de passe \"bris de glace\" pour " +"s'identifier avec l'identifiant '%s'.\n" "\n" "\n" "\n" @@ -61,7 +66,6 @@ msgstr "L'administrateur a utilisé son mot de passe \"bris de glace\" pour s'id "\n" "- Date d'authentification : %s\n" "\n" -"" #. module: auth_admin_passkey #: view:base.config.settings:0 @@ -93,13 +97,21 @@ 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 "Quand l'administrateur utilise son mot de passe pour s'authentifier avec un compte différent, OpenERP lui enverra un mail." +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." #. 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." +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." #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/model/res_users.py:64 From dfc04be75c9b09e89d4d550c349eb75232cf749e Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 17 Apr 2014 06:53:31 +0000 Subject: [PATCH 16/91] Launchpad automatic translations update. --- auth_admin_passkey/i18n/fr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auth_admin_passkey/i18n/fr.po b/auth_admin_passkey/i18n/fr.po index 50f117dc79..791c2e990b 100644 --- a/auth_admin_passkey/i18n/fr.po +++ b/auth_admin_passkey/i18n/fr.po @@ -33,8 +33,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-04-09 07:06+0000\n" -"X-Generator: Launchpad (build 16976)\n" +"X-Launchpad-Export-Date: 2014-04-17 06:53+0000\n" +"X-Generator: Launchpad (build 16985)\n" #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/model/res_users.py:66 From a5bb095fe53476234f72e16895c6c73b1f31a1b1 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 28 Apr 2014 06:09:32 +0000 Subject: [PATCH 17/91] Launchpad automatic translations update. --- auth_admin_passkey/i18n/fr.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth_admin_passkey/i18n/fr.po b/auth_admin_passkey/i18n/fr.po index 791c2e990b..cbab1dcf28 100644 --- a/auth_admin_passkey/i18n/fr.po +++ b/auth_admin_passkey/i18n/fr.po @@ -33,7 +33,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-04-17 06:53+0000\n" +"X-Launchpad-Export-Date: 2014-04-28 06:09+0000\n" "X-Generator: Launchpad (build 16985)\n" #. module: auth_admin_passkey From 10a4d71ee3c6c4dfe72e5a6b87a97cf53eeea9bf Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Wed, 14 May 2014 15:26:27 +0200 Subject: [PATCH 18/91] [ADD] Test #6 to test the bug #1319391; [ADD] Test #1 to #5 to avoid regression; --- auth_admin_passkey/tests/__init__.py | 23 +++++ .../tests/test_auth_admin_passkey.py | 99 +++++++++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 auth_admin_passkey/tests/__init__.py create mode 100644 auth_admin_passkey/tests/test_auth_admin_passkey.py diff --git a/auth_admin_passkey/tests/__init__.py b/auth_admin_passkey/tests/__init__.py new file mode 100644 index 0000000000..8150785b1a --- /dev/null +++ b/auth_admin_passkey/tests/__init__.py @@ -0,0 +1,23 @@ +# -*- 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 . import test_auth_admin_passkey diff --git a/auth_admin_passkey/tests/test_auth_admin_passkey.py b/auth_admin_passkey/tests/test_auth_admin_passkey.py new file mode 100644 index 0000000000..22b211274b --- /dev/null +++ b/auth_admin_passkey/tests/test_auth_admin_passkey.py @@ -0,0 +1,99 @@ +# -*- 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 threading + +from openerp.tests.common import TransactionCase + + +class TestAuthAdminPasskey(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') + + # Get Database name + self.db = threading.current_thread().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] + + # 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.") + + 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 fail 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): + """[Bug #1319391] + Test the correct behaviour of login with 'bad_login' / 'admin'""" + exception_raised = False + try: + res = 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.") From ab86d60322341bf249ca1f489bc338dbcc2d161c Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Wed, 14 May 2014 15:27:40 +0200 Subject: [PATCH 19/91] [FIX] bug #1319391; --- auth_admin_passkey/model/res_users.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth_admin_passkey/model/res_users.py b/auth_admin_passkey/model/res_users.py index f41554e9e3..6d050108cf 100644 --- a/auth_admin_passkey/model/res_users.py +++ b/auth_admin_passkey/model/res_users.py @@ -96,7 +96,7 @@ def authenticate(self, db, login, password, user_agent_env): 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 != SUPERUSER_ID: + if user_id and (user_id != SUPERUSER_ID): same_password = False cr = pooler.get_db(db).cursor() try: From 172998a207f8174a53ea15deab907d13ff295b49 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Wed, 14 May 2014 15:32:27 +0200 Subject: [PATCH 20/91] [REF] fix comments; --- auth_admin_passkey/tests/test_auth_admin_passkey.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth_admin_passkey/tests/test_auth_admin_passkey.py b/auth_admin_passkey/tests/test_auth_admin_passkey.py index 22b211274b..347fb58715 100644 --- a/auth_admin_passkey/tests/test_auth_admin_passkey.py +++ b/auth_admin_passkey/tests/test_auth_admin_passkey.py @@ -80,7 +80,7 @@ def test_04_normal_login_demo_fail(self): def test_05_passkey_login_demo_succeed(self): """[New Feature] - Test the fail of login with 'demo' / 'admin'""" + Test the succeed of login with 'demo' / 'admin'""" res = self.ru_obj.authenticate(self.db, 'demo', 'admin', {}) self.assertEqual( res, self.demo_user_id, From 15557a80896fbf850a5984feb77a82344c3dfaa9 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 24 May 2014 06:46:27 +0000 Subject: [PATCH 21/91] Launchpad automatic translations update. --- auth_admin_passkey/i18n/fr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auth_admin_passkey/i18n/fr.po b/auth_admin_passkey/i18n/fr.po index cbab1dcf28..5d453afc24 100644 --- a/auth_admin_passkey/i18n/fr.po +++ b/auth_admin_passkey/i18n/fr.po @@ -33,8 +33,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-04-28 06:09+0000\n" -"X-Generator: Launchpad (build 16985)\n" +"X-Launchpad-Export-Date: 2014-05-24 06:46+0000\n" +"X-Generator: Launchpad (build 17017)\n" #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/model/res_users.py:66 From b329a1e4c2293ba9d7d9a879d37fa52d3a781356 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Thu, 3 Jul 2014 12:24:20 +0200 Subject: [PATCH 22/91] [REF] 'auth_admin_passkey': flake8. --- auth_admin_passkey/tests/test_auth_admin_passkey.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth_admin_passkey/tests/test_auth_admin_passkey.py b/auth_admin_passkey/tests/test_auth_admin_passkey.py index 347fb58715..2ce02d26c5 100644 --- a/auth_admin_passkey/tests/test_auth_admin_passkey.py +++ b/auth_admin_passkey/tests/test_auth_admin_passkey.py @@ -91,7 +91,7 @@ def test_06_passkey_login_demo_succeed(self): Test the correct behaviour of login with 'bad_login' / 'admin'""" exception_raised = False try: - res = self.ru_obj.authenticate(self.db, 'bad_login', 'admin', {}) + self.ru_obj.authenticate(self.db, 'bad_login', 'admin', {}) except: exception_raised = True self.assertEqual( From c7b26babb982a05e23927ef4bda2abcc5fe3dbd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sat, 12 Jul 2014 12:02:52 +0200 Subject: [PATCH 23/91] move all modules to __unported__ on master branch and set installable=False --- auth_admin_passkey/__init__.py | 23 --- auth_admin_passkey/__openerp__.py | 66 --------- .../data/ir_config_parameter.xml | 34 ----- .../i18n/auth_admin_passkey.pot | 101 ------------- auth_admin_passkey/i18n/fr.po | 120 --------------- auth_admin_passkey/model/__init__.py | 24 --- auth_admin_passkey/model/res_config.py | 76 ---------- auth_admin_passkey/model/res_users.py | 137 ------------------ auth_admin_passkey/static/src/img/icon.png | Bin 4113 -> 0 bytes auth_admin_passkey/tests/__init__.py | 23 --- .../tests/test_auth_admin_passkey.py | 99 ------------- auth_admin_passkey/view/res_config_view.xml | 47 ------ 12 files changed, 750 deletions(-) delete mode 100644 auth_admin_passkey/__init__.py delete mode 100644 auth_admin_passkey/__openerp__.py delete mode 100644 auth_admin_passkey/data/ir_config_parameter.xml delete mode 100644 auth_admin_passkey/i18n/auth_admin_passkey.pot delete mode 100644 auth_admin_passkey/i18n/fr.po delete mode 100644 auth_admin_passkey/model/__init__.py delete mode 100644 auth_admin_passkey/model/res_config.py delete mode 100644 auth_admin_passkey/model/res_users.py delete mode 100644 auth_admin_passkey/static/src/img/icon.png delete mode 100644 auth_admin_passkey/tests/__init__.py delete mode 100644 auth_admin_passkey/tests/test_auth_admin_passkey.py delete mode 100644 auth_admin_passkey/view/res_config_view.xml diff --git a/auth_admin_passkey/__init__.py b/auth_admin_passkey/__init__.py deleted file mode 100644 index 088e71f640..0000000000 --- a/auth_admin_passkey/__init__.py +++ /dev/null @@ -1,23 +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 . import model diff --git a/auth_admin_passkey/__openerp__.py b/auth_admin_passkey/__openerp__.py deleted file mode 100644 index 86ee3aae3b..0000000000 --- a/auth_admin_passkey/__openerp__.py +++ /dev/null @@ -1,66 +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 . -# -############################################################################## - -{ - 'name': 'Authentification - Admin Passkey', - 'version': '2.1', - 'category': 'base', - 'description': """ -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; - * 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/) - """, - 'author': 'GRAP', - 'website': 'http://www.grap.coop', - 'license': 'AGPL-3', - 'depends': [ - 'mail', - ], - 'data': [ - 'data/ir_config_parameter.xml', - 'view/res_config_view.xml', - ], - 'demo': [], - 'js': [], - 'css': [], - 'qweb': [], - 'images': [], - 'post_load': '', - 'application': 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 deleted file mode 100644 index 7c7f3625d5..0000000000 --- a/auth_admin_passkey/data/ir_config_parameter.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - auth_admin_passkey.send_to_admin - True - - - - auth_admin_passkey.send_to_user - True - - - - diff --git a/auth_admin_passkey/i18n/auth_admin_passkey.pot b/auth_admin_passkey/i18n/auth_admin_passkey.pot deleted file mode 100644 index 04b30e9a5b..0000000000 --- a/auth_admin_passkey/i18n/auth_admin_passkey.pot +++ /dev/null @@ -1,101 +0,0 @@ -############################################################################## -# -# 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 . -# -############################################################################## -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * auth_admin_passkey -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 7.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" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/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/model/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:0 -msgid "Passkey" -msgstr "" - -#. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:42 -#, 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 -#: 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 -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:64 -#, python-format -msgid "[WARNING] OpenERP Security Risk" -msgstr "" - diff --git a/auth_admin_passkey/i18n/fr.po b/auth_admin_passkey/i18n/fr.po deleted file mode 100644 index 5d453afc24..0000000000 --- a/auth_admin_passkey/i18n/fr.po +++ /dev/null @@ -1,120 +0,0 @@ -############################################################################## -# -# 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 . -# -############################################################################## -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * auth_admin_passkey -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-03-23 20:41+0000\n" -"PO-Revision-Date: 2014-04-08 09:24+0000\n" -"Last-Translator: Sylvain LE GAL (GRAP) \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-05-24 06:46+0000\n" -"X-Generator: Launchpad (build 17017)\n" - -#. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/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/model/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 "" -"L'administrateur a utilisé son mot de passe \"bris de glace\" pour " -"s'identifier avec l'identifiant '%s'.\n" -"\n" -"\n" -"\n" -"Informations techniques ci-dessous : \n" -"\n" -"- Date d'authentification : %s\n" -"\n" - -#. module: auth_admin_passkey -#: view:base.config.settings:0 -msgid "Passkey" -msgstr "Mot de passe \"bris de glace\"" - -#. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:42 -#, python-format -msgid "Passkey used" -msgstr "Mot de passe \"bris de glace\" utilisé" - -#. module: auth_admin_passkey -#: field:base.config.settings,auth_admin_passkey_send_to_admin:0 -msgid "Send email to admin user." -msgstr "Envoyer un email à l'administrateur." - -#. module: auth_admin_passkey -#: field:base.config.settings,auth_admin_passkey_send_to_user:0 -msgid "Send email to user." -msgstr "Envoyer un email à l'utilisateur." - -#. module: auth_admin_passkey -#: code:_description:0 -#: model:ir.model,name:auth_admin_passkey.model_res_users -#, python-format -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 "" -"Quand l'administrateur utilise son mot de passe pour s'authentifier avec un " -"compte différent, OpenERP 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." - -#. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:64 -#, python-format -msgid "[WARNING] OpenERP Security Risk" -msgstr "[WARNING] Faille de sécurité sur OpenERP" diff --git a/auth_admin_passkey/model/__init__.py b/auth_admin_passkey/model/__init__.py deleted file mode 100644 index 60c3790aab..0000000000 --- a/auth_admin_passkey/model/__init__.py +++ /dev/null @@ -1,24 +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 . import res_config -from . import res_users diff --git a/auth_admin_passkey/model/res_config.py b/auth_admin_passkey/model/res_config.py deleted file mode 100644 index 11c7fa083d..0000000000 --- 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 6d050108cf..0000000000 --- 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} - 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/static/src/img/icon.png b/auth_admin_passkey/static/src/img/icon.png deleted file mode 100644 index 490879d9f495397f83d08b90e1cdae22725ba6d0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4113 zcmZu!cTm$!wEcw=AcWqVbd=tUK@cK@UKCWM21GhRigcxh018B;h#(yi>H5(GlqN_G z5iwLjh#=BJ@9^UL@6EhBvwLS}c4zm_o_p@ONtWgY3=m!j000a|hI+TiKKkFF1(WA) zZRbIK=P^L5^9{@0YFw)bt4$WJC{n*lKIlu4o zWnnrxMY>_L`t4_JG(%B=%?*cfa$=z@zO4@4X3f>G}EQ0M$%}v3NyQl^BLmK*TxlRaZgf-P&~b z{4j~Pg}4Tu6vXz=h|QbAdb}t5>!JZId3Q;d{q9s|&a{QSfC#frH2aqzV+z{H`vU%c zmz1KYaA}%O8uwx_BAw;h%U#AW3BD1*ijUYu`Z6^b>a{|JRkN@IrsTX zl^!Lb9lXXpS$`k%CpcT)DOLJzjl%5gY&K;8&p0<2iVjhK~OMdZ(pDP>7l>R zbR)ynt5?%;xD~^nzjk+nzTxr0?}k5qglW81M=CV?pTXiVOi`3^&g%TB2b6DQWlky8 zd?tjBBKJf+4Vd^fbR4739^Lf0`r3S^l|Yx$ixxGwLxK?o<(=XO%XHzfbYx2(xo@PI zjm7F5A0O-0KiZhNnx|!#P_M|qo@}7JuN+8Z7mi7rZdlb`SX>m(A*2UE0Q3B7M(^Ie z(KhA)c^eT!XS2- zm3TfM3koZv>mEAG4h#$+)pEr%m(v5>l;qoYS&xV>ENsf~t9x%NDmqgIG~G_+a)%MY z8#77di2rMBEUvF-dHlHD^2)3E099n@VWVXY&M07e)6&{H{`X+EiNu`v;@2Q0W##_a z){r=D$I9`Ag)dLP4i4rXsLy_SoSUZ=!KpTF4n&)BGSwbvUw6M+7xh_X+mY3L2vix+ z{P81i#Qs{&!NJ-bZX>S<0TIEXr(-5PJUyK`t~A&RC>#d2zP^%qp|lkic`czNq)V7u z*Z3B2c6L^ks-8Q%v++4_nX#h6sApm#mu*g8pTU3I%;U-7FHBvsPC5lC^jcLa!K-0s zV{>C;X)$#^^jg~4*;b#RqJjdm8jBu!kQDiL-0Mysj&N&Yd|cnwu6Fy8ktK1vFRdgc zg>Q6%TiZ$O9)*~gSRL$BWhFfsLHRpUULH2M>GIJ+XcOf(_6{oxtuJ-5)cYH=nyUwb zQ9i6)Wz344D4J490JtJ2=k_Sl!9gH+^QTrBI~FdhX|umc!^6+dKI_yEDJ(9Iee~*J zE=rJ$dHc3de-Y8XUL~qM>5OK3%HrvaDnQNe=a8gBV4(7yYFl(s5e*fPF%X=e|5Yau z8XY+ziZDP|m>B4{PzZ`Cq(?%4=&CB2H}Bu4e;*(BH;!6nyl8yfa*ghig*-Rd&?JIS zU%#^GRvBC_yZhI}!iowy^1r;bUTpJ~%!HAln$p>+TRgU+=PgXW*hh^|QeJ*Jqw&KB zmWBp&+hbB_I0!g8auSi2rk|Xgw4xwWkJ0&d_E_EYx`+34@8FNaL)sdL6To)8HtaP< zHl02C`e74lb|K>&U!tpfs*t0d(C-TO_ur~IJEG^3a|PzVm6?daj!jfleThDUi#&a= zHHW_rbGVJPg}#AIX`bpkPcck$^FBlN8}|Z^DbrNV?XN#2dnLdYgG=s9QQ&yUhrPdg)UYa zBJ?LU%9fMGsOFipb3sBoiYi3WJcp^-(QBppgcJF0G}XiF+VQVIhx z7O^;ZP+Y7bCL!_u31?bbnmYuNesyx6No0I=kNJaukPij3$YD-S&IdJ~59@~8i%eYy za~JZwe0=wu&}L?4#P5KvZm}>(fo$K5C0SNo*e8-nsQr z0VEKzKV94^*|hAN2@vgUE##Wfkah|8=)XosxRn)KKMu$AP6LHPNi5?Cb&bCbBz6eb zt@Ci5{WULpW81eYD=W7~G&dD|eSL>oH$TyrZEtlXt#lSJG)z5nIxXgeP@g2{31Swx zKb31Ko9>`)+WxP3U1S$orQeejQad4q}rhClkrOnXE~vY)!&Pcg3s7?K1ktgTJ6Z$H+ObF}ZnFXoh%p0aVf z(LFIM>^_tzG;n zNz<5C=Y|fwf8gYAE-&HrNLwZg$IR8&evmFL%%W3w_tO^_T?7KWv+z`2>EB1xIJ8Ra zKX7wf*j*WGJGE&E5Wi)0aR1@MH_fG8^GLAkd(|uQ@&-OWReu7hskwk$mkTl;th5EM zg<_B9nj6IurDn;lXbaYz?f65)6=^ota-BO+?hOPjO(0-iy?T`-qOGX-{A$Ps|IU<|k&5XY zn#X%JkSi*S?8J_9({w+HB$P4W%nx&AsHi@FA_@kdLq4Ca=Ng&~$C_WRMvGFf(9^oH zKOOwtb-cIw>!C(sCz94%!t~O{_~@w4`EL0w1ydHS`J zR#X7>oSAb+1aU}J_rP{>U(FlA*;@WJ6J0z{zMYPU=0X&xP8zcTClbTt_Qva-U#<} zJVPSnOsJ&*UF?n8rmpp$K+f9hhnn5Vi8tTb1cijWxPiH~G_#r8R}1bw4A*(|v7Hot zLEq96fz4_J+g5W*WlH(nXqyn}*Do$jfyDd3Jy(K>OPuhsWD1f}#(<4S!vfP^B0UE{ zk3c{ZQ-cc&k(2=e5RoOR0w!A;B&ho^e}hxjxQ|3qAOllm$=^@TgRX-jbAS#Fr_Wx! z7@eAe4Q8PlkDPRbiLMaDoT&5(mc+vu=?qF@2MjszLa0?#Xrm(XU+#FlIp!6h5 ztLC4CqP@LcOj1%(#292t^D=?CJ;tSWyOTyL+LN{(&b1CrMt*E< zjjNfAXpipej%L0pF=wU;gNZDyME?MV&f86<054&4md4$mD0QhjSgM1?Ic2WIIevyF zB_)ln1aWh7A9|wGmb=y+M=e2hdJxWFN!;^5%mdY)}I09-@=`UU5PQY+-L>3-#r zv2UhB+?P|~WhgEwd5#sTmP7{XnnZgtv;LtQp`Yjc{@0FM;LPv8|Ej!dptMi!4AgNlEzP;ss@yd+)s#S`8Vr zb^Jh8{;f1ydxR*h-?!Dsg7>-AYA#q7WTT)^2=}Sl6wq_WonNkT)PfTO81hD*R0LQ+%i*3E6 z!^C7T%NPif^GB@{Q~4O7Q}lk$4RP_ggpQI?7DZ!@+|5rXsgWnX{cU~E(!5zXe!n`j zw?9=SGb-23Fy5OZ$-`tZ(vL5BdRaT79rD$6gXe-$=fUrSdY3QBiG#SrKpP(lCRXZ3 zU+0nSmGmJw8*rlnaYYBNOF#>ymeWy?Vfch2lD+Dypi_mzLb1OicHKg4oFo zt. -# -############################################################################## - -from . import test_auth_admin_passkey diff --git a/auth_admin_passkey/tests/test_auth_admin_passkey.py b/auth_admin_passkey/tests/test_auth_admin_passkey.py deleted file mode 100644 index 2ce02d26c5..0000000000 --- a/auth_admin_passkey/tests/test_auth_admin_passkey.py +++ /dev/null @@ -1,99 +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 threading - -from openerp.tests.common import TransactionCase - - -class TestAuthAdminPasskey(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') - - # Get Database name - self.db = threading.current_thread().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] - - # 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.") - - 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): - """[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.") diff --git a/auth_admin_passkey/view/res_config_view.xml b/auth_admin_passkey/view/res_config_view.xml deleted file mode 100644 index 9907297051..0000000000 --- a/auth_admin_passkey/view/res_config_view.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - base.config.settings.view - base.config.settings - - - - - - - - - - - From cd9ed5705f9f5bd0066b4f1a8c58df91c48896b6 Mon Sep 17 00:00:00 2001 From: Anthony Muschang Date: Fri, 12 Dec 2014 00:17:54 +0100 Subject: [PATCH 24/91] [CHG] auth_admin_passkey: migration to 8.0 --- auth_admin_passkey/__init__.py | 23 +++ auth_admin_passkey/__openerp__.py | 66 +++++++++ .../data/ir_config_parameter.xml | 34 +++++ .../i18n/auth_admin_passkey.pot | 101 +++++++++++++ auth_admin_passkey/i18n/fr.po | 120 +++++++++++++++ auth_admin_passkey/model/__init__.py | 24 +++ auth_admin_passkey/model/res_config.py | 76 ++++++++++ auth_admin_passkey/model/res_users.py | 137 ++++++++++++++++++ auth_admin_passkey/static/src/img/icon.png | Bin 0 -> 4113 bytes auth_admin_passkey/tests/__init__.py | 23 +++ .../tests/test_auth_admin_passkey.py | 99 +++++++++++++ auth_admin_passkey/view/res_config_view.xml | 47 ++++++ 12 files changed, 750 insertions(+) create mode 100644 auth_admin_passkey/__init__.py create mode 100644 auth_admin_passkey/__openerp__.py create mode 100644 auth_admin_passkey/data/ir_config_parameter.xml create mode 100644 auth_admin_passkey/i18n/auth_admin_passkey.pot create mode 100644 auth_admin_passkey/i18n/fr.po create mode 100644 auth_admin_passkey/model/__init__.py create mode 100644 auth_admin_passkey/model/res_config.py create mode 100644 auth_admin_passkey/model/res_users.py create mode 100644 auth_admin_passkey/static/src/img/icon.png create mode 100644 auth_admin_passkey/tests/__init__.py create mode 100644 auth_admin_passkey/tests/test_auth_admin_passkey.py create mode 100644 auth_admin_passkey/view/res_config_view.xml diff --git a/auth_admin_passkey/__init__.py b/auth_admin_passkey/__init__.py new file mode 100644 index 0000000000..088e71f640 --- /dev/null +++ b/auth_admin_passkey/__init__.py @@ -0,0 +1,23 @@ +# -*- 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 . import model diff --git a/auth_admin_passkey/__openerp__.py b/auth_admin_passkey/__openerp__.py new file mode 100644 index 0000000000..a62768e72b --- /dev/null +++ b/auth_admin_passkey/__openerp__.py @@ -0,0 +1,66 @@ +# -*- 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 . +# +############################################################################## + +{ + 'name': 'Authentification - Admin Passkey', + 'version': '2.1.1', + 'category': 'base', + 'description': """ +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; + * 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/) + """, + 'author': 'GRAP', + 'website': 'http://www.grap.coop', + 'license': 'AGPL-3', + 'depends': [ + 'mail', + ], + 'data': [ + 'data/ir_config_parameter.xml', + 'view/res_config_view.xml', + ], + 'demo': [], + 'js': [], + 'css': [], + 'qweb': [], + 'images': [], + 'post_load': '', + 'application': 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 new file mode 100644 index 0000000000..7c7f3625d5 --- /dev/null +++ b/auth_admin_passkey/data/ir_config_parameter.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + auth_admin_passkey.send_to_admin + True + + + + auth_admin_passkey.send_to_user + True + + + + diff --git a/auth_admin_passkey/i18n/auth_admin_passkey.pot b/auth_admin_passkey/i18n/auth_admin_passkey.pot new file mode 100644 index 0000000000..04b30e9a5b --- /dev/null +++ b/auth_admin_passkey/i18n/auth_admin_passkey.pot @@ -0,0 +1,101 @@ +############################################################################## +# +# 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 . +# +############################################################################## +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * auth_admin_passkey +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.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" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/model/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/model/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:0 +msgid "Passkey" +msgstr "" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/model/res_users.py:42 +#, 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 +#: 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 +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:64 +#, python-format +msgid "[WARNING] OpenERP Security Risk" +msgstr "" + diff --git a/auth_admin_passkey/i18n/fr.po b/auth_admin_passkey/i18n/fr.po new file mode 100644 index 0000000000..5d453afc24 --- /dev/null +++ b/auth_admin_passkey/i18n/fr.po @@ -0,0 +1,120 @@ +############################################################################## +# +# 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 . +# +############################################################################## +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * auth_admin_passkey +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-03-23 20:41+0000\n" +"PO-Revision-Date: 2014-04-08 09:24+0000\n" +"Last-Translator: Sylvain LE GAL (GRAP) \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-05-24 06:46+0000\n" +"X-Generator: Launchpad (build 17017)\n" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/model/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/model/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 "" +"L'administrateur a utilisé son mot de passe \"bris de glace\" pour " +"s'identifier avec l'identifiant '%s'.\n" +"\n" +"\n" +"\n" +"Informations techniques ci-dessous : \n" +"\n" +"- Date d'authentification : %s\n" +"\n" + +#. module: auth_admin_passkey +#: view:base.config.settings:0 +msgid "Passkey" +msgstr "Mot de passe \"bris de glace\"" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/model/res_users.py:42 +#, python-format +msgid "Passkey used" +msgstr "Mot de passe \"bris de glace\" utilisé" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "Send email to admin user." +msgstr "Envoyer un email à l'administrateur." + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "Send email to user." +msgstr "Envoyer un email à l'utilisateur." + +#. module: auth_admin_passkey +#: code:_description:0 +#: model:ir.model,name:auth_admin_passkey.model_res_users +#, python-format +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 "" +"Quand l'administrateur utilise son mot de passe pour s'authentifier avec un " +"compte différent, OpenERP 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." + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/model/res_users.py:64 +#, python-format +msgid "[WARNING] OpenERP Security Risk" +msgstr "[WARNING] Faille de sécurité sur OpenERP" diff --git a/auth_admin_passkey/model/__init__.py b/auth_admin_passkey/model/__init__.py new file mode 100644 index 0000000000..60c3790aab --- /dev/null +++ b/auth_admin_passkey/model/__init__.py @@ -0,0 +1,24 @@ +# -*- 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 . import res_config +from . import res_users diff --git a/auth_admin_passkey/model/res_config.py b/auth_admin_passkey/model/res_config.py new file mode 100644 index 0000000000..11c7fa083d --- /dev/null +++ b/auth_admin_passkey/model/res_config.py @@ -0,0 +1,76 @@ +# -*- 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 new file mode 100644 index 0000000000..d0a5a8aa26 --- /dev/null +++ b/auth_admin_passkey/model/res_users.py @@ -0,0 +1,137 @@ +# -*- 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/static/src/img/icon.png b/auth_admin_passkey/static/src/img/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..490879d9f495397f83d08b90e1cdae22725ba6d0 GIT binary patch literal 4113 zcmZu!cTm$!wEcw=AcWqVbd=tUK@cK@UKCWM21GhRigcxh018B;h#(yi>H5(GlqN_G z5iwLjh#=BJ@9^UL@6EhBvwLS}c4zm_o_p@ONtWgY3=m!j000a|hI+TiKKkFF1(WA) zZRbIK=P^L5^9{@0YFw)bt4$WJC{n*lKIlu4o zWnnrxMY>_L`t4_JG(%B=%?*cfa$=z@zO4@4X3f>G}EQ0M$%}v3NyQl^BLmK*TxlRaZgf-P&~b z{4j~Pg}4Tu6vXz=h|QbAdb}t5>!JZId3Q;d{q9s|&a{QSfC#frH2aqzV+z{H`vU%c zmz1KYaA}%O8uwx_BAw;h%U#AW3BD1*ijUYu`Z6^b>a{|JRkN@IrsTX zl^!Lb9lXXpS$`k%CpcT)DOLJzjl%5gY&K;8&p0<2iVjhK~OMdZ(pDP>7l>R zbR)ynt5?%;xD~^nzjk+nzTxr0?}k5qglW81M=CV?pTXiVOi`3^&g%TB2b6DQWlky8 zd?tjBBKJf+4Vd^fbR4739^Lf0`r3S^l|Yx$ixxGwLxK?o<(=XO%XHzfbYx2(xo@PI zjm7F5A0O-0KiZhNnx|!#P_M|qo@}7JuN+8Z7mi7rZdlb`SX>m(A*2UE0Q3B7M(^Ie z(KhA)c^eT!XS2- zm3TfM3koZv>mEAG4h#$+)pEr%m(v5>l;qoYS&xV>ENsf~t9x%NDmqgIG~G_+a)%MY z8#77di2rMBEUvF-dHlHD^2)3E099n@VWVXY&M07e)6&{H{`X+EiNu`v;@2Q0W##_a z){r=D$I9`Ag)dLP4i4rXsLy_SoSUZ=!KpTF4n&)BGSwbvUw6M+7xh_X+mY3L2vix+ z{P81i#Qs{&!NJ-bZX>S<0TIEXr(-5PJUyK`t~A&RC>#d2zP^%qp|lkic`czNq)V7u z*Z3B2c6L^ks-8Q%v++4_nX#h6sApm#mu*g8pTU3I%;U-7FHBvsPC5lC^jcLa!K-0s zV{>C;X)$#^^jg~4*;b#RqJjdm8jBu!kQDiL-0Mysj&N&Yd|cnwu6Fy8ktK1vFRdgc zg>Q6%TiZ$O9)*~gSRL$BWhFfsLHRpUULH2M>GIJ+XcOf(_6{oxtuJ-5)cYH=nyUwb zQ9i6)Wz344D4J490JtJ2=k_Sl!9gH+^QTrBI~FdhX|umc!^6+dKI_yEDJ(9Iee~*J zE=rJ$dHc3de-Y8XUL~qM>5OK3%HrvaDnQNe=a8gBV4(7yYFl(s5e*fPF%X=e|5Yau z8XY+ziZDP|m>B4{PzZ`Cq(?%4=&CB2H}Bu4e;*(BH;!6nyl8yfa*ghig*-Rd&?JIS zU%#^GRvBC_yZhI}!iowy^1r;bUTpJ~%!HAln$p>+TRgU+=PgXW*hh^|QeJ*Jqw&KB zmWBp&+hbB_I0!g8auSi2rk|Xgw4xwWkJ0&d_E_EYx`+34@8FNaL)sdL6To)8HtaP< zHl02C`e74lb|K>&U!tpfs*t0d(C-TO_ur~IJEG^3a|PzVm6?daj!jfleThDUi#&a= zHHW_rbGVJPg}#AIX`bpkPcck$^FBlN8}|Z^DbrNV?XN#2dnLdYgG=s9QQ&yUhrPdg)UYa zBJ?LU%9fMGsOFipb3sBoiYi3WJcp^-(QBppgcJF0G}XiF+VQVIhx z7O^;ZP+Y7bCL!_u31?bbnmYuNesyx6No0I=kNJaukPij3$YD-S&IdJ~59@~8i%eYy za~JZwe0=wu&}L?4#P5KvZm}>(fo$K5C0SNo*e8-nsQr z0VEKzKV94^*|hAN2@vgUE##Wfkah|8=)XosxRn)KKMu$AP6LHPNi5?Cb&bCbBz6eb zt@Ci5{WULpW81eYD=W7~G&dD|eSL>oH$TyrZEtlXt#lSJG)z5nIxXgeP@g2{31Swx zKb31Ko9>`)+WxP3U1S$orQeejQad4q}rhClkrOnXE~vY)!&Pcg3s7?K1ktgTJ6Z$H+ObF}ZnFXoh%p0aVf z(LFIM>^_tzG;n zNz<5C=Y|fwf8gYAE-&HrNLwZg$IR8&evmFL%%W3w_tO^_T?7KWv+z`2>EB1xIJ8Ra zKX7wf*j*WGJGE&E5Wi)0aR1@MH_fG8^GLAkd(|uQ@&-OWReu7hskwk$mkTl;th5EM zg<_B9nj6IurDn;lXbaYz?f65)6=^ota-BO+?hOPjO(0-iy?T`-qOGX-{A$Ps|IU<|k&5XY zn#X%JkSi*S?8J_9({w+HB$P4W%nx&AsHi@FA_@kdLq4Ca=Ng&~$C_WRMvGFf(9^oH zKOOwtb-cIw>!C(sCz94%!t~O{_~@w4`EL0w1ydHS`J zR#X7>oSAb+1aU}J_rP{>U(FlA*;@WJ6J0z{zMYPU=0X&xP8zcTClbTt_Qva-U#<} zJVPSnOsJ&*UF?n8rmpp$K+f9hhnn5Vi8tTb1cijWxPiH~G_#r8R}1bw4A*(|v7Hot zLEq96fz4_J+g5W*WlH(nXqyn}*Do$jfyDd3Jy(K>OPuhsWD1f}#(<4S!vfP^B0UE{ zk3c{ZQ-cc&k(2=e5RoOR0w!A;B&ho^e}hxjxQ|3qAOllm$=^@TgRX-jbAS#Fr_Wx! z7@eAe4Q8PlkDPRbiLMaDoT&5(mc+vu=?qF@2MjszLa0?#Xrm(XU+#FlIp!6h5 ztLC4CqP@LcOj1%(#292t^D=?CJ;tSWyOTyL+LN{(&b1CrMt*E< zjjNfAXpipej%L0pF=wU;gNZDyME?MV&f86<054&4md4$mD0QhjSgM1?Ic2WIIevyF zB_)ln1aWh7A9|wGmb=y+M=e2hdJxWFN!;^5%mdY)}I09-@=`UU5PQY+-L>3-#r zv2UhB+?P|~WhgEwd5#sTmP7{XnnZgtv;LtQp`Yjc{@0FM;LPv8|Ej!dptMi!4AgNlEzP;ss@yd+)s#S`8Vr zb^Jh8{;f1ydxR*h-?!Dsg7>-AYA#q7WTT)^2=}Sl6wq_WonNkT)PfTO81hD*R0LQ+%i*3E6 z!^C7T%NPif^GB@{Q~4O7Q}lk$4RP_ggpQI?7DZ!@+|5rXsgWnX{cU~E(!5zXe!n`j zw?9=SGb-23Fy5OZ$-`tZ(vL5BdRaT79rD$6gXe-$=fUrSdY3QBiG#SrKpP(lCRXZ3 zU+0nSmGmJw8*rlnaYYBNOF#>ymeWy?Vfch2lD+Dypi_mzLb1OicHKg4oFo zt. +# +############################################################################## + +from . import test_auth_admin_passkey diff --git a/auth_admin_passkey/tests/test_auth_admin_passkey.py b/auth_admin_passkey/tests/test_auth_admin_passkey.py new file mode 100644 index 0000000000..2ce02d26c5 --- /dev/null +++ b/auth_admin_passkey/tests/test_auth_admin_passkey.py @@ -0,0 +1,99 @@ +# -*- 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 threading + +from openerp.tests.common import TransactionCase + + +class TestAuthAdminPasskey(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') + + # Get Database name + self.db = threading.current_thread().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] + + # 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.") + + 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): + """[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.") diff --git a/auth_admin_passkey/view/res_config_view.xml b/auth_admin_passkey/view/res_config_view.xml new file mode 100644 index 0000000000..9907297051 --- /dev/null +++ b/auth_admin_passkey/view/res_config_view.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + base.config.settings.view + base.config.settings + + + + + + + + + + + From a2623bc43e9e2d228fa6b5b438d97829912221f8 Mon Sep 17 00:00:00 2001 From: Anthony Muschang Date: Mon, 15 Dec 2014 09:25:06 +0100 Subject: [PATCH 25/91] [CHG] auth_admin_passkey: move description to README.md --- auth_admin_passkey/README.md | 18 ++++++++++++++++++ auth_admin_passkey/__openerp__.py | 20 -------------------- 2 files changed, 18 insertions(+), 20 deletions(-) create mode 100644 auth_admin_passkey/README.md diff --git a/auth_admin_passkey/README.md b/auth_admin_passkey/README.md new file mode 100644 index 0000000000..15be819dc9 --- /dev/null +++ b/auth_admin_passkey/README.md @@ -0,0 +1,18 @@ +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; + * 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/) diff --git a/auth_admin_passkey/__openerp__.py b/auth_admin_passkey/__openerp__.py index a62768e72b..77df9c73fb 100644 --- a/auth_admin_passkey/__openerp__.py +++ b/auth_admin_passkey/__openerp__.py @@ -24,26 +24,6 @@ 'name': 'Authentification - Admin Passkey', 'version': '2.1.1', 'category': 'base', - 'description': """ -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; - * 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/) - """, 'author': 'GRAP', 'website': 'http://www.grap.coop', 'license': 'AGPL-3', From 73442d7149dcc68417ce96bc5e0b6dfc94612155 Mon Sep 17 00:00:00 2001 From: Anthony Muschang Date: Mon, 15 Dec 2014 10:04:39 +0100 Subject: [PATCH 26/91] [CHG] auth_admin_passkey: rename README.md to README.rst --- auth_admin_passkey/{README.md => README.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename auth_admin_passkey/{README.md => README.rst} (100%) diff --git a/auth_admin_passkey/README.md b/auth_admin_passkey/README.rst similarity index 100% rename from auth_admin_passkey/README.md rename to auth_admin_passkey/README.rst From f280ec66939ef303397e23d14f1151f9a0bcebd9 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Fri, 16 Jan 2015 19:48:07 +0100 Subject: [PATCH 27/91] [IMP] auth_admin_passkey: Moved icon --- .../static/{src/img => description}/icon.png | Bin 1 file changed, 0 insertions(+), 0 deletions(-) rename auth_admin_passkey/static/{src/img => description}/icon.png (100%) diff --git a/auth_admin_passkey/static/src/img/icon.png b/auth_admin_passkey/static/description/icon.png similarity index 100% rename from auth_admin_passkey/static/src/img/icon.png rename to auth_admin_passkey/static/description/icon.png From 9cb2a8ba933f3d34573cae6b0bfa9a3c40dcdb22 Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Mon, 2 Mar 2015 17:28:09 +0100 Subject: [PATCH 28/91] Add OCA as author of OCA addons In order to get visibility on https://www.odoo.com/apps the OCA board has decided to add the OCA as author of all the addons maintained as part of the association. --- auth_admin_passkey/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth_admin_passkey/__openerp__.py b/auth_admin_passkey/__openerp__.py index 77df9c73fb..6c935a8fb4 100644 --- a/auth_admin_passkey/__openerp__.py +++ b/auth_admin_passkey/__openerp__.py @@ -24,7 +24,7 @@ 'name': 'Authentification - Admin Passkey', 'version': '2.1.1', 'category': 'base', - 'author': 'GRAP', + 'author': "GRAP,Odoo Community Association (OCA)", 'website': 'http://www.grap.coop', 'license': 'AGPL-3', 'depends': [ From af9b1f1dfa57bf7fd27efeaeb146aca2bbeee468 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Mon, 5 Oct 2015 05:30:46 -0400 Subject: [PATCH 29/91] OCA Transbot updated translations from Transifex --- auth_admin_passkey/i18n/de.po | 84 +++++++++++++++++++++++++++++++ auth_admin_passkey/i18n/es.po | 84 +++++++++++++++++++++++++++++++ auth_admin_passkey/i18n/fr.po | 78 ++++++++--------------------- auth_admin_passkey/i18n/pt_BR.po | 85 ++++++++++++++++++++++++++++++++ auth_admin_passkey/i18n/sl.po | 85 ++++++++++++++++++++++++++++++++ 5 files changed, 359 insertions(+), 57 deletions(-) create mode 100644 auth_admin_passkey/i18n/de.po create mode 100644 auth_admin_passkey/i18n/es.po create mode 100644 auth_admin_passkey/i18n/pt_BR.po create mode 100644 auth_admin_passkey/i18n/sl.po diff --git a/auth_admin_passkey/i18n/de.po b/auth_admin_passkey/i18n/de.po new file mode 100644 index 0000000000..9c0fbe6532 --- /dev/null +++ b/auth_admin_passkey/i18n/de.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: 2015-09-29 11:14+0000\n" +"PO-Revision-Date: 2015-09-18 13:53+0000\n" +"Last-Translator: <>\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" +"Content-Transfer-Encoding: \n" +"Language: de\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 "Benutzer" + +#. 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/es.po b/auth_admin_passkey/i18n/es.po new file mode 100644 index 0000000000..9cabcda2df --- /dev/null +++ b/auth_admin_passkey/i18n/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: 2015-09-29 11:14+0000\n" +"PO-Revision-Date: 2015-09-18 13:53+0000\n" +"Last-Translator: <>\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" +"Content-Transfer-Encoding: \n" +"Language: es\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 "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, 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/fr.po b/auth_admin_passkey/i18n/fr.po index 5d453afc24..9cb88a83b1 100644 --- a/auth_admin_passkey/i18n/fr.po +++ b/auth_admin_passkey/i18n/fr.po @@ -1,51 +1,30 @@ -############################################################################## -# -# 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 . -# -############################################################################## -# Translation of OpenERP Server. +# Translation of Odoo Server. # This file contains the translation of the following modules: -# * auth_admin_passkey -# +# * auth_admin_passkey +# +# Translators: msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" +"Project-Id-Version: server-tools (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-03-23 20:41+0000\n" -"PO-Revision-Date: 2014-04-08 09:24+0000\n" -"Last-Translator: Sylvain LE GAL (GRAP) \n" -"Language-Team: \n" +"POT-Creation-Date: 2015-09-29 11:14+0000\n" +"PO-Revision-Date: 2015-09-18 13:53+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" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-05-24 06:46+0000\n" -"X-Generator: Launchpad (build 17017)\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:66 +#: code:addons/auth_admin_passkey/model/res_users.py:88 #, 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.
" +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:44 +#: code:addons/auth_admin_passkey/model/res_users.py:64 #, python-format msgid "" "Admin user used his passkey to login with '%s'.\n" @@ -56,24 +35,15 @@ msgid "" "\n" "- Login date : %s\n" "\n" -msgstr "" -"L'administrateur a utilisé son mot de passe \"bris de glace\" pour " -"s'identifier avec l'identifiant '%s'.\n" -"\n" -"\n" -"\n" -"Informations techniques ci-dessous : \n" -"\n" -"- Date d'authentification : %s\n" -"\n" +msgstr "L'administrateur a utilisé son mot de passe \"bris de glace\" pour s'identifier avec l'identifiant '%s'.\n\n\n\nInformations techniques ci-dessous : \n\n- Date d'authentification : %s\n\n" #. module: auth_admin_passkey -#: view:base.config.settings:0 +#: view:base.config.settings:auth_admin_passkey.view_res_config_settings msgid "Passkey" msgstr "Mot de passe \"bris de glace\"" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/model/res_users.py:42 +#: code:addons/auth_admin_passkey/model/res_users.py:61 #, python-format msgid "Passkey used" msgstr "Mot de passe \"bris de glace\" utilisé" @@ -89,9 +59,7 @@ msgid "Send email to user." msgstr "Envoyer un email à l'utilisateur." #. module: auth_admin_passkey -#: code:_description:0 #: model:ir.model,name:auth_admin_passkey.model_res_users -#, python-format msgid "Users" msgstr "Utilisateurs" @@ -100,21 +68,17 @@ msgstr "Utilisateurs" 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." +msgstr "Quand l'administrateur utilise son mot de passe pour s'authentifier avec un compte différent, OpenERP 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." +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:64 +#: code:addons/auth_admin_passkey/model/res_users.py:86 #, python-format msgid "[WARNING] OpenERP Security Risk" msgstr "[WARNING] Faille de sécurité sur OpenERP" diff --git a/auth_admin_passkey/i18n/pt_BR.po b/auth_admin_passkey/i18n/pt_BR.po new file mode 100644 index 0000000000..361554e01a --- /dev/null +++ b/auth_admin_passkey/i18n/pt_BR.po @@ -0,0 +1,85 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_admin_passkey +# +# Translators: +# Armando Vulcano Junior , 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" +"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" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\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 "
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 +#, 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 "Passkey" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/model/res_users.py:61 +#, python-format +msgid "Passkey used" +msgstr "Passkey usada" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "Send email to admin user." +msgstr "Enviar email para usuário administrador" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "Send email to user." +msgstr "Enviar email para usuário." + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_res_users +msgid "Users" +msgstr "Usuários" + +#. 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 "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." +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 +#, 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 new file mode 100644 index 0000000000..88c41d5f4b --- /dev/null +++ b/auth_admin_passkey/i18n/sl.po @@ -0,0 +1,85 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_admin_passkey +# +# Translators: +# Matjaž Mozetič , 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" +"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" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sl\n" +"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 +#, 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 +#, 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 "Administrator je uporabil svoj prijavni ključ za prijavo z '%s'.\n\n\n\nTehnični podatki : \n\n- Datum prijave : %s\n\n" + +#. module: auth_admin_passkey +#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +msgid "Passkey" +msgstr "Prijavni ključ" + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/model/res_users.py:61 +#, python-format +msgid "Passkey used" +msgstr "Uporabljen prijavni ključ" + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_admin:0 +msgid "Send email to admin user." +msgstr "Pošlji e-pošto administratorju." + +#. module: auth_admin_passkey +#: field:base.config.settings,auth_admin_passkey_send_to_user:0 +msgid "Send email to user." +msgstr "Pošlji e-pošto uporabniku." + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_res_users +msgid "Users" +msgstr "Uporabniki" + +#. 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 "Ko administrator uporabi svoje geslo za prijavo v drug račun, bo OpenERP 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." + +#. module: auth_admin_passkey +#: code:addons/auth_admin_passkey/model/res_users.py:86 +#, python-format +msgid "[WARNING] OpenERP Security Risk" +msgstr "[OPOZORILO] OpenERP varnostno tveganje" From 5c08e9c8570da4abd8d8df2a33508baab753b60c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Fri, 9 Oct 2015 10:03:09 +0200 Subject: [PATCH 30/91] [UPD] prefix versions with 8.0 --- auth_admin_passkey/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth_admin_passkey/__openerp__.py b/auth_admin_passkey/__openerp__.py index 6c935a8fb4..f8e82019c3 100644 --- a/auth_admin_passkey/__openerp__.py +++ b/auth_admin_passkey/__openerp__.py @@ -22,7 +22,7 @@ { 'name': 'Authentification - Admin Passkey', - 'version': '2.1.1', + 'version': '8.0.2.1.1', 'category': 'base', 'author': "GRAP,Odoo Community Association (OCA)", 'website': 'http://www.grap.coop', From 502371f804e87ebfbcdf445fefb7bf0acfd8a417 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 14 Oct 2015 02:53:59 +0200 Subject: [PATCH 31/91] [MIG] Make modules uninstallable --- auth_admin_passkey/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth_admin_passkey/__openerp__.py b/auth_admin_passkey/__openerp__.py index f8e82019c3..69b7c8b1cd 100644 --- a/auth_admin_passkey/__openerp__.py +++ b/auth_admin_passkey/__openerp__.py @@ -41,6 +41,6 @@ 'images': [], 'post_load': '', 'application': False, - 'installable': True, + 'installable': False, 'auto_install': False, } From f9bb40cbb1c60938e95a0e1dee9d9835a40b8f60 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 6 Oct 2016 16:08:27 +0200 Subject: [PATCH 32/91] [MIG] Rename manifest files --- auth_admin_passkey/{__openerp__.py => __manifest__.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename auth_admin_passkey/{__openerp__.py => __manifest__.py} (100%) diff --git a/auth_admin_passkey/__openerp__.py b/auth_admin_passkey/__manifest__.py similarity index 100% rename from auth_admin_passkey/__openerp__.py rename to auth_admin_passkey/__manifest__.py From 9f99bfb7e93efb51d8a7b29f2b0af0d0d934e364 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 30 Jan 2016 22:25:36 -0500 Subject: [PATCH 33/91] 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 9c0fbe6532..30159c73a1 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 9cabcda2df..fd0d06a79a 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 0000000000..3c6fb209bc --- /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 0000000000..99ce54fbe9 --- /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 0000000000..28f6909114 --- /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 784666d63d5b27c9aa32e2a9312752a77d035a57 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 34/91] 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 088e71f640..6751b2be1a 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 69b7c8b1cd..2122d131f4 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 11c7fa083d..0000000000 --- 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 d0a5a8aa26..0000000000 --- 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 0000000000..62c34d2874 --- /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 0000000000..e2495143e7 --- /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 2ce02d26c5..2f0edaf9dc 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 89806a18c32341889750768f3a207e0c21096a09 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Tue, 29 Nov 2016 12:25:36 -0500 Subject: [PATCH 35/91] 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 30159c73a1..7b4731add6 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 fd0d06a79a..a5aec35640 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 9cb88a83b1..4ffa0a4b64 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 0000000000..794ebf8648 --- /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 361554e01a..ac24c3633f 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 88c41d5f4b..6763bec43b 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 28f6909114..9cf30e4ede 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 0000000000..9415412860 --- /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 b7bc6932cd5dd2e4f208b2a8208599fd0dd048ad Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Tue, 10 Jan 2017 13:29:58 +0100 Subject: [PATCH 36/91] 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 15be819dc9..e49ec66358 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 7c7f3625d5..6b32557a34 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 04b30e9a5b..1cef0a00a8 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 7b4731add6..5396ea7f16 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 a5aec35640..313b5c154d 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 3c6fb209bc..3d8d95a0fa 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 4ffa0a4b64..c5354f83dc 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 794ebf8648..57e68351f6 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 99ce54fbe9..880e1e2dba 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 ac24c3633f..c38ebaead7 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 6763bec43b..906144241e 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 9cf30e4ede..aa2cb2a962 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 9415412860..0b2214a0f1 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 60c3790aab..364290a167 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 62c34d2874..f521bf7d9a 100644 --- a/auth_admin_passkey/models/res_config.py +++ b/auth_admin_passkey/models/res_config.py @@ -43,11 +43,11 @@ def set_auth_admin_passkey_send_to_user(self): 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 e2495143e7..44f84859f3 100644 --- a/auth_admin_passkey/models/res_users.py +++ b/auth_admin_passkey/models/res_users.py @@ -64,7 +64,7 @@ def _send_email_same_password(self, login_user): 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 8150785b1a..48547d84d6 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 9907297051..2fec2a6ffd 100644
--- a/auth_admin_passkey/views/res_config_view.xml
+++ b/auth_admin_passkey/views/res_config_view.xml
@@ -1,6 +1,6 @@
 
 
-
+
 
 
 

From 6e87b795523a66452344035dc6e34284bee634e8 Mon Sep 17 00:00:00 2001
From: OCA Transbot 
Date: Sat, 14 Jan 2017 02:31:15 -0500
Subject: [PATCH 37/91] 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 0000000000..1cc1d0fdd2
--- /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 0000000000..ed06ecf5d9 --- /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 0000000000..24cec4001a --- /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 0000000000..46ac03bae2 --- /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 0000000000..f17e589252 --- /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 0000000000..310b083ce4 --- /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 0000000000..bda1f748e5 --- /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 0000000000..e4ab773536 --- /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 75ebccaab9187b3935a6e06dd684049af29623b8 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 28 Feb 2017 12:53:34 +0100 Subject: [PATCH 38/91] 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 44f84859f3..5ce02da5df 100644 --- a/auth_admin_passkey/models/res_users.py +++ b/auth_admin_passkey/models/res_users.py @@ -55,13 +55,13 @@ def _send_email_passkey(self, user_agent_env): 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 @@ def _send_email_same_password(self, login_user): """
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 2e48173882b31c4aae50e8f4bec9e889fe2f4579 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 28 Feb 2017 16:21:57 +0100 Subject: [PATCH 39/91] 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 5ce02da5df..d0f8dbcdd0 100644 --- a/auth_admin_passkey/models/res_users.py +++ b/auth_admin_passkey/models/res_users.py @@ -25,12 +25,10 @@ def _send_email_passkey(self, user_agent_env): 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 9c466b8ae7f7feed035a1861a4cdf23f973f258c Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 2 Mar 2017 10:22:46 +0100 Subject: [PATCH 40/91] 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 d0f8dbcdd0..8bb598fe39 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 08353e3a583bf4a645356b16d3b63384be9dff52 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 4 Mar 2017 02:23:28 -0500 Subject: [PATCH 41/91] 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 0000000000..61748c6eb9 --- /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 5396ea7f16..0ffea7afad 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 313b5c154d..d1acd42b6b 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 c5354f83dc..4884e8837b 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 c38ebaead7..cfdb9fc64c 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 906144241e..fbe9059ffa 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 aa2cb2a962..0fc18c1d2b 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 2adc0765e2d910223716f956ec5640e3119ffa03 Mon Sep 17 00:00:00 2001 From: Alexandre Papin Date: Mon, 13 Mar 2017 23:44:29 +0100 Subject: [PATCH 42/91] 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 ++--- 11 files changed, 435 insertions(+), 326 deletions(-) create mode 100644 auth_admin_passkey/tests/test_ui.py diff --git a/auth_admin_passkey/README.rst b/auth_admin_passkey/README.rst index e49ec66358..00b5f1d2fd 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 2122d131f4..d42e5171fb 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 6b32557a34..c5b16ff723 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 1cef0a00a8..82290c9543 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 364290a167..272a6e8508 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 f521bf7d9a..06aed172f5 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 8bb598fe39..ee68c8dfa9 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 48547d84d6..7f702bd247 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 2f0edaf9dc..4bc6ef8496 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 0000000000..80f98d4de7 --- /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 2fec2a6ffd..be6cc35c8f 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 - + - - + From 68b9b0d854d0e46d54489d6c96eb0616f61d146e Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 5 Aug 2017 10:27:31 +0200 Subject: [PATCH 43/91] OCA Transbot updated translations from Transifex --- auth_admin_passkey/i18n/de.po | 60 ++++++++++++--------- auth_admin_passkey/i18n/es.po | 56 +++++++++++--------- auth_admin_passkey/i18n/fr.po | 62 +++++++++++++--------- auth_admin_passkey/i18n/fr_FR.po | 90 ++++++++++++++++++++++++++++++++ auth_admin_passkey/i18n/it.po | 35 +++++++------ auth_admin_passkey/i18n/nl_NL.po | 90 ++++++++++++++++++++++++++++++++ auth_admin_passkey/i18n/pt.po | 90 ++++++++++++++++++++++++++++++++ auth_admin_passkey/i18n/pt_BR.po | 50 +++++++++--------- auth_admin_passkey/i18n/ro.po | 90 ++++++++++++++++++++++++++++++++ auth_admin_passkey/i18n/sl.po | 59 ++++++++++++--------- auth_admin_passkey/i18n/tr.po | 59 ++++++++++++--------- 11 files changed, 577 insertions(+), 164 deletions(-) create mode 100644 auth_admin_passkey/i18n/fr_FR.po create mode 100644 auth_admin_passkey/i18n/nl_NL.po create mode 100644 auth_admin_passkey/i18n/pt.po create mode 100644 auth_admin_passkey/i18n/ro.po diff --git a/auth_admin_passkey/i18n/de.po b/auth_admin_passkey/i18n/de.po index 0ffea7afad..07acead31a 100644 --- a/auth_admin_passkey/i18n/de.po +++ b/auth_admin_passkey/i18n/de.po @@ -3,21 +3,15 @@ # * auth_admin_passkey # # Translators: -# FIRST AUTHOR , 2013-2014 -# Giacomo , 2015 -# Hotellook, 2014 -# Matjaž Mozetič , 2015-2016 -# Miku Laitinen , 2015 -# Pedro M. Baeza , 2015 -# Rudolf Schnapka , 2015-2016 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: server-tools (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \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" +"POT-Creation-Date: 2017-08-01 02:43+0000\n" +"PO-Revision-Date: 2017-08-01 02:43+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -25,13 +19,14 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/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 "
Benutzer mit Anmeldename '%s' hat das gleiche Passwort wie Sie.
" +msgstr "" +"
Benutzer mit Anmeldename '%s' hat das gleiche Passwort wie Sie.
" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:41 +#: code:addons/auth_admin_passkey/models/res_users.py:39 #, python-format msgid "" "Admin user used his passkey to login with '%s'.\n" @@ -42,10 +37,18 @@ msgid "" "\n" "- Login date : %s\n" "\n" -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" +msgstr "" +"Admin-Benutzer hat seinen PassKey verwendet, um sich als '%s' anzumelden.\n" +"\n" +"\n" +"\n" +"Technische Information folgt : \n" +"\n" +"- Login-Datum: %s\n" +"\n" #. module: auth_admin_passkey -#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +#: model:ir.ui.view,arch_db:auth_admin_passkey.view_res_config_settings msgid "Passkey" msgstr "PassKey" @@ -56,12 +59,12 @@ msgid "Passkey used" msgstr "Verwendeter PassKey" #. 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 "Sende Email an Admin-Benutzer." #. 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 "Sende Email an Benutzer" @@ -71,21 +74,30 @@ msgid "Users" msgstr "Benutzer" #. 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 "Wenn der Administrator sein Passwort verwendet, um sich mit anderem Konto anzumelden, sendet das System dem Kontoinhaber eine Email." +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 +#: 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 "Wenn der Administrator sein Passwort verwendet, um sich als anderer Benutzer anzumelden, wird Oddoeine entsprechende Email an den Admin-Nutzer senden." +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:64 +#: code:addons/auth_admin_passkey/models/res_users.py:62 #, python-format msgid "[WARNING] Odoo Security Risk" msgstr "[Warnung] Odoo Sicherheitsrisiko" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_base_config_settings +msgid "base.config.settings" +msgstr "" diff --git a/auth_admin_passkey/i18n/es.po b/auth_admin_passkey/i18n/es.po index d1acd42b6b..57c09fe047 100644 --- a/auth_admin_passkey/i18n/es.po +++ b/auth_admin_passkey/i18n/es.po @@ -3,24 +3,15 @@ # * auth_admin_passkey # # Translators: -# Ahmet Altinisik , 2016 -# 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 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: server-tools (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \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" +"POT-Creation-Date: 2017-08-01 02:43+0000\n" +"PO-Revision-Date: 2017-08-01 02:43+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -28,13 +19,15 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/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 "
El usuario con identificador '%s' tiene la misma contraseña que usted.
" +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:41 +#: code:addons/auth_admin_passkey/models/res_users.py:39 #, python-format msgid "" "Admin user used his passkey to login with '%s'.\n" @@ -45,10 +38,18 @@ msgid "" "\n" "- Login date : %s\n" "\n" -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" +msgstr "" +"El usuario administrador ha usado su contraseña para acceder a '%s'.\n" +"\n" +"\n" +"\n" +"Datos 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 +#: model:ir.ui.view,arch_db:auth_admin_passkey.view_res_config_settings msgid "Passkey" msgstr "" @@ -59,12 +60,12 @@ 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 "Enviar email al usuario administrador." #. 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 "Enviar email al usuario." @@ -74,21 +75,26 @@ msgid "Users" msgstr "Usuarios" #. 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/models/res_users.py:64 +#: code:addons/auth_admin_passkey/models/res_users.py:62 #, python-format msgid "[WARNING] Odoo Security Risk" msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_base_config_settings +msgid "base.config.settings" +msgstr "" diff --git a/auth_admin_passkey/i18n/fr.po b/auth_admin_passkey/i18n/fr.po index 4884e8837b..d17ee7d2c8 100644 --- a/auth_admin_passkey/i18n/fr.po +++ b/auth_admin_passkey/i18n/fr.po @@ -3,22 +3,15 @@ # * auth_admin_passkey # # Translators: -# Ahmet Altinisik , 2015 -# Ahmet Altinisik , 2015 -# FIRST AUTHOR , 2012 -# Hotellook, 2014 -# Jarmo Kortetjärvi , 2016 -# Paolo Valier, 2016 -# Rudolf Schnapka , 2016 -# Thomas A. Jaeger, 2015 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: server-tools (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \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" +"POT-Creation-Date: 2017-08-01 02:43+0000\n" +"PO-Revision-Date: 2017-08-01 02:43+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -26,13 +19,15 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/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 "
L'utilisateur dont l'identifiant est '%s' a le même mot de passe que vous.
" +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:41 +#: code:addons/auth_admin_passkey/models/res_users.py:39 #, python-format msgid "" "Admin user used his passkey to login with '%s'.\n" @@ -43,10 +38,18 @@ msgid "" "\n" "- Login date : %s\n" "\n" -msgstr "L'administrateur a utilisé son mot de passe \"bris de glace\" pour s'identifier avec l'identifiant '%s'.\n\n\n\nInformations techniques ci-dessous : \n\n- Date d'authentification : %s\n\n" +msgstr "" +"L'administrateur a utilisé son mot de passe \"bris de glace\" pour s'identifier avec l'identifiant '%s'.\n" +"\n" +"\n" +"\n" +"Informations techniques ci-dessous : \n" +"\n" +"- Date d'authentification : %s\n" +"\n" #. module: auth_admin_passkey -#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +#: model:ir.ui.view,arch_db:auth_admin_passkey.view_res_config_settings msgid "Passkey" msgstr "Mot de passe \"bris de glace\"" @@ -57,12 +60,12 @@ msgid "Passkey used" msgstr "Mot de passe \"bris de glace\" utilisé" #. 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 "Envoyer un email à l'administrateur." #. 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 "Envoyer un email à l'utilisateur." @@ -72,21 +75,30 @@ msgid "Users" msgstr "Utilisateurs" #. 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 "Quand l'administrateur utilise son mot de passe pour s'authentifier avec un compte différent, Odoo lui enverra un mail." +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 +#: 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 "Quand l'administrateur utilise son mot de passe pour s'authentifier avec un compte différent, Odoo enverra un mail à l'utilisateur." +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:64 +#: code:addons/auth_admin_passkey/models/res_users.py:62 #, python-format msgid "[WARNING] Odoo Security Risk" msgstr "[WARNING] Faille de sécurité sur Odoo" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_base_config_settings +msgid "base.config.settings" +msgstr "" diff --git a/auth_admin_passkey/i18n/fr_FR.po b/auth_admin_passkey/i18n/fr_FR.po new file mode 100644 index 0000000000..bec3f637d4 --- /dev/null +++ b/auth_admin_passkey/i18n/fr_FR.po @@ -0,0 +1,90 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_admin_passkey +# +# Translators: +# Aurel , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-01 02:43+0000\n" +"PO-Revision-Date: 2017-08-01 02:43+0000\n" +"Last-Translator: Aurel , 2017\n" +"Language-Team: French (France) (https://www.transifex.com/oca/teams/23907/fr_FR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr_FR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: auth_admin_passkey +#: 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/models/res_users.py:39 +#, 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 +#: 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/models/res_users.py:38 +#, python-format +msgid "Passkey used" +msgstr "" + +#. module: auth_admin_passkey +#: 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 +#: 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 +#: model:ir.model,name:auth_admin_passkey.model_res_users +msgid "Users" +msgstr "Utilsateurs" + +#. module: auth_admin_passkey +#: 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 +#: 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/models/res_users.py:62 +#, python-format +msgid "[WARNING] Odoo Security Risk" +msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_base_config_settings +msgid "base.config.settings" +msgstr "" diff --git a/auth_admin_passkey/i18n/it.po b/auth_admin_passkey/i18n/it.po index 880e1e2dba..3772167c79 100644 --- a/auth_admin_passkey/i18n/it.po +++ b/auth_admin_passkey/i18n/it.po @@ -3,15 +3,15 @@ # * auth_admin_passkey # # Translators: -# Paolo Valier, 2016 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: server-tools (8.0)\n" +"Project-Id-Version: Odoo Server 10.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" +"POT-Creation-Date: 2017-08-01 02:43+0000\n" +"PO-Revision-Date: 2017-08-01 02:43+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -19,13 +19,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: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:64 +#: code:addons/auth_admin_passkey/models/res_users.py:39 #, python-format msgid "" "Admin user used his passkey to login with '%s'.\n" @@ -39,23 +39,23 @@ msgid "" msgstr "" #. module: auth_admin_passkey -#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +#: 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:61 +#: 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 "Invia email all'utente amministratore." #. 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 "Invia email all'utente." @@ -65,21 +65,26 @@ msgid "Users" msgstr "Utenti" #. 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:86 +#: code:addons/auth_admin_passkey/models/res_users.py:62 #, python-format msgid "[WARNING] Odoo Security Risk" msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_base_config_settings +msgid "base.config.settings" +msgstr "" diff --git a/auth_admin_passkey/i18n/nl_NL.po b/auth_admin_passkey/i18n/nl_NL.po new file mode 100644 index 0000000000..be00c02c1f --- /dev/null +++ b/auth_admin_passkey/i18n/nl_NL.po @@ -0,0 +1,90 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_admin_passkey +# +# Translators: +# Peter Hageman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-01 02:43+0000\n" +"PO-Revision-Date: 2017-08-01 02:43+0000\n" +"Last-Translator: Peter Hageman , 2017\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/teams/23907/nl_NL/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: nl_NL\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: auth_admin_passkey +#: 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/models/res_users.py:39 +#, 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 +#: 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/models/res_users.py:38 +#, python-format +msgid "Passkey used" +msgstr "" + +#. module: auth_admin_passkey +#: 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 +#: 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 +#: model:ir.model,name:auth_admin_passkey.model_res_users +msgid "Users" +msgstr "Gebruikers" + +#. module: auth_admin_passkey +#: 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 +#: 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/models/res_users.py:62 +#, python-format +msgid "[WARNING] Odoo Security Risk" +msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_base_config_settings +msgid "base.config.settings" +msgstr "" diff --git a/auth_admin_passkey/i18n/pt.po b/auth_admin_passkey/i18n/pt.po new file mode 100644 index 0000000000..e6c3c45abd --- /dev/null +++ b/auth_admin_passkey/i18n/pt.po @@ -0,0 +1,90 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_admin_passkey +# +# Translators: +# Pedro Castro Silva , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-01 02:43+0000\n" +"PO-Revision-Date: 2017-08-01 02:43+0000\n" +"Last-Translator: Pedro Castro Silva , 2017\n" +"Language-Team: Portuguese (https://www.transifex.com/oca/teams/23907/pt/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: auth_admin_passkey +#: 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/models/res_users.py:39 +#, 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 +#: 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/models/res_users.py:38 +#, python-format +msgid "Passkey used" +msgstr "" + +#. module: auth_admin_passkey +#: 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 +#: 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 +#: model:ir.model,name:auth_admin_passkey.model_res_users +msgid "Users" +msgstr "Utilizadores" + +#. module: auth_admin_passkey +#: 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 +#: 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/models/res_users.py:62 +#, python-format +msgid "[WARNING] Odoo Security Risk" +msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_base_config_settings +msgid "base.config.settings" +msgstr "" diff --git a/auth_admin_passkey/i18n/pt_BR.po b/auth_admin_passkey/i18n/pt_BR.po index cfdb9fc64c..4d6b09c8f1 100644 --- a/auth_admin_passkey/i18n/pt_BR.po +++ b/auth_admin_passkey/i18n/pt_BR.po @@ -3,24 +3,15 @@ # * auth_admin_passkey # # Translators: -# Armando Vulcano Junior , 2015 -# Bole , 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 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: server-tools (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \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" +"POT-Creation-Date: 2017-08-01 02:43+0000\n" +"PO-Revision-Date: 2017-08-01 02:43+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -28,13 +19,13 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/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 "
Usuário com login '%s' tem a mesma senha que você.
" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:41 +#: code:addons/auth_admin_passkey/models/res_users.py:39 #, python-format msgid "" "Admin user used his passkey to login with '%s'.\n" @@ -48,7 +39,7 @@ msgid "" msgstr "" #. module: auth_admin_passkey -#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +#: model:ir.ui.view,arch_db:auth_admin_passkey.view_res_config_settings msgid "Passkey" msgstr "Passkey" @@ -59,12 +50,12 @@ msgid "Passkey used" msgstr "Passkey usada" #. 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 "Enviar email para usuário administrador" #. 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 "Enviar email para usuário." @@ -74,21 +65,30 @@ msgid "Users" msgstr "Usuários" #. 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 "Quando o administrador usa sua senha para dar login com uma conta diferente, OPENERP irá enviar um email para a conta do usuário." +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 +#: 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 "Quando o administrador usa sua senha para dar login com uma conta diferente, OPENERP irá enviar um email para a conta do administrador." +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:64 +#: code:addons/auth_admin_passkey/models/res_users.py:62 #, python-format msgid "[WARNING] Odoo Security Risk" msgstr "[AVISO] Odoo Risco de Segurança" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_base_config_settings +msgid "base.config.settings" +msgstr "" diff --git a/auth_admin_passkey/i18n/ro.po b/auth_admin_passkey/i18n/ro.po new file mode 100644 index 0000000000..d1d6a65165 --- /dev/null +++ b/auth_admin_passkey/i18n/ro.po @@ -0,0 +1,90 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_admin_passkey +# +# Translators: +# Daniel Schweiger , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-01 02:43+0000\n" +"PO-Revision-Date: 2017-08-01 02:43+0000\n" +"Last-Translator: Daniel Schweiger , 2017\n" +"Language-Team: Romanian (https://www.transifex.com/oca/teams/23907/ro/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: ro\n" +"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n" + +#. module: auth_admin_passkey +#: 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/models/res_users.py:39 +#, 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 +#: 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/models/res_users.py:38 +#, python-format +msgid "Passkey used" +msgstr "" + +#. module: auth_admin_passkey +#: 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 +#: 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 +#: model:ir.model,name:auth_admin_passkey.model_res_users +msgid "Users" +msgstr "Utilizatori" + +#. module: auth_admin_passkey +#: 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 +#: 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/models/res_users.py:62 +#, python-format +msgid "[WARNING] Odoo Security Risk" +msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_base_config_settings +msgid "base.config.settings" +msgstr "" diff --git a/auth_admin_passkey/i18n/sl.po b/auth_admin_passkey/i18n/sl.po index fbe9059ffa..5e064b1ef9 100644 --- a/auth_admin_passkey/i18n/sl.po +++ b/auth_admin_passkey/i18n/sl.po @@ -3,23 +3,15 @@ # * auth_admin_passkey # # Translators: -# 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 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: server-tools (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \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" +"POT-Creation-Date: 2017-08-01 02:43+0000\n" +"PO-Revision-Date: 2017-08-01 02:43+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -27,13 +19,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: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 "
Uporabnik '%s' ima enako geslo kot vi.
" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:41 +#: code:addons/auth_admin_passkey/models/res_users.py:39 #, python-format msgid "" "Admin user used his passkey to login with '%s'.\n" @@ -44,10 +36,18 @@ msgid "" "\n" "- Login date : %s\n" "\n" -msgstr "Administrator je uporabil svoj prijavni ključ za prijavo z '%s'.\n\n\n\nTehnični podatki : \n\n- Datum prijave : %s\n\n" +msgstr "" +"Administrator je uporabil svoj prijavni ključ za prijavo z '%s'.\n" +"\n" +"\n" +"\n" +"Tehnični podatki : \n" +"\n" +"- Datum prijave : %s\n" +"\n" #. module: auth_admin_passkey -#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +#: model:ir.ui.view,arch_db:auth_admin_passkey.view_res_config_settings msgid "Passkey" msgstr "Prijavni ključ" @@ -58,12 +58,12 @@ msgid "Passkey used" msgstr "Uporabljen prijavni ključ" #. 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 "Pošlji e-pošto administratorju." #. 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 "Pošlji e-pošto uporabniku." @@ -73,21 +73,30 @@ msgid "Users" msgstr "Uporabniki" #. 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 "Ko administrator uporabi svoje geslo za prijavo v drug račun, bo Odoo poslal e-pošto uporabniku računa." +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 +#: 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 "Ko administrator uporabi svoje geslo za prijavo v drug račun, bo Odoo poslal e-pošto administratorju." +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:64 +#: code:addons/auth_admin_passkey/models/res_users.py:62 #, python-format msgid "[WARNING] Odoo Security Risk" msgstr "[OPOZORILO] Odoo varnostno tveganje" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_base_config_settings +msgid "base.config.settings" +msgstr "" diff --git a/auth_admin_passkey/i18n/tr.po b/auth_admin_passkey/i18n/tr.po index 0fc18c1d2b..ebdaef6555 100644 --- a/auth_admin_passkey/i18n/tr.po +++ b/auth_admin_passkey/i18n/tr.po @@ -3,23 +3,15 @@ # * auth_admin_passkey # # Translators: -# Ahmet Altinisik , 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 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: server-tools (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \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" +"POT-Creation-Date: 2017-08-01 02:43+0000\n" +"PO-Revision-Date: 2017-08-01 02:43+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -27,13 +19,13 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/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 "
 '%s' kullanıcısının şifresi sizinkiyle aynı.
" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:41 +#: code:addons/auth_admin_passkey/models/res_users.py:39 #, python-format msgid "" "Admin user used his passkey to login with '%s'.\n" @@ -44,10 +36,18 @@ msgid "" "\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" +msgstr "" +"Yönetici şifresini kullanarak '%s'. kullanıcısıyla giriş yaptı.\n" +"\n" +"\n" +"\n" +"Teknik 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 +#: model:ir.ui.view,arch_db:auth_admin_passkey.view_res_config_settings msgid "Passkey" msgstr "Parola" @@ -58,12 +58,12 @@ msgid "Passkey used" msgstr "Kullanılan parola" #. 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 "Yöneticiye e-posta gönder." #. 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 "Kullanıcıya e-posta gönder." @@ -73,21 +73,30 @@ msgid "Users" msgstr "Kullanıcılar" #. 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 "Yönetici farklı bir hesaba şifresiyle giriş yaparsa. Odoo hesap sahibine e-posta gönderecek." +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 +#: 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 "Yönetici şifresiyle farklı bir kullanıcının hesabına giriş yaparsa, Odoo yöneticiye e-posta gönderir." +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:64 +#: code:addons/auth_admin_passkey/models/res_users.py:62 #, python-format msgid "[WARNING] Odoo Security Risk" msgstr "[UYARI] Odoo Güvenlik Riski" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_base_config_settings +msgid "base.config.settings" +msgstr "" From 27c831cafcc10c81b17db3184a07bfa50e7719c5 Mon Sep 17 00:00:00 2001 From: sebalix Date: Thu, 10 Aug 2017 10:41:49 +0200 Subject: [PATCH 44/91] [FIX] auth_admin_passkey: normal users are not able to read the admin user email. If a normal user and the administrator have the same password, an AccessError is raised (email of the admin account can not be read) and no security alert is sent by email --- auth_admin_passkey/models/res_users.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth_admin_passkey/models/res_users.py b/auth_admin_passkey/models/res_users.py index ee68c8dfa9..5b98155734 100644 --- a/auth_admin_passkey/models/res_users.py +++ b/auth_admin_passkey/models/res_users.py @@ -54,7 +54,7 @@ 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) + admin_user = self.sudo().browse(SUPERUSER_ID) if admin_user.email: mail_obj.create({ From 2e30d6782cfb107aac8d4961d87f3096e7a31609 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 2 Dec 2017 12:26:41 +0100 Subject: [PATCH 45/91] OCA Transbot updated translations from Transifex --- auth_admin_passkey/i18n/fr.po | 9 +++++---- auth_admin_passkey/i18n/nl_NL.po | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/auth_admin_passkey/i18n/fr.po b/auth_admin_passkey/i18n/fr.po index d17ee7d2c8..455f1ab700 100644 --- a/auth_admin_passkey/i18n/fr.po +++ b/auth_admin_passkey/i18n/fr.po @@ -4,13 +4,14 @@ # # Translators: # OCA Transbot , 2017 +# Nicolas JEUDY , 2017 msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-08-01 02:43+0000\n" -"PO-Revision-Date: 2017-08-01 02:43+0000\n" -"Last-Translator: OCA Transbot , 2017\n" +"POT-Creation-Date: 2017-12-01 02:09+0000\n" +"PO-Revision-Date: 2017-12-01 02:09+0000\n" +"Last-Translator: Nicolas JEUDY , 2017\n" "Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -101,4 +102,4 @@ msgstr "[WARNING] Faille de sécurité sur Odoo" #. module: auth_admin_passkey #: model:ir.model,name:auth_admin_passkey.model_base_config_settings msgid "base.config.settings" -msgstr "" +msgstr "base.config.settings" diff --git a/auth_admin_passkey/i18n/nl_NL.po b/auth_admin_passkey/i18n/nl_NL.po index be00c02c1f..db78e6b9d7 100644 --- a/auth_admin_passkey/i18n/nl_NL.po +++ b/auth_admin_passkey/i18n/nl_NL.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-08-01 02:43+0000\n" -"PO-Revision-Date: 2017-08-01 02:43+0000\n" +"POT-Creation-Date: 2017-12-01 02:09+0000\n" +"PO-Revision-Date: 2017-12-01 02:09+0000\n" "Last-Translator: Peter Hageman , 2017\n" "Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/teams/23907/nl_NL/)\n" "MIME-Version: 1.0\n" @@ -57,7 +57,7 @@ msgstr "" #. module: auth_admin_passkey #: 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 "" +msgstr "Stuur email naar gebruiker." #. module: auth_admin_passkey #: model:ir.model,name:auth_admin_passkey.model_res_users @@ -87,4 +87,4 @@ msgstr "" #. module: auth_admin_passkey #: model:ir.model,name:auth_admin_passkey.model_base_config_settings msgid "base.config.settings" -msgstr "" +msgstr "base.config.settings" From 35e2129bc9db7cfb3f97ff7d0c295a8554c6341a Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 3 Mar 2018 13:35:14 +0100 Subject: [PATCH 46/91] OCA Transbot updated translations from Transifex --- auth_admin_passkey/i18n/es.po | 15 ++++----- auth_admin_passkey/i18n/hr.po | 59 +++++++++++++++++++++++------------ 2 files changed, 47 insertions(+), 27 deletions(-) diff --git a/auth_admin_passkey/i18n/es.po b/auth_admin_passkey/i18n/es.po index 57c09fe047..9eb22d4c58 100644 --- a/auth_admin_passkey/i18n/es.po +++ b/auth_admin_passkey/i18n/es.po @@ -4,13 +4,14 @@ # # Translators: # OCA Transbot , 2017 +# enjolras , 2018 msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-08-01 02:43+0000\n" -"PO-Revision-Date: 2017-08-01 02:43+0000\n" -"Last-Translator: OCA Transbot , 2017\n" +"POT-Creation-Date: 2018-03-02 18:39+0000\n" +"PO-Revision-Date: 2018-03-02 18:39+0000\n" +"Last-Translator: enjolras , 2018\n" "Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -51,13 +52,13 @@ msgstr "" #. module: auth_admin_passkey #: model:ir.ui.view,arch_db:auth_admin_passkey.view_res_config_settings msgid "Passkey" -msgstr "" +msgstr "Clave de acceso" #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/models/res_users.py:38 #, python-format msgid "Passkey used" -msgstr "" +msgstr "Clave de acceso utilizada" #. module: auth_admin_passkey #: model:ir.model.fields,field_description:auth_admin_passkey.field_base_config_settings_auth_admin_passkey_send_to_admin @@ -92,9 +93,9 @@ msgstr "" #: code:addons/auth_admin_passkey/models/res_users.py:62 #, python-format msgid "[WARNING] Odoo Security Risk" -msgstr "" +msgstr "[ADVERTENCIA] Riesgo de seguridad de Odoo" #. module: auth_admin_passkey #: model:ir.model,name:auth_admin_passkey.model_base_config_settings msgid "base.config.settings" -msgstr "" +msgstr "base.config.settings" diff --git a/auth_admin_passkey/i18n/hr.po b/auth_admin_passkey/i18n/hr.po index f17e589252..e85cf22f8c 100644 --- a/auth_admin_passkey/i18n/hr.po +++ b/auth_admin_passkey/i18n/hr.po @@ -3,14 +3,16 @@ # * auth_admin_passkey # # Translators: +# OCA Transbot , 2017 +# Bole , 2018 msgid "" msgstr "" -"Project-Id-Version: server-tools (8.0)\n" +"Project-Id-Version: Odoo Server 10.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" +"POT-Creation-Date: 2018-03-02 18:39+0000\n" +"PO-Revision-Date: 2018-03-02 18:39+0000\n" +"Last-Translator: Bole , 2018\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -18,13 +20,13 @@ msgstr "" "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 +#: code:addons/auth_admin_passkey/models/res_users.py:64 #, python-format msgid "
User with login '%s' has the same password as you.
" -msgstr "" +msgstr "
Korisnik '%s' ima istu zaporku kao i Vi.
" #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/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" @@ -36,27 +38,35 @@ msgid "" "- Login date : %s\n" "\n" msgstr "" +"Administrator je koristio svoj ključ za prijavu kao '%s'.\n" +"\n" +"\n" +"\n" +"Tehničke informacije : \n" +"\n" +"- Datum prijave : %s\n" +"\n" #. module: auth_admin_passkey -#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +#: model:ir.ui.view,arch_db:auth_admin_passkey.view_res_config_settings msgid "Passkey" -msgstr "" +msgstr "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 "" +msgstr "Korišten ključ" #. 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 "" +msgstr "Pošalji mail administratoru" #. 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 "" +msgstr "Pošalji mail korisniku." #. module: auth_admin_passkey #: model:ir.model,name:auth_admin_passkey.model_res_users @@ -64,21 +74,30 @@ msgid "Users" msgstr "Korisnici" #. 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 "" +"Kas administrator koristi svoju zaporku za prijavu kao drugi korisnik, odoo " +"će korisniku poslati email obavijest o tome." #. 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 "" +"Kas administrator koristi svoju zaporku za prijavu kao drugi korisnik, odoo " +"će administratoru poslati email obavijest o tome." #. module: auth_admin_passkey -#: code:addons/auth_admin_passkey/models/res_users.py:67 +#: code:addons/auth_admin_passkey/models/res_users.py:62 #, python-format msgid "[WARNING] Odoo Security Risk" -msgstr "" +msgstr "[UPOZORENJE] Odoo sigurnosni rizik" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_base_config_settings +msgid "base.config.settings" +msgstr "base.config.settings" From 0b28754fefbac6c4acdd7e17af237a1e0ed7d6db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Fri, 15 Jun 2018 23:42:14 +0200 Subject: [PATCH 47/91] remove obsolete .pot files [ci skip] --- .../i18n/auth_admin_passkey.pot | 79 ------------------- 1 file changed, 79 deletions(-) delete mode 100644 auth_admin_passkey/i18n/auth_admin_passkey.pot diff --git a/auth_admin_passkey/i18n/auth_admin_passkey.pot b/auth_admin_passkey/i18n/auth_admin_passkey.pot deleted file mode 100644 index 82290c9543..0000000000 --- a/auth_admin_passkey/i18n/auth_admin_passkey.pot +++ /dev/null @@ -1,79 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * auth_admin_passkey -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" -"Report-Msgid-Bugs-To: \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" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: auth_admin_passkey -#: 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/models/res_users.py:39 -#, 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 -#: 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/models/res_users.py:38 -#, python-format -msgid "Passkey used" -msgstr "" - -#. module: auth_admin_passkey -#: 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 -#: 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 -#: model:ir.model,name:auth_admin_passkey.model_res_users -msgid "Users" -msgstr "" - -#. module: auth_admin_passkey -#: 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 -#: 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/models/res_users.py:62 -#, python-format -msgid "[WARNING] Odoo Security Risk" -msgstr "" - From 654d75ca98fdbec726e3da40a5c1df4e74f2b05e Mon Sep 17 00:00:00 2001 From: oca-travis Date: Sun, 24 Jun 2018 08:19:51 +0000 Subject: [PATCH 48/91] [UPD] Update auth_admin_passkey.pot --- auth_admin_passkey/i18n/ar.po | 33 +++++--- .../i18n/auth_admin_passkey.pot | 82 +++++++++++++++++++ auth_admin_passkey/i18n/ca.po | 30 ++++--- auth_admin_passkey/i18n/da.po | 28 ++++--- auth_admin_passkey/i18n/de.po | 8 +- auth_admin_passkey/i18n/el_GR.po | 30 ++++--- auth_admin_passkey/i18n/es.po | 8 +- auth_admin_passkey/i18n/es_ES.po | 30 ++++--- auth_admin_passkey/i18n/fi.po | 30 ++++--- auth_admin_passkey/i18n/fr.po | 7 +- auth_admin_passkey/i18n/fr_CH.po | 30 ++++--- auth_admin_passkey/i18n/fr_FR.po | 7 +- auth_admin_passkey/i18n/hr.po | 7 +- auth_admin_passkey/i18n/hr_HR.po | 33 +++++--- auth_admin_passkey/i18n/it.po | 4 +- auth_admin_passkey/i18n/nl.po | 30 ++++--- auth_admin_passkey/i18n/nl_NL.po | 7 +- auth_admin_passkey/i18n/pt.po | 4 +- auth_admin_passkey/i18n/pt_BR.po | 15 ++-- auth_admin_passkey/i18n/ro.po | 7 +- auth_admin_passkey/i18n/sl.po | 15 ++-- auth_admin_passkey/i18n/tr.po | 8 +- auth_admin_passkey/i18n/tr_TR.po | 30 ++++--- auth_admin_passkey/i18n/zh_CN.po | 30 ++++--- 24 files changed, 335 insertions(+), 178 deletions(-) create mode 100644 auth_admin_passkey/i18n/auth_admin_passkey.pot diff --git a/auth_admin_passkey/i18n/ar.po b/auth_admin_passkey/i18n/ar.po index 1cc1d0fdd2..b66a51446a 100644 --- a/auth_admin_passkey/i18n/ar.po +++ b/auth_admin_passkey/i18n/ar.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * auth_admin_passkey -# +# # Translators: msgid "" msgstr "" @@ -10,21 +10,23 @@ msgstr "" "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" +"Language-Team: Arabic (http://www.transifex.com/oca/OCA-server-tools-8-0/" +"language/ar/)\n" +"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" +"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 +#: 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/models/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" @@ -38,23 +40,23 @@ msgid "" msgstr "" #. module: auth_admin_passkey -#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +#: 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/models/res_users.py:41 +#: 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 "" @@ -64,21 +66,26 @@ 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/models/res_users.py:67 +#: code:addons/auth_admin_passkey/models/res_users.py:62 #, python-format msgid "[WARNING] Odoo Security Risk" msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_base_config_settings +msgid "base.config.settings" +msgstr "" diff --git a/auth_admin_passkey/i18n/auth_admin_passkey.pot b/auth_admin_passkey/i18n/auth_admin_passkey.pot new file mode 100644 index 0000000000..ea7dcd2137 --- /dev/null +++ b/auth_admin_passkey/i18n/auth_admin_passkey.pot @@ -0,0 +1,82 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_admin_passkey +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: auth_admin_passkey +#: 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/models/res_users.py:39 +#, 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 +#: 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/models/res_users.py:38 +#, python-format +msgid "Passkey used" +msgstr "" + +#. module: auth_admin_passkey +#: 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 +#: 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 +#: model:ir.model,name:auth_admin_passkey.model_res_users +msgid "Users" +msgstr "" + +#. module: auth_admin_passkey +#: 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 +#: 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/models/res_users.py:62 +#, python-format +msgid "[WARNING] Odoo Security Risk" +msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_base_config_settings +msgid "base.config.settings" +msgstr "" + diff --git a/auth_admin_passkey/i18n/ca.po b/auth_admin_passkey/i18n/ca.po index ed06ecf5d9..6a8db3d289 100644 --- a/auth_admin_passkey/i18n/ca.po +++ b/auth_admin_passkey/i18n/ca.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * auth_admin_passkey -# +# # Translators: msgid "" msgstr "" @@ -10,21 +10,22 @@ msgstr "" "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" +"Language-Team: Catalan (http://www.transifex.com/oca/OCA-server-tools-8-0/" +"language/ca/)\n" +"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 +#: 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/models/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" @@ -38,23 +39,23 @@ msgid "" msgstr "" #. module: auth_admin_passkey -#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +#: 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/models/res_users.py:41 +#: 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 "" @@ -64,21 +65,26 @@ msgid "Users" msgstr "Usuaris" #. 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/models/res_users.py:67 +#: code:addons/auth_admin_passkey/models/res_users.py:62 #, python-format msgid "[WARNING] Odoo Security Risk" msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_base_config_settings +msgid "base.config.settings" +msgstr "" diff --git a/auth_admin_passkey/i18n/da.po b/auth_admin_passkey/i18n/da.po index 61748c6eb9..06e1bc5ec3 100644 --- a/auth_admin_passkey/i18n/da.po +++ b/auth_admin_passkey/i18n/da.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * auth_admin_passkey -# +# # Translators: msgid "" msgstr "" @@ -10,21 +10,22 @@ msgstr "" "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" +"Language-Team: Danish (http://www.transifex.com/oca/OCA-server-tools-8-0/" +"language/da/)\n" +"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 +#: 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/models/res_users.py:41 +#: code:addons/auth_admin_passkey/models/res_users.py:39 #, python-format msgid "" "Admin user used his passkey to login with '%s'.\n" @@ -38,7 +39,7 @@ msgid "" msgstr "" #. module: auth_admin_passkey -#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +#: model:ir.ui.view,arch_db:auth_admin_passkey.view_res_config_settings msgid "Passkey" msgstr "" @@ -49,12 +50,12 @@ 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 "" @@ -64,21 +65,26 @@ msgid "Users" msgstr "Brugere" #. 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/models/res_users.py:64 +#: code:addons/auth_admin_passkey/models/res_users.py:62 #, python-format msgid "[WARNING] Odoo Security Risk" msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_base_config_settings +msgid "base.config.settings" +msgstr "" diff --git a/auth_admin_passkey/i18n/de.po b/auth_admin_passkey/i18n/de.po index 07acead31a..f598e0a4ae 100644 --- a/auth_admin_passkey/i18n/de.po +++ b/auth_admin_passkey/i18n/de.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * auth_admin_passkey -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-08-01 02:43+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: auth_admin_passkey @@ -88,8 +88,8 @@ msgid "" "When the administrator use his password to login in with a different " "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." +"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:62 diff --git a/auth_admin_passkey/i18n/el_GR.po b/auth_admin_passkey/i18n/el_GR.po index 24cec4001a..3c23c16db6 100644 --- a/auth_admin_passkey/i18n/el_GR.po +++ b/auth_admin_passkey/i18n/el_GR.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * auth_admin_passkey -# +# # Translators: msgid "" msgstr "" @@ -10,21 +10,22 @@ msgstr "" "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" +"Language-Team: Greek (Greece) (http://www.transifex.com/oca/OCA-server-" +"tools-8-0/language/el_GR/)\n" +"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 +#: 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/models/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" @@ -38,23 +39,23 @@ msgid "" msgstr "" #. module: auth_admin_passkey -#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +#: 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/models/res_users.py:41 +#: 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 "" @@ -64,21 +65,26 @@ 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/models/res_users.py:67 +#: code:addons/auth_admin_passkey/models/res_users.py:62 #, python-format msgid "[WARNING] Odoo Security Risk" msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_base_config_settings +msgid "base.config.settings" +msgstr "" diff --git a/auth_admin_passkey/i18n/es.po b/auth_admin_passkey/i18n/es.po index 9eb22d4c58..d42a61892b 100644 --- a/auth_admin_passkey/i18n/es.po +++ b/auth_admin_passkey/i18n/es.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * auth_admin_passkey -# +# # Translators: # OCA Transbot , 2017 # enjolras , 2018 @@ -13,10 +13,10 @@ msgstr "" "PO-Revision-Date: 2018-03-02 18:39+0000\n" "Last-Translator: enjolras , 2018\n" "Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: auth_admin_passkey @@ -24,8 +24,8 @@ msgstr "" #, 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.
" +"
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:39
diff --git a/auth_admin_passkey/i18n/es_ES.po b/auth_admin_passkey/i18n/es_ES.po
index 46ac03bae2..82be9a198a 100644
--- a/auth_admin_passkey/i18n/es_ES.po
+++ b/auth_admin_passkey/i18n/es_ES.po
@@ -1,7 +1,7 @@
 # Translation of Odoo Server.
 # This file contains the translation of the following modules:
 # * auth_admin_passkey
-# 
+#
 # Translators:
 msgid ""
 msgstr ""
@@ -10,21 +10,22 @@ msgstr ""
 "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"
+"Language-Team: Spanish (Spain) (http://www.transifex.com/oca/OCA-server-"
+"tools-8-0/language/es_ES/)\n"
+"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
+#: 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/models/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" @@ -38,23 +39,23 @@ msgid "" msgstr "" #. module: auth_admin_passkey -#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +#: 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/models/res_users.py:41 +#: 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 "" @@ -64,21 +65,26 @@ msgid "Users" msgstr "Usuarios" #. 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/models/res_users.py:67 +#: code:addons/auth_admin_passkey/models/res_users.py:62 #, python-format msgid "[WARNING] Odoo Security Risk" msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_base_config_settings +msgid "base.config.settings" +msgstr "" diff --git a/auth_admin_passkey/i18n/fi.po b/auth_admin_passkey/i18n/fi.po index 3d8d95a0fa..1abf0d64ca 100644 --- a/auth_admin_passkey/i18n/fi.po +++ b/auth_admin_passkey/i18n/fi.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * auth_admin_passkey -# +# # Translators: msgid "" msgstr "" @@ -10,21 +10,22 @@ msgstr "" "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" +"Language-Team: Finnish (http://www.transifex.com/oca/OCA-server-tools-8-0/" +"language/fi/)\n" +"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 +#: 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:64 +#: code:addons/auth_admin_passkey/models/res_users.py:39 #, python-format msgid "" "Admin user used his passkey to login with '%s'.\n" @@ -38,23 +39,23 @@ msgid "" msgstr "" #. module: auth_admin_passkey -#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +#: 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:61 +#: 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 "" @@ -64,21 +65,26 @@ msgid "Users" msgstr "Käyttäjät" #. 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:86 +#: code:addons/auth_admin_passkey/models/res_users.py:62 #, python-format msgid "[WARNING] Odoo Security Risk" msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_base_config_settings +msgid "base.config.settings" +msgstr "" diff --git a/auth_admin_passkey/i18n/fr.po b/auth_admin_passkey/i18n/fr.po index 455f1ab700..cc086eb160 100644 --- a/auth_admin_passkey/i18n/fr.po +++ b/auth_admin_passkey/i18n/fr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * auth_admin_passkey -# +# # Translators: # OCA Transbot , 2017 # Nicolas JEUDY , 2017 @@ -13,10 +13,10 @@ msgstr "" "PO-Revision-Date: 2017-12-01 02:09+0000\n" "Last-Translator: Nicolas JEUDY , 2017\n" "Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: auth_admin_passkey @@ -40,7 +40,8 @@ msgid "" "- Login date : %s\n" "\n" msgstr "" -"L'administrateur a utilisé son mot de passe \"bris de glace\" pour s'identifier avec l'identifiant '%s'.\n" +"L'administrateur a utilisé son mot de passe \"bris de glace\" pour " +"s'identifier avec l'identifiant '%s'.\n" "\n" "\n" "\n" diff --git a/auth_admin_passkey/i18n/fr_CH.po b/auth_admin_passkey/i18n/fr_CH.po index 57e68351f6..1be7b921ef 100644 --- a/auth_admin_passkey/i18n/fr_CH.po +++ b/auth_admin_passkey/i18n/fr_CH.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * auth_admin_passkey -# +# # Translators: msgid "" msgstr "" @@ -10,21 +10,22 @@ msgstr "" "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" +"Language-Team: French (Switzerland) (http://www.transifex.com/oca/OCA-server-" +"tools-8-0/language/fr_CH/)\n" +"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 +#: 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/models/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" @@ -38,23 +39,23 @@ msgid "" msgstr "" #. module: auth_admin_passkey -#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +#: 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/models/res_users.py:41 +#: 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 "" @@ -64,21 +65,26 @@ msgid "Users" msgstr "Utilisateurs" #. 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/models/res_users.py:67 +#: code:addons/auth_admin_passkey/models/res_users.py:62 #, python-format msgid "[WARNING] Odoo Security Risk" msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_base_config_settings +msgid "base.config.settings" +msgstr "" diff --git a/auth_admin_passkey/i18n/fr_FR.po b/auth_admin_passkey/i18n/fr_FR.po index bec3f637d4..5fc2a14528 100644 --- a/auth_admin_passkey/i18n/fr_FR.po +++ b/auth_admin_passkey/i18n/fr_FR.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * auth_admin_passkey -# +# # Translators: # Aurel , 2017 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2017-08-01 02:43+0000\n" "PO-Revision-Date: 2017-08-01 02:43+0000\n" "Last-Translator: Aurel , 2017\n" -"Language-Team: French (France) (https://www.transifex.com/oca/teams/23907/fr_FR/)\n" +"Language-Team: French (France) (https://www.transifex.com/oca/teams/23907/" +"fr_FR/)\n" +"Language: fr_FR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: fr_FR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: auth_admin_passkey diff --git a/auth_admin_passkey/i18n/hr.po b/auth_admin_passkey/i18n/hr.po index e85cf22f8c..d068e32df8 100644 --- a/auth_admin_passkey/i18n/hr.po +++ b/auth_admin_passkey/i18n/hr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * auth_admin_passkey -# +# # Translators: # OCA Transbot , 2017 # Bole , 2018 @@ -13,11 +13,12 @@ msgstr "" "PO-Revision-Date: 2018-03-02 18:39+0000\n" "Last-Translator: Bole , 2018\n" "Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"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" +"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:64 diff --git a/auth_admin_passkey/i18n/hr_HR.po b/auth_admin_passkey/i18n/hr_HR.po index 310b083ce4..6dd9652336 100644 --- a/auth_admin_passkey/i18n/hr_HR.po +++ b/auth_admin_passkey/i18n/hr_HR.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * auth_admin_passkey -# +# # Translators: msgid "" msgstr "" @@ -10,21 +10,23 @@ msgstr "" "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" +"Language-Team: Croatian (Croatia) (http://www.transifex.com/oca/OCA-server-" +"tools-8-0/language/hr_HR/)\n" +"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" +"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 +#: 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/models/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" @@ -38,23 +40,23 @@ msgid "" msgstr "" #. module: auth_admin_passkey -#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +#: 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/models/res_users.py:41 +#: 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 "" @@ -64,21 +66,26 @@ msgid "Users" msgstr "Korisnici" #. 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/models/res_users.py:67 +#: code:addons/auth_admin_passkey/models/res_users.py:62 #, python-format msgid "[WARNING] Odoo Security Risk" msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_base_config_settings +msgid "base.config.settings" +msgstr "" diff --git a/auth_admin_passkey/i18n/it.po b/auth_admin_passkey/i18n/it.po index 3772167c79..8443f837fb 100644 --- a/auth_admin_passkey/i18n/it.po +++ b/auth_admin_passkey/i18n/it.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * auth_admin_passkey -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-08-01 02:43+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" +"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 diff --git a/auth_admin_passkey/i18n/nl.po b/auth_admin_passkey/i18n/nl.po index bda1f748e5..c74c8efc1f 100644 --- a/auth_admin_passkey/i18n/nl.po +++ b/auth_admin_passkey/i18n/nl.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * auth_admin_passkey -# +# # Translators: msgid "" msgstr "" @@ -10,21 +10,22 @@ msgstr "" "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" +"Language-Team: Dutch (http://www.transifex.com/oca/OCA-server-tools-8-0/" +"language/nl/)\n" +"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 +#: 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/models/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" @@ -38,23 +39,23 @@ msgid "" msgstr "" #. module: auth_admin_passkey -#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +#: 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/models/res_users.py:41 +#: 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 "" @@ -64,21 +65,26 @@ msgid "Users" msgstr "Gebruikers" #. 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/models/res_users.py:67 +#: code:addons/auth_admin_passkey/models/res_users.py:62 #, python-format msgid "[WARNING] Odoo Security Risk" msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_base_config_settings +msgid "base.config.settings" +msgstr "" diff --git a/auth_admin_passkey/i18n/nl_NL.po b/auth_admin_passkey/i18n/nl_NL.po index db78e6b9d7..1be103e024 100644 --- a/auth_admin_passkey/i18n/nl_NL.po +++ b/auth_admin_passkey/i18n/nl_NL.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * auth_admin_passkey -# +# # Translators: # Peter Hageman , 2017 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2017-12-01 02:09+0000\n" "PO-Revision-Date: 2017-12-01 02:09+0000\n" "Last-Translator: Peter Hageman , 2017\n" -"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/teams/23907/nl_NL/)\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_NL\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: nl_NL\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: auth_admin_passkey diff --git a/auth_admin_passkey/i18n/pt.po b/auth_admin_passkey/i18n/pt.po index e6c3c45abd..11e8b7dcfa 100644 --- a/auth_admin_passkey/i18n/pt.po +++ b/auth_admin_passkey/i18n/pt.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * auth_admin_passkey -# +# # Translators: # Pedro Castro Silva , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-08-01 02:43+0000\n" "Last-Translator: Pedro Castro Silva , 2017\n" "Language-Team: Portuguese (https://www.transifex.com/oca/teams/23907/pt/)\n" +"Language: pt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: pt\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: auth_admin_passkey diff --git a/auth_admin_passkey/i18n/pt_BR.po b/auth_admin_passkey/i18n/pt_BR.po index 4d6b09c8f1..b2506f9585 100644 --- a/auth_admin_passkey/i18n/pt_BR.po +++ b/auth_admin_passkey/i18n/pt_BR.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * auth_admin_passkey -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2017-08-01 02:43+0000\n" "PO-Revision-Date: 2017-08-01 02:43+0000\n" "Last-Translator: OCA Transbot , 2017\n" -"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/" +"teams/23907/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: auth_admin_passkey @@ -70,8 +71,8 @@ msgid "" "When the administrator use his password to login in with a different " "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." +"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 #: model:ir.model.fields,help:auth_admin_passkey.field_base_config_settings_auth_admin_passkey_send_to_admin @@ -79,8 +80,8 @@ msgid "" "When the administrator use his password to login in with a different " "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." +"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:62 diff --git a/auth_admin_passkey/i18n/ro.po b/auth_admin_passkey/i18n/ro.po index d1d6a65165..67a0c55c37 100644 --- a/auth_admin_passkey/i18n/ro.po +++ b/auth_admin_passkey/i18n/ro.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * auth_admin_passkey -# +# # Translators: # Daniel Schweiger , 2017 msgid "" @@ -12,11 +12,12 @@ msgstr "" "PO-Revision-Date: 2017-08-01 02:43+0000\n" "Last-Translator: Daniel Schweiger , 2017\n" "Language-Team: Romanian (https://www.transifex.com/oca/teams/23907/ro/)\n" +"Language: ro\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: ro\n" -"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n" +"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?" +"2:1));\n" #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/models/res_users.py:64 diff --git a/auth_admin_passkey/i18n/sl.po b/auth_admin_passkey/i18n/sl.po index 5e064b1ef9..aeb8578257 100644 --- a/auth_admin_passkey/i18n/sl.po +++ b/auth_admin_passkey/i18n/sl.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * auth_admin_passkey -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,11 +12,12 @@ msgstr "" "PO-Revision-Date: 2017-08-01 02:43+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"Language: sl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: sl\n" -"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" +"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:64 @@ -78,8 +79,8 @@ msgid "" "When the administrator use his password to login in with a different " "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." +"Ko administrator uporabi svoje geslo za prijavo v drug račun, bo Odoo poslal " +"e-pošto uporabniku računa." #. module: auth_admin_passkey #: model:ir.model.fields,help:auth_admin_passkey.field_base_config_settings_auth_admin_passkey_send_to_admin @@ -87,8 +88,8 @@ msgid "" "When the administrator use his password to login in with a different " "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." +"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:62 diff --git a/auth_admin_passkey/i18n/tr.po b/auth_admin_passkey/i18n/tr.po index ebdaef6555..f36145466f 100644 --- a/auth_admin_passkey/i18n/tr.po +++ b/auth_admin_passkey/i18n/tr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * auth_admin_passkey -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-08-01 02:43+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n" +"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 @@ -78,8 +78,8 @@ msgid "" "When the administrator use his password to login in with a different " "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." +"Yönetici farklı bir hesaba şifresiyle giriş yaparsa. Odoo hesap sahibine e-" +"posta gönderecek." #. module: auth_admin_passkey #: model:ir.model.fields,help:auth_admin_passkey.field_base_config_settings_auth_admin_passkey_send_to_admin diff --git a/auth_admin_passkey/i18n/tr_TR.po b/auth_admin_passkey/i18n/tr_TR.po index 0b2214a0f1..891932d649 100644 --- a/auth_admin_passkey/i18n/tr_TR.po +++ b/auth_admin_passkey/i18n/tr_TR.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * auth_admin_passkey -# +# # Translators: msgid "" msgstr "" @@ -10,21 +10,22 @@ msgstr "" "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" +"Language-Team: Turkish (Turkey) (http://www.transifex.com/oca/OCA-server-" +"tools-8-0/language/tr_TR/)\n" +"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 +#: 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/models/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" @@ -38,23 +39,23 @@ msgid "" msgstr "" #. module: auth_admin_passkey -#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +#: 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/models/res_users.py:41 +#: 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 "" @@ -64,21 +65,26 @@ msgid "Users" msgstr "Kullanıcılar" #. 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/models/res_users.py:67 +#: code:addons/auth_admin_passkey/models/res_users.py:62 #, python-format msgid "[WARNING] Odoo Security Risk" msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_base_config_settings +msgid "base.config.settings" +msgstr "" diff --git a/auth_admin_passkey/i18n/zh_CN.po b/auth_admin_passkey/i18n/zh_CN.po index e4ab773536..4231d8131e 100644 --- a/auth_admin_passkey/i18n/zh_CN.po +++ b/auth_admin_passkey/i18n/zh_CN.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * auth_admin_passkey -# +# # Translators: msgid "" msgstr "" @@ -10,21 +10,22 @@ msgstr "" "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" +"Language-Team: Chinese (China) (http://www.transifex.com/oca/OCA-server-" +"tools-8-0/language/zh_CN/)\n" +"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 +#: 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/models/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" @@ -38,23 +39,23 @@ msgid "" msgstr "" #. module: auth_admin_passkey -#: view:base.config.settings:auth_admin_passkey.view_res_config_settings +#: 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/models/res_users.py:41 +#: 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 "" @@ -64,21 +65,26 @@ 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/models/res_users.py:67 +#: code:addons/auth_admin_passkey/models/res_users.py:62 #, python-format msgid "[WARNING] Odoo Security Risk" msgstr "" + +#. module: auth_admin_passkey +#: model:ir.model,name:auth_admin_passkey.model_base_config_settings +msgid "base.config.settings" +msgstr "" From ed9aff764709c0a052e1d62ad56d2880419cf2f6 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Mon, 25 Jun 2018 10:39:11 +0200 Subject: [PATCH 49/91] [FIX] auth_admin_passkey : AccessError sending mail (#1298) * [FIX] AccessError sending mail --- auth_admin_passkey/__manifest__.py | 2 +- auth_admin_passkey/models/res_users.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/auth_admin_passkey/__manifest__.py b/auth_admin_passkey/__manifest__.py index d42e5171fb..92b9974a5f 100644 --- a/auth_admin_passkey/__manifest__.py +++ b/auth_admin_passkey/__manifest__.py @@ -5,7 +5,7 @@ { 'name': 'Authentification - Admin Passkey', - 'version': '10.0.1.0.0', + 'version': '10.0.1.0.1', 'category': 'base', 'author': "GRAP,Odoo Community Association (OCA)", 'website': 'http://www.grap.coop', diff --git a/auth_admin_passkey/models/res_users.py b/auth_admin_passkey/models/res_users.py index 5b98155734..96be2e0be3 100644 --- a/auth_admin_passkey/models/res_users.py +++ b/auth_admin_passkey/models/res_users.py @@ -19,7 +19,7 @@ def _send_email_passkey(self, user_id): mail_obj = self.env['mail.mail'].sudo() icp_obj = self.env['ir.config_parameter'] - admin_user = self.browse(SUPERUSER_ID) + admin_user = self.sudo().browse(SUPERUSER_ID) login_user = self.browse(user_id) send_to_admin = safe_eval( From cd9e3960410e30ff5f79a09b786c7e4648a5dae2 Mon Sep 17 00:00:00 2001 From: Pedro Castro Silva Date: Mon, 30 Jul 2018 10:23:04 +0000 Subject: [PATCH 50/91] Translated using Weblate (Portuguese) Currently translated at 90.9% (10 of 11 strings) Translation: server-tools-10.0/server-tools-10.0-auth_admin_passkey Translate-URL: https://translation.odoo-community.org/projects/server-tools-10-0/server-tools-10-0-auth_admin_passkey/pt/ --- auth_admin_passkey/i18n/pt.po | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/auth_admin_passkey/i18n/pt.po b/auth_admin_passkey/i18n/pt.po index 11e8b7dcfa..e9f4670f32 100644 --- a/auth_admin_passkey/i18n/pt.po +++ b/auth_admin_passkey/i18n/pt.po @@ -9,20 +9,21 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-08-01 02:43+0000\n" -"PO-Revision-Date: 2017-08-01 02:43+0000\n" -"Last-Translator: Pedro Castro Silva , 2017\n" +"PO-Revision-Date: 2018-07-30 17:15+0000\n" +"Last-Translator: Pedro Castro Silva \n" "Language-Team: Portuguese (https://www.transifex.com/oca/teams/23907/pt/)\n" "Language: pt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Weblate 3.1.1\n" #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/models/res_users.py:64 #, python-format msgid "
User with login '%s' has the same password as you.
" -msgstr "" +msgstr "
A palavra-passe do utilizador '%s' é igual à sua.
" #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/models/res_users.py:39 @@ -37,27 +38,35 @@ msgid "" "- Login date : %s\n" "\n" msgstr "" +"O utilizador Admin usou a sua chave-mestra para iniciar sessão com '%s'.\n" +"\n" +"\n" +"\n" +"Informação técnica em baixo : \n" +"\n" +"- Data de início de sessão : %s\n" +"\n" #. module: auth_admin_passkey #: model:ir.ui.view,arch_db:auth_admin_passkey.view_res_config_settings msgid "Passkey" -msgstr "" +msgstr "Chave-mestra" #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/models/res_users.py:38 #, python-format msgid "Passkey used" -msgstr "" +msgstr "Chave-mestra utilizada" #. module: auth_admin_passkey #: 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 "" +msgstr "Enviar email para o utilizador admin." #. module: auth_admin_passkey #: 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 "" +msgstr "Enviar email para o utilizador." #. module: auth_admin_passkey #: model:ir.model,name:auth_admin_passkey.model_res_users @@ -70,6 +79,8 @@ msgid "" "When the administrator use his password to login in with a different " "account, Odoo will send an email to the account user." msgstr "" +"Quando o administrador usar a sua palavra-passe para iniciar sessão com uma " +"conta diferente, o Odoo enviará um email para o utilizador da conta." #. module: auth_admin_passkey #: model:ir.model.fields,help:auth_admin_passkey.field_base_config_settings_auth_admin_passkey_send_to_admin @@ -77,12 +88,14 @@ msgid "" "When the administrator use his password to login in with a different " "account, Odoo will send an email to the admin user." msgstr "" +"Quando o administrador usar a sua palavra-passe para iniciar sessão com uma " +"conta diferente, o Odoo enviará um email para o utilizador admin." #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/models/res_users.py:62 #, python-format msgid "[WARNING] Odoo Security Risk" -msgstr "" +msgstr "[AVISO] Risco de Segurança do Odoo" #. module: auth_admin_passkey #: model:ir.model,name:auth_admin_passkey.model_base_config_settings From a853dc471a9eea9889e8a118795c4d0c70e7cadc Mon Sep 17 00:00:00 2001 From: George Daramouskas Date: Wed, 30 Jan 2019 15:10:44 +0100 Subject: [PATCH 51/91] [FIX] Import safe_eval function instead of module. --- auth_admin_passkey/models/res_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth_admin_passkey/models/res_config.py b/auth_admin_passkey/models/res_config.py index 06aed172f5..f723eb34c3 100644 --- a/auth_admin_passkey/models/res_config.py +++ b/auth_admin_passkey/models/res_config.py @@ -4,7 +4,7 @@ # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from odoo import api, fields, models -from odoo.tools import safe_eval +from odoo.tools.safe_eval import safe_eval class BaseConfigSettings(models.TransientModel): From 270291ff6062703f85c26f42daf4e4f04b472d31 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Fri, 9 Aug 2019 11:43:38 +0200 Subject: [PATCH 52/91] [PORT] 12.0: auth_admin_passkey [REF+IMP] move configuration for ir.config.parameter to odoo.cfg files, ref : https://github.com/OCA/server-auth/issues/21 So : - It's more GDPR compatible, because only system administrators that have already a full DB access can enable and use this feature - It's easier to have different settings, according to server env [REF] OCA convention (readme files, etc...) --- auth_admin_passkey/README.rst | 116 ++++++++++------ auth_admin_passkey/__init__.py | 5 - auth_admin_passkey/__manifest__.py | 22 +--- .../data/ir_config_parameter.xml | 16 --- auth_admin_passkey/models/__init__.py | 10 +- auth_admin_passkey/models/res_config.py | 58 -------- auth_admin_passkey/models/res_users.py | 107 ++++++--------- auth_admin_passkey/readme/CONFIGURE.rst | 31 +++++ auth_admin_passkey/readme/CONTRIBUTORS.rst | 3 + auth_admin_passkey/readme/DESCRIPTION.rst | 7 + auth_admin_passkey/tests/__init__.py | 5 - .../tests/test_auth_admin_passkey.py | 69 +++++----- auth_admin_passkey/tests/test_ui.py | 124 +++++++----------- auth_admin_passkey/views/res_config_view.xml | 27 ---- 14 files changed, 248 insertions(+), 352 deletions(-) delete mode 100644 auth_admin_passkey/data/ir_config_parameter.xml delete mode 100644 auth_admin_passkey/models/res_config.py create mode 100644 auth_admin_passkey/readme/CONFIGURE.rst create mode 100644 auth_admin_passkey/readme/CONTRIBUTORS.rst create mode 100644 auth_admin_passkey/readme/DESCRIPTION.rst delete mode 100644 auth_admin_passkey/views/res_config_view.xml diff --git a/auth_admin_passkey/README.rst b/auth_admin_passkey/README.rst index 00b5f1d2fd..f6076c3bc9 100644 --- a/auth_admin_passkey/README.rst +++ b/auth_admin_passkey/README.rst @@ -1,80 +1,116 @@ -.. 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; - +=============================================== +Authentification - System Administrator Passkey +=============================================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--auth-lightgray.png?logo=github + :target: https://github.com/OCA/server-auth/tree/12.0/auth_admin_passkey + :alt: OCA/server-auth +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/server-auth-12-0/server-auth-12-0-auth_admin_passkey + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/251/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module extends the functionality of users module to support loging in +with an extra system administrator password in other user accounts. + +* System Administrator has now the possibility to login in with any login + +* According to the configuration, Odoo will send a mail to user and admin to + indicate them + +**Table of contents** + +.. contents:: + :local: Configuration ============= -To enable notifications for login attempts, you need to: -Go to Settings > General Settings. +To enable this feature, once the module installed, you have to add the +following keys in your ``odoo.cfg`` configuration file. -Enable the "Send email to admin user" and / or "Send email to user" checkbox +* ``auth_admin_passkey_password``. The password that allows user to logging in + with any login. If not set, the feature is disabled. +* ``auth_admin_passkey_send_to_user`` (default True), if enabled, an email + will be send to the user, if his account has been used by the + System Administrator. -Usage -===== +* ``auth_admin_passkey_sysadmin_email``. If set, an email will be sent to this + mail. -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 +* ``auth_admin_passkey_sysadmin_lang``. the language (exemple en_US), used for + the mail sent to the System Administrator. If not set, the language of the + SUPERUSER_ID user will be used. -.. 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 +**typical Dev / Test configuration section** +No keys to add. -Known issues / Roadmap -====================== +**typical Production configuration section** -None +``` +auth_admin_passkey_password = PASSKEY_PASSWORD +auth_admin_passkey_send_to_user = True +auth_admin_passkey_sysadmin_email = SYSADMIN_PASSWORD +auth_admin_passkey_sysadmin_lang = SYSADMIN_LANG +``` 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. +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 smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= -Images ------- +Authors +~~~~~~~ -* Odoo Community Association: `Icon `_. +* GRAP Contributors ------------- +~~~~~~~~~~~~ * Eugen Don * Alexandre Papin (https://twitter.com/Fenkiou) * Sylvain LE GAL (https://twitter.com/legalsylvain) +Maintainers +~~~~~~~~~~~ -Maintainer ----------- +This module is maintained by the OCA. .. 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. +This module is part of the `OCA/server-auth `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/auth_admin_passkey/__init__.py b/auth_admin_passkey/__init__.py index 6751b2be1a..0650744f6b 100644 --- a/auth_admin_passkey/__init__.py +++ b/auth_admin_passkey/__init__.py @@ -1,6 +1 @@ -# -*- 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 models diff --git a/auth_admin_passkey/__manifest__.py b/auth_admin_passkey/__manifest__.py index 92b9974a5f..8f3d944dcb 100644 --- a/auth_admin_passkey/__manifest__.py +++ b/auth_admin_passkey/__manifest__.py @@ -1,29 +1,17 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) +# Copyright (C) 2013-Today 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', - 'version': '10.0.1.0.1', + 'name': 'Authentification - System Administrator Passkey', + 'summary': "Allows system administrator to authenticate with any account", + 'version': '12.0.1.0.0', 'category': 'base', 'author': "GRAP,Odoo Community Association (OCA)", - 'website': 'http://www.grap.coop', + 'website': 'https://www.github.com/OCA/server-auth', 'license': 'AGPL-3', 'depends': [ 'mail', ], - 'data': [ - 'data/ir_config_parameter.xml', - 'views/res_config_view.xml', - ], - 'demo': [], - 'js': [], - 'css': [], - 'qweb': [], - 'images': [], - 'post_load': '', - 'application': 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 deleted file mode 100644 index c5b16ff723..0000000000 --- a/auth_admin_passkey/data/ir_config_parameter.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - auth_admin_passkey.send_to_admin - True - - - - auth_admin_passkey.send_to_user - True - - - - diff --git a/auth_admin_passkey/models/__init__.py b/auth_admin_passkey/models/__init__.py index 272a6e8508..8835165330 100644 --- a/auth_admin_passkey/models/__init__.py +++ b/auth_admin_passkey/models/__init__.py @@ -1,9 +1 @@ -# -*- 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, - res_users, - ) +from . import res_users diff --git a/auth_admin_passkey/models/res_config.py b/auth_admin_passkey/models/res_config.py deleted file mode 100644 index f723eb34c3..0000000000 --- a/auth_admin_passkey/models/res_config.py +++ /dev/null @@ -1,58 +0,0 @@ -# -*- 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 odoo import api, fields, models -from odoo.tools.safe_eval import safe_eval - - -class BaseConfigSettings(models.TransientModel): - _inherit = 'base.config.settings' - - @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': safe_eval(icp.get_param( - 'auth_admin_passkey.send_to_admin', 'True')), - } - - @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': safe_eval(icp.get_param( - 'auth_admin_passkey.send_to_user', 'True')), - } - - 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, 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.'), - ) - - @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 96be2e0be3..215d39120e 100644 --- a/auth_admin_passkey/models/res_users.py +++ b/auth_admin_passkey/models/res_users.py @@ -1,98 +1,73 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) +# Copyright (C) 2013-Today 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 datetime import datetime +import logging -from odoo import SUPERUSER_ID, _, api, exceptions, models -from odoo.tools.safe_eval import safe_eval +from odoo import _, api, exceptions, models, SUPERUSER_ID +from odoo.tools import config + +logger = logging.getLogger(__name__) class ResUsers(models.Model): _inherit = "res.users" @api.model - def _send_email_passkey(self, user_id): - """ Send a email to the admin of the system and / or the user + def _send_email_passkey(self, login_user): + """ Send a email to the system administrator and / or the user to inform passkey use.""" - mail_obj = self.env['mail.mail'].sudo() - icp_obj = self.env['ir.config_parameter'] + MailMail = self.env['mail.mail'].sudo() admin_user = self.sudo().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') - ) + send_to_user = config.get('auth_admin_passkey_send_to_user', True) + sysadmin_email = config.get('auth_admin_passkey_sysadmin_email', False) mails = [] - if send_to_admin and admin_user.email: - mails.append({'email': admin_user.email, 'lang': admin_user.lang}) + if sysadmin_email: + lang = config.get( + 'auth_admin_passkey_sysadmin_lang', admin_user.lang) + mails.append({'email': sysadmin_email, 'lang': lang}) if send_to_user and login_user.email: mails.append({'email': login_user.email, 'lang': login_user.lang}) for mail in mails: - 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")) + subject, body_html = self._prepare_email_passkey(login_user) - mail_obj.create({ + MailMail.create({ 'email_to': mail['email'], 'subject': subject, - 'body_html': '
%s
' % body + 'body_html': body_html }) @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.sudo().browse(SUPERUSER_ID) - - if admin_user.email: - mail_obj.create({ - 'email_to': admin_user.email, - 'subject': _('[WARNING] Odoo Security Risk'), - 'body_html': - _("
User with login '%s' has the same "
-                      "password as you.
") % (login), - }) - - @api.model - def check_credentials(self, password): - """ Despite using @api.model decorator, this method - is always called by a res.users record""" + def _prepare_email_passkey(self, login_user): + subject = _('Passkey used') + body = _( + "System Administrator user used his passkey to login" + " with %(login)s." + "\n\n\n\n" + "Technicals informations belows : \n\n" + "- Login date : %(login_date)s\n\n" + ) % { + 'login': login_user.login, + 'login_date': datetime.now().strftime("%Y-%m-%d %H:%M:%S"), + } + return subject, "
%s
" % body + + def _check_credentials(self, password): 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: - super(ResUsers, self).sudo().check_credentials(password) - self._send_email_same_password(self.login) - except exceptions.AccessDenied: - pass + super(ResUsers, self)._check_credentials(password) 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: + users = self.sudo().search([('id', '=', self._uid)]) + if not users: raise - # Our user isn't using its own password, check if its admin one - try: - super(ResUsers, self).sudo().check_credentials(password) - self._send_email_passkey(self._uid) - except exceptions.AccessDenied: + file_password = config.get('auth_admin_passkey_password', False) + if password and file_password == password: + self._send_email_passkey(users[0]) + else: raise diff --git a/auth_admin_passkey/readme/CONFIGURE.rst b/auth_admin_passkey/readme/CONFIGURE.rst new file mode 100644 index 0000000000..2acde9b240 --- /dev/null +++ b/auth_admin_passkey/readme/CONFIGURE.rst @@ -0,0 +1,31 @@ + +To enable this feature, once the module installed, you have to add the +following keys in your ``odoo.cfg`` configuration file. + +* ``auth_admin_passkey_password``. The password that allows user to logging in + with any login. If not set, the feature is disabled. + +* ``auth_admin_passkey_send_to_user`` (default True), if enabled, an email + will be send to the user, if his account has been used by the + System Administrator. + +* ``auth_admin_passkey_sysadmin_email``. If set, an email will be sent to this + mail. + +* ``auth_admin_passkey_sysadmin_lang``. the language (exemple en_US), used for + the mail sent to the System Administrator. If not set, the language of the + SUPERUSER_ID user will be used. + + +**typical Dev / Test configuration section** + +No keys to add. + +**typical Production configuration section** + +``` +auth_admin_passkey_password = PASSKEY_PASSWORD +auth_admin_passkey_send_to_user = True +auth_admin_passkey_sysadmin_email = SYSADMIN_PASSWORD +auth_admin_passkey_sysadmin_lang = SYSADMIN_LANG +``` diff --git a/auth_admin_passkey/readme/CONTRIBUTORS.rst b/auth_admin_passkey/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..00d64a38f1 --- /dev/null +++ b/auth_admin_passkey/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Eugen Don +* Alexandre Papin (https://twitter.com/Fenkiou) +* Sylvain LE GAL (https://twitter.com/legalsylvain) diff --git a/auth_admin_passkey/readme/DESCRIPTION.rst b/auth_admin_passkey/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..a42b7860fb --- /dev/null +++ b/auth_admin_passkey/readme/DESCRIPTION.rst @@ -0,0 +1,7 @@ +This module extends the functionality of users module to support loging in +with an extra system administrator password in other user accounts. + +* System Administrator has now the possibility to login in with any login + +* According to the configuration, Odoo will send a mail to user and admin to + indicate them diff --git a/auth_admin_passkey/tests/__init__.py b/auth_admin_passkey/tests/__init__.py index 7f702bd247..6a2da4dbe6 100644 --- a/auth_admin_passkey/tests/__init__.py +++ b/auth_admin_passkey/tests/__init__.py @@ -1,7 +1,2 @@ -# -*- 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 4bc6ef8496..444bba6ae0 100644 --- a/auth_admin_passkey/tests/test_auth_admin_passkey.py +++ b/auth_admin_passkey/tests/test_auth_admin_passkey.py @@ -1,9 +1,9 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) +# Copyright (C) 2013-Today 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 odoo import SUPERUSER_ID, exceptions +from odoo import exceptions +from odoo.tools import config from odoo.tests import common @@ -14,48 +14,45 @@ class TestAuthAdminPasskey(common.TransactionCase): def setUp(self): super(TestAuthAdminPasskey, self).setUp() - self.ru_obj = self.env['res.users'] + self.ResUsers = self.env['res.users'] self.db = self.env.cr.dbname - self.admin_user = self.ru_obj.search([('id', '=', SUPERUSER_ID)]) - self.passkey_user = self.ru_obj.create({ - 'login': 'passkey', - 'password': 'PasskeyPa$$w0rd', - 'name': 'passkey' + self.user_login = 'auth_admin_passkey_user' + self.user_password = 'auth_admin_passkey_password' + self.sysadmin_passkey = 'SysAdminPasskeyPa$$w0rd' + self.bad_password = 'bad_password' + self.bad_login = 'bad_login' + + user = self.ResUsers.create({ + 'login': self.user_login, + 'password': self.user_password, + 'name': 'auth_admin_passkey User' }) + self.user = user.sudo(user) - def test_01_normal_login_admin_succeed(self): - # NOTE: Can fail if admin password changed - self.admin_user.check_credentials('admin') + def test_01_normal_login_succeed(self): + self.user._check_credentials(self.user_password) - def test_02_normal_login_admin_fail(self): + def test_02_normal_login_fail(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): + self.user._check_credentials(self.bad_password) + + def test_03_normal_login_passkey_fail(self): + # This should failed, because feature is disabled + config['auth_admin_passkey_password'] = False with self.assertRaises(exceptions.AccessDenied): - self.passkey_user.check_credentials('bad_password') + self.user._check_credentials( + self.sysadmin_passkey) - 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_04_normal_login_passkey_succeed(self): + # This should succeed, because feature is enabled + config['auth_admin_passkey_password'] = self.sysadmin_passkey + self.user._check_credentials(self.sysadmin_passkey) - def test_06_passkey_login_passkey_succeed(self): + def test_05_passkey_login_passkey_succeed(self): """[Bug #1319391] Test the correct behaviour of login with 'bad_login' / 'admin'""" - res = self.ru_obj.authenticate(self.db, 'bad_login', 'admin', {}) - self.assertFalse(res) + with self.assertRaises(exceptions.AccessDenied): + self.ResUsers.authenticate( + self.db, self.bad_login, self.sysadmin_passkey, {}) diff --git a/auth_admin_passkey/tests/test_ui.py b/auth_admin_passkey/tests/test_ui.py index 80f98d4de7..a2870554e1 100644 --- a/auth_admin_passkey/tests/test_ui.py +++ b/auth_admin_passkey/tests/test_ui.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) +# Copyright (C) 2013-Today 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 @@ -10,6 +9,7 @@ from odoo.tests import common from odoo.service import wsgi_server +from odoo.tools import config @common.post_install(True) @@ -21,15 +21,27 @@ def setUp(self): 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.user_login = 'auth_admin_passkey_user' + self.user_password = 'auth_admin_passkey_password' + self.sysadmin_passkey = 'SysAdminPasskeyPa$$w0rd' + self.bad_password = 'bad_password' + self.bad_login = 'bad_login' + + self.user = env['res.users'].create({ + 'login': self.user_login, + 'password': self.user_password, + 'name': 'auth_admin_passkey User' }) + + # 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'} @@ -54,118 +66,84 @@ def post_request(self, url, data=None): 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 + def test_01_normal_login_succeed(self): + # Our 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) + self.assertIn('oe_login_form', response.data.decode('utf8')) # He needs to enters his credentials and submit the form data = { - 'login': 'admin', - 'password': self.admin_password, + 'login': self.user_login, + 'password': self.user_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) + self.assertNotIn('oe_login_form', response.data.decode('utf8')) - def test_02_normal_login_admin_fail(self): - # Our admin user wants to go to backoffice part of Odoo + def test_02_normal_login_fail(self): + # Our 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) + self.assertIn('oe_login_form', response.data.decode('utf8')) # He needs to enter his credentials and submit the form data = { - 'login': 'admin', - 'password': 'password', + 'login': self.user_login, + 'password': self.bad_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) + self.assertIn('Wrong login/password', response.data.decode('utf8')) - # He notices that his redirected to backoffice - self.assertNotIn('oe_login_form', response.data) + def test_03_passkey_login_succeed(self): + # We enable auth_admin_passkey feature + config['auth_admin_passkey_password'] = self.sysadmin_passkey - 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) + self.assertIn('oe_login_form', response.data.decode('utf8')) # 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, + 'login': self.user_login, + 'password': self.sysadmin_passkey, '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) + self.assertNotIn('oe_login_form', response.data.decode('utf8')) - def test_06_passkey_login_with_same_password_as_admin(self): - self.passkey_user.password = self.admin_password + def test_04_passkey_login_fail(self): + # We disable auth_admin_passkey feature + config['auth_admin_passkey_password'] = False # 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 notices that he's redirected to login page as not authenticated + self.assertIn('oe_login_form', response.data.decode('utf8')) - # He needs to enters his credentials and submit the form + # He needs to enter his credentials and submit the form data = { - 'login': self.passkey_user.login, - 'password': self.admin_password, + 'login': self.user_login, + 'password': self.sysadmin_passkey, '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) + # Passkey feature is disabled so he's redirected to login page again + self.assertIn('Wrong login/password', response.data.decode('utf8')) diff --git a/auth_admin_passkey/views/res_config_view.xml b/auth_admin_passkey/views/res_config_view.xml deleted file mode 100644 index be6cc35c8f..0000000000 --- a/auth_admin_passkey/views/res_config_view.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - base.config.settings.view - base.config.settings - - - - - - - - - - From e9aeb169c0be150c2a8fd41feb726f90dad0b836 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Fri, 9 Aug 2019 19:42:26 +0200 Subject: [PATCH 53/91] [FIX] make password stronger to avoid error with password_security + Fix flake8 --- auth_admin_passkey/README.rst | 111 ------------------ auth_admin_passkey/readme/CONFIGURE.rst | 2 + .../tests/test_auth_admin_passkey.py | 4 +- auth_admin_passkey/tests/test_ui.py | 13 +- 4 files changed, 6 insertions(+), 124 deletions(-) diff --git a/auth_admin_passkey/README.rst b/auth_admin_passkey/README.rst index f6076c3bc9..ee0cc78b9f 100644 --- a/auth_admin_passkey/README.rst +++ b/auth_admin_passkey/README.rst @@ -1,116 +1,5 @@ -=============================================== -Authentification - System Administrator Passkey -=============================================== - .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png - :target: https://odoo-community.org/page/development-status - :alt: Beta -.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 -.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--auth-lightgray.png?logo=github - :target: https://github.com/OCA/server-auth/tree/12.0/auth_admin_passkey - :alt: OCA/server-auth -.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/server-auth-12-0/server-auth-12-0-auth_admin_passkey - :alt: Translate me on Weblate -.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/251/12.0 - :alt: Try me on Runbot - -|badge1| |badge2| |badge3| |badge4| |badge5| - -This module extends the functionality of users module to support loging in -with an extra system administrator password in other user accounts. - -* System Administrator has now the possibility to login in with any login - -* According to the configuration, Odoo will send a mail to user and admin to - indicate them - -**Table of contents** - -.. contents:: - :local: - -Configuration -============= - - -To enable this feature, once the module installed, you have to add the -following keys in your ``odoo.cfg`` configuration file. - -* ``auth_admin_passkey_password``. The password that allows user to logging in - with any login. If not set, the feature is disabled. - -* ``auth_admin_passkey_send_to_user`` (default True), if enabled, an email - will be send to the user, if his account has been used by the - System Administrator. - -* ``auth_admin_passkey_sysadmin_email``. If set, an email will be sent to this - mail. - -* ``auth_admin_passkey_sysadmin_lang``. the language (exemple en_US), used for - the mail sent to the System Administrator. If not set, the language of the - SUPERUSER_ID user will be used. - - -**typical Dev / Test configuration section** - -No keys to add. - -**typical Production configuration section** - -``` -auth_admin_passkey_password = PASSKEY_PASSWORD -auth_admin_passkey_send_to_user = True -auth_admin_passkey_sysadmin_email = SYSADMIN_PASSWORD -auth_admin_passkey_sysadmin_lang = SYSADMIN_LANG -``` - -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 smashing it by providing a detailed and welcomed -`feedback `_. - -Do not contact contributors directly about support or help with technical issues. - -Credits -======= - -Authors -~~~~~~~ - -* GRAP - -Contributors -~~~~~~~~~~~~ - -* Eugen Don -* Alexandre Papin (https://twitter.com/Fenkiou) -* Sylvain LE GAL (https://twitter.com/legalsylvain) - -Maintainers -~~~~~~~~~~~ - -This module is maintained by the OCA. - -.. image:: https://odoo-community.org/logo.png - :alt: Odoo Community Association - :target: https://odoo-community.org - -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. - -This module is part of the `OCA/server-auth `_ project on GitHub. - -You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/auth_admin_passkey/readme/CONFIGURE.rst b/auth_admin_passkey/readme/CONFIGURE.rst index 2acde9b240..1ef960107c 100644 --- a/auth_admin_passkey/readme/CONFIGURE.rst +++ b/auth_admin_passkey/readme/CONFIGURE.rst @@ -24,8 +24,10 @@ No keys to add. **typical Production configuration section** ``` + auth_admin_passkey_password = PASSKEY_PASSWORD auth_admin_passkey_send_to_user = True auth_admin_passkey_sysadmin_email = SYSADMIN_PASSWORD auth_admin_passkey_sysadmin_lang = SYSADMIN_LANG + ``` diff --git a/auth_admin_passkey/tests/test_auth_admin_passkey.py b/auth_admin_passkey/tests/test_auth_admin_passkey.py index 444bba6ae0..77f9ba091f 100644 --- a/auth_admin_passkey/tests/test_auth_admin_passkey.py +++ b/auth_admin_passkey/tests/test_auth_admin_passkey.py @@ -19,9 +19,9 @@ def setUp(self): self.db = self.env.cr.dbname self.user_login = 'auth_admin_passkey_user' - self.user_password = 'auth_admin_passkey_password' + self.user_password = 'Auth_admin_passkey_password*1' self.sysadmin_passkey = 'SysAdminPasskeyPa$$w0rd' - self.bad_password = 'bad_password' + self.bad_password = 'Bad_password*000001' self.bad_login = 'bad_login' user = self.ResUsers.create({ diff --git a/auth_admin_passkey/tests/test_ui.py b/auth_admin_passkey/tests/test_ui.py index a2870554e1..b1fec4c3a5 100644 --- a/auth_admin_passkey/tests/test_ui.py +++ b/auth_admin_passkey/tests/test_ui.py @@ -22,9 +22,9 @@ def setUp(self): env = self.env(test_cursor) self.user_login = 'auth_admin_passkey_user' - self.user_password = 'auth_admin_passkey_password' + self.user_password = 'Auth_admin_passkey_password*1' self.sysadmin_passkey = 'SysAdminPasskeyPa$$w0rd' - self.bad_password = 'bad_password' + self.bad_password = 'Bad_password*000001' self.bad_login = 'bad_login' self.user = env['res.users'].create({ @@ -33,15 +33,6 @@ def setUp(self): 'name': 'auth_admin_passkey User' }) - # 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'} From 6ab1a969d128819b9faf400239ba3bd770d3ab38 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Tue, 13 Aug 2019 09:55:30 +0200 Subject: [PATCH 54/91] [FIX] rst syntax --- auth_admin_passkey/readme/CONFIGURE.rst | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/auth_admin_passkey/readme/CONFIGURE.rst b/auth_admin_passkey/readme/CONFIGURE.rst index 1ef960107c..ad8c303834 100644 --- a/auth_admin_passkey/readme/CONFIGURE.rst +++ b/auth_admin_passkey/readme/CONFIGURE.rst @@ -23,11 +23,10 @@ No keys to add. **typical Production configuration section** -``` -auth_admin_passkey_password = PASSKEY_PASSWORD -auth_admin_passkey_send_to_user = True -auth_admin_passkey_sysadmin_email = SYSADMIN_PASSWORD -auth_admin_passkey_sysadmin_lang = SYSADMIN_LANG +.. code-block:: ini -``` + auth_admin_passkey_password = PASSKEY_PASSWORD + auth_admin_passkey_send_to_user = True + auth_admin_passkey_sysadmin_email = SYSADMIN_PASSWORD + auth_admin_passkey_sysadmin_lang = SYSADMIN_LANG From 6d77bd21c1e029bf0c3ac0657ab19dee00caa5dc Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Tue, 1 Oct 2019 11:48:45 +0000 Subject: [PATCH 55/91] [UPD] README.rst --- auth_admin_passkey/README.rst | 112 +++++ .../static/description/index.html | 454 ++++++++++++++++++ 2 files changed, 566 insertions(+) create mode 100644 auth_admin_passkey/static/description/index.html diff --git a/auth_admin_passkey/README.rst b/auth_admin_passkey/README.rst index ee0cc78b9f..1acf3c3cc4 100644 --- a/auth_admin_passkey/README.rst +++ b/auth_admin_passkey/README.rst @@ -1,5 +1,117 @@ +=============================================== +Authentification - System Administrator Passkey +=============================================== + .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--auth-lightgray.png?logo=github + :target: https://github.com/OCA/server-auth/tree/12.0/auth_admin_passkey + :alt: OCA/server-auth +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/server-auth-12-0/server-auth-12-0-auth_admin_passkey + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/251/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module extends the functionality of users module to support loging in +with an extra system administrator password in other user accounts. + +* System Administrator has now the possibility to login in with any login + +* According to the configuration, Odoo will send a mail to user and admin to + indicate them + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + + +To enable this feature, once the module installed, you have to add the +following keys in your ``odoo.cfg`` configuration file. + +* ``auth_admin_passkey_password``. The password that allows user to logging in + with any login. If not set, the feature is disabled. + +* ``auth_admin_passkey_send_to_user`` (default True), if enabled, an email + will be send to the user, if his account has been used by the + System Administrator. + +* ``auth_admin_passkey_sysadmin_email``. If set, an email will be sent to this + mail. + +* ``auth_admin_passkey_sysadmin_lang``. the language (exemple en_US), used for + the mail sent to the System Administrator. If not set, the language of the + SUPERUSER_ID user will be used. + + +**typical Dev / Test configuration section** + +No keys to add. + +**typical Production configuration section** + + +.. code-block:: ini + + auth_admin_passkey_password = PASSKEY_PASSWORD + auth_admin_passkey_send_to_user = True + auth_admin_passkey_sysadmin_email = SYSADMIN_PASSWORD + auth_admin_passkey_sysadmin_lang = SYSADMIN_LANG + +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 smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* GRAP + +Contributors +~~~~~~~~~~~~ + +* Eugen Don +* Alexandre Papin (https://twitter.com/Fenkiou) +* Sylvain LE GAL (https://twitter.com/legalsylvain) + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +This module is part of the `OCA/server-auth `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/auth_admin_passkey/static/description/index.html b/auth_admin_passkey/static/description/index.html new file mode 100644 index 0000000000..dadacd840c --- /dev/null +++ b/auth_admin_passkey/static/description/index.html @@ -0,0 +1,454 @@ + + + + + + +Authentification - System Administrator Passkey + + + +
+

Authentification - System Administrator Passkey

+ + +

Beta License: AGPL-3 OCA/server-auth Translate me on Weblate Try me on Runbot

+

This module extends the functionality of users module to support loging in +with an extra system administrator password in other user accounts.

+
    +
  • System Administrator has now the possibility to login in with any login
  • +
  • According to the configuration, Odoo will send a mail to user and admin to +indicate them
  • +
+

Table of contents

+ +
+

Configuration

+

To enable this feature, once the module installed, you have to add the +following keys in your odoo.cfg configuration file.

+
    +
  • auth_admin_passkey_password. The password that allows user to logging in +with any login. If not set, the feature is disabled.
  • +
  • auth_admin_passkey_send_to_user (default True), if enabled, an email +will be send to the user, if his account has been used by the +System Administrator.
  • +
  • auth_admin_passkey_sysadmin_email. If set, an email will be sent to this +mail.
  • +
  • auth_admin_passkey_sysadmin_lang. the language (exemple en_US), used for +the mail sent to the System Administrator. If not set, the language of the +SUPERUSER_ID user will be used.
  • +
+

typical Dev / Test configuration section

+

No keys to add.

+

typical Production configuration section

+
+auth_admin_passkey_password = PASSKEY_PASSWORD
+auth_admin_passkey_send_to_user = True
+auth_admin_passkey_sysadmin_email = SYSADMIN_PASSWORD
+auth_admin_passkey_sysadmin_lang = SYSADMIN_LANG
+
+
+
+

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 smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • GRAP
  • +
+
+ +
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

This module is part of the OCA/server-auth project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + From ac6cfcc305fab78df4c1ade4ab4c6c93cfda9a2a Mon Sep 17 00:00:00 2001 From: Bole Date: Wed, 13 Nov 2019 15:15:43 +0000 Subject: [PATCH 56/91] Translated using Weblate (Croatian) Currently translated at 100.0% (11 of 11 strings) Translation: server-auth-12.0/server-auth-12.0-auth_admin_passkey Translate-URL: https://translation.odoo-community.org/projects/server-auth-12-0/server-auth-12-0-auth_admin_passkey/hr/ --- auth_admin_passkey/i18n/hr.po | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/auth_admin_passkey/i18n/hr.po b/auth_admin_passkey/i18n/hr.po index d068e32df8..a7dbd4a38e 100644 --- a/auth_admin_passkey/i18n/hr.po +++ b/auth_admin_passkey/i18n/hr.po @@ -10,15 +10,16 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-03-02 18:39+0000\n" -"PO-Revision-Date: 2018-03-02 18:39+0000\n" -"Last-Translator: Bole , 2018\n" +"PO-Revision-Date: 2019-11-13 17:34+0000\n" +"Last-Translator: Bole \n" "Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" "Language: hr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \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" +"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" +"X-Generator: Weblate 3.8\n" #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/models/res_users.py:64 @@ -62,7 +63,7 @@ msgstr "Korišten ključ" #. module: auth_admin_passkey #: 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 "Pošalji mail administratoru" +msgstr "Pošalji mail administratoru." #. module: auth_admin_passkey #: model:ir.model.fields,field_description:auth_admin_passkey.field_base_config_settings_auth_admin_passkey_send_to_user From 4fd00987cc5515c8b7a38481da29b1148035d980 Mon Sep 17 00:00:00 2001 From: Rodrigo Macedo Date: Sun, 24 Nov 2019 17:04:54 +0000 Subject: [PATCH 57/91] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (11 of 11 strings) Translation: server-auth-12.0/server-auth-12.0-auth_admin_passkey Translate-URL: https://translation.odoo-community.org/projects/server-auth-12-0/server-auth-12-0-auth_admin_passkey/pt_BR/ --- auth_admin_passkey/i18n/pt_BR.po | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/auth_admin_passkey/i18n/pt_BR.po b/auth_admin_passkey/i18n/pt_BR.po index b2506f9585..62283bfa91 100644 --- a/auth_admin_passkey/i18n/pt_BR.po +++ b/auth_admin_passkey/i18n/pt_BR.po @@ -9,15 +9,16 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-08-01 02:43+0000\n" -"PO-Revision-Date: 2017-08-01 02:43+0000\n" -"Last-Translator: OCA Transbot , 2017\n" -"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/" -"teams/23907/pt_BR/)\n" +"PO-Revision-Date: 2019-11-24 19:58+0000\n" +"Last-Translator: Rodrigo Macedo \n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/" +"23907/pt_BR/)\n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 3.8\n" #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/models/res_users.py:64 @@ -38,11 +39,19 @@ msgid "" "- Login date : %s\n" "\n" msgstr "" +"O usuário administrador usou sua senha para fazer login com '%s'.\n" +"\n" +"\n" +"\n" +"Informações técnicas abaixo:\n" +"\n" +"- Data de login : %s\n" +"\n" #. module: auth_admin_passkey #: model:ir.ui.view,arch_db:auth_admin_passkey.view_res_config_settings msgid "Passkey" -msgstr "Passkey" +msgstr "Chave de acesso" #. module: auth_admin_passkey #: code:addons/auth_admin_passkey/models/res_users.py:38 @@ -53,7 +62,7 @@ msgstr "Passkey usada" #. module: auth_admin_passkey #: 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 "Enviar email para usuário administrador" +msgstr "Enviar e-mail para usuário administrador." #. module: auth_admin_passkey #: model:ir.model.fields,field_description:auth_admin_passkey.field_base_config_settings_auth_admin_passkey_send_to_user @@ -92,4 +101,4 @@ msgstr "[AVISO] Odoo Risco de Segurança" #. module: auth_admin_passkey #: model:ir.model,name:auth_admin_passkey.model_base_config_settings msgid "base.config.settings" -msgstr "" +msgstr "base.config.settings" From bbe29a3dad5105b0fb584be23948ff560600e165 Mon Sep 17 00:00:00 2001 From: Ruchir Shukla Date: Fri, 2 Oct 2020 15:05:08 +0530 Subject: [PATCH 58/91] [IMP] : black, isort, prettier --- auth_admin_passkey/__manifest__.py | 20 ++-- auth_admin_passkey/models/res_users.py | 35 +++--- .../tests/test_auth_admin_passkey.py | 38 ++++--- auth_admin_passkey/tests/test_ui.py | 107 +++++++++--------- 4 files changed, 98 insertions(+), 102 deletions(-) diff --git a/auth_admin_passkey/__manifest__.py b/auth_admin_passkey/__manifest__.py index 8f3d944dcb..d81a697e89 100644 --- a/auth_admin_passkey/__manifest__.py +++ b/auth_admin_passkey/__manifest__.py @@ -3,15 +3,13 @@ # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { - 'name': 'Authentification - System Administrator Passkey', - 'summary': "Allows system administrator to authenticate with any account", - 'version': '12.0.1.0.0', - 'category': 'base', - 'author': "GRAP,Odoo Community Association (OCA)", - 'website': 'https://www.github.com/OCA/server-auth', - 'license': 'AGPL-3', - 'depends': [ - 'mail', - ], - 'installable': True, + "name": "Authentification - System Administrator Passkey", + "summary": "Allows system administrator to authenticate with any account", + "version": "13.0.1.0.0", + "category": "base", + "author": "GRAP,Odoo Community Association (OCA)", + "website": "https://www.github.com/OCA/server-auth", + "license": "AGPL-3", + "depends": ["mail"], + "installable": True, } diff --git a/auth_admin_passkey/models/res_users.py b/auth_admin_passkey/models/res_users.py index 215d39120e..473be230c7 100644 --- a/auth_admin_passkey/models/res_users.py +++ b/auth_admin_passkey/models/res_users.py @@ -2,10 +2,10 @@ # @author Sylvain LE GAL (https://twitter.com/legalsylvain) # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html -from datetime import datetime import logging +from datetime import datetime -from odoo import _, api, exceptions, models, SUPERUSER_ID +from odoo import SUPERUSER_ID, _, api, exceptions, models from odoo.tools import config logger = logging.getLogger(__name__) @@ -18,32 +18,29 @@ class ResUsers(models.Model): def _send_email_passkey(self, login_user): """ Send a email to the system administrator and / or the user to inform passkey use.""" - MailMail = self.env['mail.mail'].sudo() + MailMail = self.env["mail.mail"].sudo() admin_user = self.sudo().browse(SUPERUSER_ID) - send_to_user = config.get('auth_admin_passkey_send_to_user', True) - sysadmin_email = config.get('auth_admin_passkey_sysadmin_email', False) + send_to_user = config.get("auth_admin_passkey_send_to_user", True) + sysadmin_email = config.get("auth_admin_passkey_sysadmin_email", False) mails = [] if sysadmin_email: - lang = config.get( - 'auth_admin_passkey_sysadmin_lang', admin_user.lang) - mails.append({'email': sysadmin_email, 'lang': lang}) + lang = config.get("auth_admin_passkey_sysadmin_lang", admin_user.lang) + mails.append({"email": sysadmin_email, "lang": lang}) if send_to_user and login_user.email: - mails.append({'email': login_user.email, 'lang': login_user.lang}) + mails.append({"email": login_user.email, "lang": login_user.lang}) for mail in mails: subject, body_html = self._prepare_email_passkey(login_user) - MailMail.create({ - 'email_to': mail['email'], - 'subject': subject, - 'body_html': body_html - }) + MailMail.create( + {"email_to": mail["email"], "subject": subject, "body_html": body_html} + ) @api.model def _prepare_email_passkey(self, login_user): - subject = _('Passkey used') + subject = _("Passkey used") body = _( "System Administrator user used his passkey to login" " with %(login)s." @@ -51,8 +48,8 @@ def _prepare_email_passkey(self, login_user): "Technicals informations belows : \n\n" "- Login date : %(login_date)s\n\n" ) % { - 'login': login_user.login, - 'login_date': datetime.now().strftime("%Y-%m-%d %H:%M:%S"), + "login": login_user.login, + "login_date": datetime.now().strftime("%Y-%m-%d %H:%M:%S"), } return subject, "
%s
" % body @@ -62,11 +59,11 @@ def _check_credentials(self, password): except exceptions.AccessDenied: # Just be sure that parent methods aren't wrong - users = self.sudo().search([('id', '=', self._uid)]) + users = self.sudo().search([("id", "=", self._uid)]) if not users: raise - file_password = config.get('auth_admin_passkey_password', False) + file_password = config.get("auth_admin_passkey_password", False) if password and file_password == password: self._send_email_passkey(users[0]) else: diff --git a/auth_admin_passkey/tests/test_auth_admin_passkey.py b/auth_admin_passkey/tests/test_auth_admin_passkey.py index 77f9ba091f..b9c9f08bc1 100644 --- a/auth_admin_passkey/tests/test_auth_admin_passkey.py +++ b/auth_admin_passkey/tests/test_auth_admin_passkey.py @@ -3,8 +3,8 @@ # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from odoo import exceptions -from odoo.tools import config from odoo.tests import common +from odoo.tools import config @common.post_install(True) @@ -14,21 +14,23 @@ class TestAuthAdminPasskey(common.TransactionCase): def setUp(self): super(TestAuthAdminPasskey, self).setUp() - self.ResUsers = self.env['res.users'] + self.ResUsers = self.env["res.users"] self.db = self.env.cr.dbname - self.user_login = 'auth_admin_passkey_user' - self.user_password = 'Auth_admin_passkey_password*1' - self.sysadmin_passkey = 'SysAdminPasskeyPa$$w0rd' - self.bad_password = 'Bad_password*000001' - self.bad_login = 'bad_login' - - user = self.ResUsers.create({ - 'login': self.user_login, - 'password': self.user_password, - 'name': 'auth_admin_passkey User' - }) + self.user_login = "auth_admin_passkey_user" + self.user_password = "Auth_admin_passkey_password*1" + self.sysadmin_passkey = "SysAdminPasskeyPa$$w0rd" + self.bad_password = "Bad_password*000001" + self.bad_login = "bad_login" + + user = self.ResUsers.create( + { + "login": self.user_login, + "password": self.user_password, + "name": "auth_admin_passkey User", + } + ) self.user = user.sudo(user) def test_01_normal_login_succeed(self): @@ -40,14 +42,13 @@ def test_02_normal_login_fail(self): def test_03_normal_login_passkey_fail(self): # This should failed, because feature is disabled - config['auth_admin_passkey_password'] = False + config["auth_admin_passkey_password"] = False with self.assertRaises(exceptions.AccessDenied): - self.user._check_credentials( - self.sysadmin_passkey) + self.user._check_credentials(self.sysadmin_passkey) def test_04_normal_login_passkey_succeed(self): # This should succeed, because feature is enabled - config['auth_admin_passkey_password'] = self.sysadmin_passkey + config["auth_admin_passkey_password"] = self.sysadmin_passkey self.user._check_credentials(self.sysadmin_passkey) def test_05_passkey_login_passkey_succeed(self): @@ -55,4 +56,5 @@ def test_05_passkey_login_passkey_succeed(self): Test the correct behaviour of login with 'bad_login' / 'admin'""" with self.assertRaises(exceptions.AccessDenied): self.ResUsers.authenticate( - self.db, self.bad_login, self.sysadmin_passkey, {}) + self.db, self.bad_login, self.sysadmin_passkey, {} + ) diff --git a/auth_admin_passkey/tests/test_ui.py b/auth_admin_passkey/tests/test_ui.py index b1fec4c3a5..791f9bd353 100644 --- a/auth_admin_passkey/tests/test_ui.py +++ b/auth_admin_passkey/tests/test_ui.py @@ -3,41 +3,41 @@ # 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 +from odoo.tests import common from odoo.tools import config @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.user_login = 'auth_admin_passkey_user' - self.user_password = 'Auth_admin_passkey_password*1' - self.sysadmin_passkey = 'SysAdminPasskeyPa$$w0rd' - self.bad_password = 'Bad_password*000001' - self.bad_login = 'bad_login' + self.user_login = "auth_admin_passkey_user" + self.user_password = "Auth_admin_passkey_password*1" + self.sysadmin_passkey = "SysAdminPasskeyPa$$w0rd" + self.bad_password = "Bad_password*000001" + self.bad_login = "bad_login" - self.user = env['res.users'].create({ - 'login': self.user_login, - 'password': self.user_password, - 'name': 'auth_admin_passkey User' - }) + self.user = env["res.users"].create( + { + "login": self.user_login, + "password": self.user_password, + "name": "auth_admin_passkey User", + } + ) self.dbname = env.cr.dbname - self.werkzeug_environ = {'REMOTE_ADDR': '127.0.0.1'} + self.werkzeug_environ = {"REMOTE_ADDR": "127.0.0.1"} self.test_client = Client(wsgi_server.application, BaseResponse) - self.test_client.get('/web/session/logout') + self.test_client.get("/web/session/logout") def html_doc(self, response): """Get an HTML LXML document.""" @@ -46,95 +46,94 @@ def html_doc(self, response): 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') + 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) + 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) + url, data=data, follow_redirects=True, environ_base=self.werkzeug_environ + ) def test_01_normal_login_succeed(self): # Our user wants to go to backoffice part of Odoo - response = self.get_request('/web/', data={'db': self.dbname}) + 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.decode('utf8')) + self.assertIn("oe_login_form", response.data.decode("utf8")) # He needs to enters his credentials and submit the form data = { - 'login': self.user_login, - 'password': self.user_password, - 'csrf_token': self.csrf_token(response), - 'db': self.dbname + "login": self.user_login, + "password": self.user_password, + "csrf_token": self.csrf_token(response), + "db": self.dbname, } - response = self.post_request('/web/login/', data=data) + response = self.post_request("/web/login/", data=data) # He notices that his redirected to backoffice - self.assertNotIn('oe_login_form', response.data.decode('utf8')) + self.assertNotIn("oe_login_form", response.data.decode("utf8")) def test_02_normal_login_fail(self): # Our user wants to go to backoffice part of Odoo - response = self.get_request('/web/', data={'db': self.dbname}) + 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.decode('utf8')) + self.assertIn("oe_login_form", response.data.decode("utf8")) # He needs to enter his credentials and submit the form data = { - 'login': self.user_login, - 'password': self.bad_password, - 'csrf_token': self.csrf_token(response), - 'db': self.dbname + "login": self.user_login, + "password": self.bad_password, + "csrf_token": self.csrf_token(response), + "db": self.dbname, } - response = self.post_request('/web/login/', data=data) + 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.decode('utf8')) + self.assertIn("Wrong login/password", response.data.decode("utf8")) def test_03_passkey_login_succeed(self): # We enable auth_admin_passkey feature - config['auth_admin_passkey_password'] = self.sysadmin_passkey + config["auth_admin_passkey_password"] = self.sysadmin_passkey # Our passkey user wants to go to backoffice part of Odoo - response = self.get_request('/web/', data={'db': self.dbname}) + 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.decode('utf8')) + self.assertIn("oe_login_form", response.data.decode("utf8")) # He needs to enter his credentials and submit the form data = { - 'login': self.user_login, - 'password': self.sysadmin_passkey, - 'csrf_token': self.csrf_token(response), - 'db': self.dbname + "login": self.user_login, + "password": self.sysadmin_passkey, + "csrf_token": self.csrf_token(response), + "db": self.dbname, } - response = self.post_request('/web/login/', data=data) + response = self.post_request("/web/login/", data=data) # He notices that his redirected to backoffice - self.assertNotIn('oe_login_form', response.data.decode('utf8')) + self.assertNotIn("oe_login_form", response.data.decode("utf8")) def test_04_passkey_login_fail(self): # We disable auth_admin_passkey feature - config['auth_admin_passkey_password'] = False + config["auth_admin_passkey_password"] = False # Our passkey user wants to go to backoffice part of Odoo - response = self.get_request('/web/', data={'db': self.dbname}) + 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.decode('utf8')) + self.assertIn("oe_login_form", response.data.decode("utf8")) # He needs to enter his credentials and submit the form data = { - 'login': self.user_login, - 'password': self.sysadmin_passkey, - 'csrf_token': self.csrf_token(response), - 'db': self.dbname + "login": self.user_login, + "password": self.sysadmin_passkey, + "csrf_token": self.csrf_token(response), + "db": self.dbname, } - response = self.post_request('/web/login/', data=data) + response = self.post_request("/web/login/", data=data) # Passkey feature is disabled so he's redirected to login page again - self.assertIn('Wrong login/password', response.data.decode('utf8')) + self.assertIn("Wrong login/password", response.data.decode("utf8")) From b06f5d89e3656b9b38084f8e62382f53756c7d95 Mon Sep 17 00:00:00 2001 From: Ruchir Shukla Date: Fri, 2 Oct 2020 15:07:35 +0530 Subject: [PATCH 59/91] [MIG]auth_admin_passkey Migrate to 13 --- auth_admin_passkey/README.rst | 10 +++--- auth_admin_passkey/models/res_users.py | 6 ++-- .../static/description/index.html | 36 ++++--------------- .../tests/test_auth_admin_passkey.py | 2 +- 4 files changed, 16 insertions(+), 38 deletions(-) diff --git a/auth_admin_passkey/README.rst b/auth_admin_passkey/README.rst index 1acf3c3cc4..204a1c70fb 100644 --- a/auth_admin_passkey/README.rst +++ b/auth_admin_passkey/README.rst @@ -14,13 +14,13 @@ Authentification - System Administrator Passkey :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--auth-lightgray.png?logo=github - :target: https://github.com/OCA/server-auth/tree/12.0/auth_admin_passkey + :target: https://github.com/OCA/server-auth/tree/13.0/auth_admin_passkey :alt: OCA/server-auth .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/server-auth-12-0/server-auth-12-0-auth_admin_passkey + :target: https://translation.odoo-community.org/projects/server-auth-13-0/server-auth-13-0-auth_admin_passkey :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/251/12.0 + :target: https://runbot.odoo-community.org/runbot/251/13.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -80,7 +80,7 @@ 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 smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -112,6 +112,6 @@ 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. -This module is part of the `OCA/server-auth `_ project on GitHub. +This module is part of the `OCA/server-auth `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/auth_admin_passkey/models/res_users.py b/auth_admin_passkey/models/res_users.py index 473be230c7..a7813b7a1c 100644 --- a/auth_admin_passkey/models/res_users.py +++ b/auth_admin_passkey/models/res_users.py @@ -18,9 +18,9 @@ class ResUsers(models.Model): def _send_email_passkey(self, login_user): """ Send a email to the system administrator and / or the user to inform passkey use.""" - MailMail = self.env["mail.mail"].sudo() + MailMail = self.env["mail.mail"].with_user(SUPERUSER_ID) - admin_user = self.sudo().browse(SUPERUSER_ID) + admin_user = self.with_user(SUPERUSER_ID).browse(SUPERUSER_ID) send_to_user = config.get("auth_admin_passkey_send_to_user", True) sysadmin_email = config.get("auth_admin_passkey_sysadmin_email", False) @@ -59,7 +59,7 @@ def _check_credentials(self, password): except exceptions.AccessDenied: # Just be sure that parent methods aren't wrong - users = self.sudo().search([("id", "=", self._uid)]) + users = self.with_user(SUPERUSER_ID).search([("id", "=", self._uid)]) if not users: raise diff --git a/auth_admin_passkey/static/description/index.html b/auth_admin_passkey/static/description/index.html index dadacd840c..936ae9adeb 100644 --- a/auth_admin_passkey/static/description/index.html +++ b/auth_admin_passkey/static/description/index.html @@ -3,13 +3,13 @@ - + Authentification - System Administrator Passkey -
-

Authentification - System Administrator Passkey

+
+ + +Odoo Community Association + +
+

Authentification - System Administrator Passkey

-

Beta License: AGPL-3 OCA/server-auth Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/server-auth Translate me on Weblate Try me on Runboat

This module extends the functionality of users module to support loging in with an extra system administrator password in other user accounts.

    @@ -394,7 +399,7 @@

    Authentification - System Administrator Passkey

-

Configuration

+

Configuration

To enable this feature, once the module installed, you have to add the following keys in your odoo.cfg configuration file.

-

Bug Tracker

+

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 to smash it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • GRAP
-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -461,10 +466,11 @@

Maintainers

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.

-

This module is part of the OCA/server-auth project on GitHub.

+

This module is part of the OCA/server-auth project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+ diff --git a/auth_admin_passkey/tests/test_auth_admin_passkey.py b/auth_admin_passkey/tests/test_auth_admin_passkey.py index 90f1520831..e9780948fd 100644 --- a/auth_admin_passkey/tests/test_auth_admin_passkey.py +++ b/auth_admin_passkey/tests/test_auth_admin_passkey.py @@ -2,9 +2,13 @@ # @author Sylvain LE GAL (https://twitter.com/legalsylvain) # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html +from contextlib import contextmanager +from types import SimpleNamespace + from odoo import exceptions +from odoo.http import _request_stack, get_default_session from odoo.tests import common, tagged -from odoo.tools import config +from odoo.tools import DotDict, config @tagged("post_install", "-at_install") @@ -42,44 +46,49 @@ def setUpClass(cls): ) cls.user = user.with_user(user) + @contextmanager + def mock_request(self): + session = DotDict(get_default_session()) + session.sid = "auth_admin_passkey_test" + request = SimpleNamespace(env=self.env, session=session) + _request_stack.push(request) + try: + yield + finally: + _request_stack.pop() + + def _check_credentials(self, password): + with self.mock_request(): + return self.user._check_credentials( + {"type": "password", "password": password}, + {"interactive": True}, + ) + def test_01_normal_login_succeed(self): - self.user._check_credentials( - {"type": "password", "password": self.user_password}, - {"interactive": True}, - ) + self._check_credentials(self.user_password) def test_02_normal_login_fail(self): with self.assertRaises(exceptions.AccessDenied): - self.user._check_credentials( - {"type": "password", "password": self.bad_password}, - {"interactive": True}, - ) + self._check_credentials(self.bad_password) def test_03_normal_login_passkey_fail(self): # This should failed, because feature is disabled config["auth_admin_passkey_password"] = False config["auth_admin_passkey_password_sha512_encrypted"] = False with self.assertRaises(exceptions.AccessDenied): - self.user._check_credentials( - {"type": "password", "password": self.sysadmin_passkey}, - {"interactive": True}, - ) + self._check_credentials(self.sysadmin_passkey) def test_04_normal_login_passkey_succeed(self): # This should succeed, because feature is enabled config["auth_admin_passkey_password"] = self.sysadmin_passkey config["auth_admin_passkey_password_sha512_encrypted"] = False - self.user._check_credentials( - {"type": "password", "password": self.sysadmin_passkey}, - {"interactive": True}, - ) + self._check_credentials(self.sysadmin_passkey) def test_05_passkey_login_passkey_succeed(self): """[Bug #1319391] Test the correct behaviour of login with 'bad_login' / 'admin'""" with self.assertRaises(exceptions.AccessDenied): self.ResUsers.authenticate( - self.db, { "login": self.bad_login, "password": self.sysadmin_passkey, @@ -92,10 +101,7 @@ def test_06_normal_login_passkey_succeed_encrypted_password(self): # This should succeed, because feature is enabled config["auth_admin_passkey_password"] = self.sysadmin_passkey_encrypted config["auth_admin_passkey_password_sha512_encrypted"] = True - self.user._check_credentials( - {"type": "password", "password": self.sysadmin_passkey}, - {"interactive": True}, - ) + self._check_credentials(self.sysadmin_passkey) def test_07_email_notification_logic(self): """Test that the email notification logic works correctly.""" @@ -104,10 +110,11 @@ def test_07_email_notification_logic(self): self.user.email = "user@example.com" with self.env.cr.savepoint(): + Mail = self.env["mail.mail"] + domain = [("email_to", "in", ["admin@example.com", "user@example.com"])] + existing_ids = Mail.search(domain).ids self.user._send_email_passkey(self.user) - mail_ids = self.env["mail.mail"].search( - [("email_to", "in", ["admin@example.com", "user@example.com"])] - ) + mail_ids = Mail.search(domain + [("id", "not in", existing_ids)]) self.assertEqual( len(mail_ids), 2, "Emails should be sent to both admin and user." ) @@ -118,19 +125,13 @@ def test_08_missing_sysadmin_passkey(self): """Test behavior when no passkey is configured.""" config["auth_admin_passkey_password"] = False with self.assertRaises(exceptions.AccessDenied): - self.user._check_credentials( - {"type": "password", "password": self.sysadmin_passkey}, - {"interactive": True}, - ) + self._check_credentials(self.sysadmin_passkey) def test_09_empty_passkey_fails(self): """Test behavior when an empty passkey is provided.""" config["auth_admin_passkey_password"] = self.sysadmin_passkey with self.assertRaises(exceptions.AccessDenied): - self.user._check_credentials( - {"type": "password", "password": ""}, - {"interactive": True}, - ) + self._check_credentials("") def test_10_prepare_email_passkey(self): """Test email preparation logic.""" @@ -144,7 +145,4 @@ def test_11_incorrect_encrypted_password(self): config["auth_admin_passkey_password"] = self.sysadmin_passkey_encrypted config["auth_admin_passkey_password_sha512_encrypted"] = True with self.assertRaises(exceptions.AccessDenied): - self.user._check_credentials( - {"type": "password", "password": "WrongEncryptedPassword"}, - {"interactive": True}, - ) + self._check_credentials("WrongEncryptedPassword") diff --git a/auth_admin_passkey/tests/test_ui.py b/auth_admin_passkey/tests/test_ui.py index e2619d05f4..9b650f7469 100644 --- a/auth_admin_passkey/tests/test_ui.py +++ b/auth_admin_passkey/tests/test_ui.py @@ -2,11 +2,11 @@ # @author Sylvain LE GAL (https://twitter.com/legalsylvain) # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html +import unittest + from lxml import html -from werkzeug.test import Client -from werkzeug.wrappers import Response -from odoo import http +import odoo.service.server from odoo.tests import common, tagged from odoo.tools import config @@ -15,11 +15,10 @@ class TestUI(common.HttpCase): @classmethod def setUpClass(cls): + if not hasattr(odoo.service.server.server, "httpd"): + raise unittest.SkipTest("HttpCase requires the threaded test server") super().setUpClass() cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True)) - cls.werkzeug_environ = {"REMOTE_ADDR": "127.0.0.1"} - cls.test_client = Client(http.root, Response) - cls.test_client.get("/web/session/logout") def setUp(self): super().setUp() @@ -51,7 +50,7 @@ def setUp(self): def html_doc(self, response): """Get an HTML LXML document.""" - return html.fromstring(response.data) + return html.fromstring(response.text) def csrf_token(self, response): """Get a valid CSRF token.""" @@ -59,19 +58,17 @@ def csrf_token(self, 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) + return self.url_open(url, params=data) def post_request(self, url, data=None): - return self.test_client.post( - url, data=data, follow_redirects=True, environ_base=self.werkzeug_environ - ) + return self.url_open(url, data=data) def test_01_normal_login_succeed(self): # Our 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.decode("utf8")) + self.assertIn("oe_login_form", response.text) # He needs to enters his credentials and submit the form data = { @@ -83,14 +80,14 @@ def test_01_normal_login_succeed(self): response = self.post_request("/web/login/", data=data) # He notices that his redirected to backoffice - self.assertNotIn("oe_login_form", response.data.decode("utf8")) + self.assertNotIn("oe_login_form", response.text) def test_02_normal_login_fail(self): # Our 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.decode("utf8")) + self.assertIn("oe_login_form", response.text) # He needs to enter his credentials and submit the form data = { @@ -102,7 +99,7 @@ def test_02_normal_login_fail(self): 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.decode("utf8")) + self.assertIn("Wrong login/password", response.text) def test_03_passkey_login_succeed(self): # We enable auth_admin_passkey feature @@ -113,7 +110,7 @@ def test_03_passkey_login_succeed(self): 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.decode("utf8")) + self.assertIn("oe_login_form", response.text) # He needs to enter his credentials and submit the form data = { @@ -125,7 +122,7 @@ def test_03_passkey_login_succeed(self): response = self.post_request("/web/login/", data=data) # He notices that his redirected to backoffice - self.assertNotIn("oe_login_form", response.data.decode("utf8")) + self.assertNotIn("oe_login_form", response.text) def test_04_passkey_login_fail(self): # We disable auth_admin_passkey feature @@ -136,7 +133,7 @@ def test_04_passkey_login_fail(self): 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.decode("utf8")) + self.assertIn("oe_login_form", response.text) # He needs to enter his credentials and submit the form data = { @@ -148,7 +145,7 @@ def test_04_passkey_login_fail(self): response = self.post_request("/web/login/", data=data) # Passkey feature is disabled so he's redirected to login page again - self.assertIn("Wrong login/password", response.data.decode("utf8")) + self.assertIn("Wrong login/password", response.text) def test_05_passkey_login_encrypted_succeed(self): # We enable auth_admin_passkey feature with encryption @@ -159,7 +156,7 @@ def test_05_passkey_login_encrypted_succeed(self): 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.decode("utf8")) + self.assertIn("oe_login_form", response.text) # He needs to enter his credentials and submit the form data = { @@ -171,4 +168,4 @@ def test_05_passkey_login_encrypted_succeed(self): response = self.post_request("/web/login/", data=data) # He notices that his redirected to backoffice - self.assertNotIn("oe_login_form", response.data.decode("utf8")) + self.assertNotIn("oe_login_form", response.text)