Browse Source

Commit concerns:

- Add AGPL-3 badge on README.rst
  - Insert Bug tracker informations in README.rst
  - Import from same package on same line
  - Use CamelCase for class names
pull/133/head
Cédric Pigeon 10 years ago
parent
commit
0691c25d8c
  1. 11
      inactive_session_timeout/README.rst
  2. 2
      inactive_session_timeout/__openerp__.py
  3. 8
      inactive_session_timeout/models/ir_config_parameter.py
  4. 4
      inactive_session_timeout/models/res_users.py

11
inactive_session_timeout/README.rst

@ -1,3 +1,6 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License: AGPL-3
Inactive Sessions Timeout
=========================
@ -13,6 +16,14 @@ Two system parameters are available:
* inactive_session_time_out_delay: validity of a session in seconds (default = 2 Hours)
* inactive_session_time_out_ignored_url: technical urls where the check does not occur
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/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
`here <https://github.com/OCA/server-tools/issues/new?body=module:%20inactive_session_timeout%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Credits
=======

2
inactive_session_timeout/__openerp__.py

@ -27,7 +27,7 @@
'summary': """
This module disable all inactive sessions since a given delay""",
'author': "ACSONE SA/NV",
'author': "ACSONE SA/NV", "Odoo Community Association (OCA)"
'website': "http://acsone.eu",
'category': 'Tools',

8
inactive_session_timeout/models/ir_config_parameter.py

@ -21,16 +21,14 @@
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models, api
from openerp import models, api, tools, SUPERUSER_ID
from openerp import tools
from openerp import SUPERUSER_ID
DELAY_KEY = 'inactive_session_time_out_delay'
IGNORED_PATH_KEY = 'inactive_session_time_out_ignored_url'
class ir_config_parameter(models.Model):
class IrConfigParameter(models.Model):
_inherit = 'ir.config_parameter'
@tools.ormcache(skiparg=0)
@ -50,7 +48,7 @@ class ir_config_parameter(models.Model):
@api.multi
def write(self, vals, context=None):
res = super(ir_config_parameter, self).write(vals)
res = super(IrConfigParameter, self).write(vals)
if self.key in [DELAY_KEY, IGNORED_PATH_KEY]:
self.get_session_parameters.clear_cache(self)
return res

4
inactive_session_timeout/models/res_users.py

@ -32,7 +32,7 @@ from os.path import getmtime
from time import time
class res_users(models.Model):
class ResUsers(models.Model):
_inherit = 'res.users'
def _check_session_validity(self, db, uid, passwd):
@ -57,6 +57,6 @@ class res_users(models.Model):
return
def check(self, db, uid, passwd):
res = super(res_users, self).check(db, uid, passwd)
res = super(ResUsers, self).check(db, uid, passwd)
self._check_session_validity(db, uid, passwd)
return res
Loading…
Cancel
Save