diff --git a/login_user_detail/README.rst b/login_user_detail/README.rst new file mode 100644 index 000000000..a7b12abd3 --- /dev/null +++ b/login_user_detail/README.rst @@ -0,0 +1,20 @@ +User Log Details v11 +==================== + +This module developed to record login details of user. + +Installation +============ + +Just select it from available modules to install it, there is no need to extra installations. + +Configuration +============= + +Nothing to configure. + +Credits +======= + +Developer: Saritha @ cybrosys + diff --git a/login_user_detail/README.rst~ b/login_user_detail/README.rst~ new file mode 100644 index 000000000..255a11d62 --- /dev/null +++ b/login_user_detail/README.rst~ @@ -0,0 +1,20 @@ +User Log Details v10 +==================== + +This module developed to record login details of user. + +Installation +============ + +Just select it from available modules to install it, there is no need to extra installations. + +Configuration +============= + +Nothing to configure. + +Credits +======= + +Developer: Saritha @ cybrosys + diff --git a/login_user_detail/__init__.py b/login_user_detail/__init__.py new file mode 100644 index 000000000..ff4fe0928 --- /dev/null +++ b/login_user_detail/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2016-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from . import models diff --git a/login_user_detail/__manifest__.py b/login_user_detail/__manifest__.py new file mode 100644 index 000000000..17e2cb686 --- /dev/null +++ b/login_user_detail/__manifest__.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2016-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +{ + 'name': "User Log Details", + 'version': '11.0.1.0.0', + 'summary': """Login User Details & IP Address""", + 'description': """This module records login information of user""", + 'author': "Cybrosys Techno Solutions ", + 'company': "Cybrosys Techno Solutions ", + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'category': 'Tools', + 'depends': ['base'], + 'license': 'AGPL-3', + 'data': ['views/login_user_views.xml'], + 'demo': [], + 'images': ['static/description/banner.png'], + 'installable': True, + 'auto_install': False, +} diff --git a/login_user_detail/__manifest__.py~ b/login_user_detail/__manifest__.py~ new file mode 100644 index 000000000..741e9cc25 --- /dev/null +++ b/login_user_detail/__manifest__.py~ @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2016-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +{ + 'name': "User Log Details", + 'version': '10.0.2.0.0', + 'summary': """Login User Details & IP Address""", + 'description': """This module records login information of user""", + 'author': "Cybrosys Techno Solutions ", + 'company': "Cybrosys Techno Solutions ", + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'category': 'Tools', + 'depends': ['base'], + 'license': 'AGPL-3', + 'data': ['views/login_user_views.xml'], + 'demo': [], + 'images': ['static/description/banner.png'], + 'installable': True, + 'auto_install': False, +} diff --git a/login_user_detail/models/__init__.py b/login_user_detail/models/__init__.py new file mode 100644 index 000000000..6305c1607 --- /dev/null +++ b/login_user_detail/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2016-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from . import login_user_details diff --git a/login_user_detail/models/login_user_details.py b/login_user_detail/models/login_user_details.py new file mode 100644 index 000000000..809f1cf81 --- /dev/null +++ b/login_user_detail/models/login_user_details.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2016-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +import logging +from itertools import chain +from datetime import datetime +from odoo.http import request +from odoo import models, fields, api + +_logger = logging.getLogger(__name__) +USER_PRIVATE_FIELDS = ['password'] +concat = chain.from_iterable + + +class LoginUserDetail(models.Model): + _inherit = 'res.users' + + @api.model + def check_credentials(self, password): + result = super(LoginUserDetail, self).check_credentials(password) + ip_address = request.httprequest.environ['REMOTE_ADDR'] + vals = {'name': self.name, + 'ip_address': ip_address + } + self.env['login.detail'].sudo().create(vals) + return result + + +class LoginUpdate(models.Model): + _name = 'login.detail' + + name = fields.Char(string="User Name") + date_time = fields.Datetime(string="Login Date And Time", default=lambda self: fields.datetime.now()) + ip_address = fields.Char(string="IP Address") + diff --git a/login_user_detail/static/description/banner.png b/login_user_detail/static/description/banner.png new file mode 100644 index 000000000..65f71eaa3 Binary files /dev/null and b/login_user_detail/static/description/banner.png differ diff --git a/login_user_detail/static/description/cybro_logo.png b/login_user_detail/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/login_user_detail/static/description/cybro_logo.png differ diff --git a/login_user_detail/static/description/icon.png b/login_user_detail/static/description/icon.png new file mode 100644 index 000000000..724a2717f Binary files /dev/null and b/login_user_detail/static/description/icon.png differ diff --git a/login_user_detail/static/description/index.html b/login_user_detail/static/description/index.html new file mode 100644 index 000000000..6e51e730c --- /dev/null +++ b/login_user_detail/static/description/index.html @@ -0,0 +1,59 @@ +
+
+

User Log Details

+

Records User Log Details

+

Cybrosys Technologies

+
+
+ +
+
+
+

Overview

+

+ User Log Details, Record login date,IP Address of login user. +

+
+
+
+ +
+
+

Login Details

+
+
+ +
+
+
+
+ +
+

Need Any Help?

+ +
+ + + + diff --git a/login_user_detail/static/description/login.png b/login_user_detail/static/description/login.png new file mode 100644 index 000000000..99dd178f1 Binary files /dev/null and b/login_user_detail/static/description/login.png differ diff --git a/login_user_detail/views/login_user_views.xml b/login_user_detail/views/login_user_views.xml new file mode 100644 index 000000000..1b49d4f1c --- /dev/null +++ b/login_user_detail/views/login_user_views.xml @@ -0,0 +1,42 @@ + + + + + Login User Details + login.detail + +
+ + + + + + + +
+
+
+ + + Login User Details + login.detail + + + + + + + + + + + Login User Details + login.detail + tree,form + + + + +
+
\ No newline at end of file