Community mailing list archives

community@mail.odoo.com

Re: Restrict access base IP address

by
piyush.suva87
- 07/17/2015 10:35:54
Hello, 

For User Ip Address You can use : 
    from openerp.http import request
   
     request.httprequest.environ['REMOTE_ADDR']

for that you can use inheriting below Method from 
   
from openerp.service import common,security

def exp_login(db, login, password):
    # TODO: legacy indirection through 'security', should use directly
    # the res.users model
    res = security.login(db, login, password)
    msg = res and 'successful login' or 'bad login or password'
    _logger.info("%s from '%s' using database '%s'", msg, login, db.lower())
    return res or False

On Fri, Jul 17, 2015 at 7:31 PM, suva piyush <piyush.suva87@gmail.com> wrote:
Hello, 

For User Ip Address You can use : 
    from openerp.http import request
   
     request.httprequest.environ['REMOTE_ADDR']

for that you can use inheriting below Method from 
   
from openerp.service import common,security

def exp_login(db, login, password):
    # TODO: legacy indirection through 'security', should use directly
    # the res.users model
    res = security.login(db, login, password)
    msg = res and 'successful login' or 'bad login or password'
    _logger.info("%s from '%s' using database '%s'", msg, login, db.lower())
    return res or False

     
            



On Fri, Jul 17, 2015 at 7:19 PM, Nuria Arranz Velazquez <nuria@opusvl.com> wrote:
Thank you!

On 17/07/15 12:57, Houssine BAKKALI wrote:
<blockquote cite="mid:CANNbhR_K0=V5cZ8onaE519UyZ2em_5NAW5pD3-R+S4i72PBFOw@mail.gmail.com" type="cite">
it should works on 7.0 and 8.0

2015-07-17 13:55 GMT+02:00 Houssine BAKKALI <houssine.bakkali@gmail.com>:

2015-07-17 13:22 GMT+02:00 Nuria Arranz Velazquez <nuria@opusvl.com>:
Hi,

Sorry can you send a link to the repository on github? I couldn't see it.

Thanks,
Nuria

On 15/07/15 09:42, PraVeeN KuMaR YaDaV wrote:
<blockquote cite="mid:CADmt=V+WB0__tq0-BjndhK3XAYzb3onngFM=AmFitKzqk9_Kjw@mail.gmail.com" type="cite">
Hello Kwaye,
There is a Module available on launchpad name- "network_audit". for tacking user login details including IP.


On Wed, Jul 15, 2015 at 1:57 PM, kwaye kant <gabrielkwaye@gmail.com> wrote:
Dear all,

My company has many offices in the town. All the offices are connected to the head office through  a VPN. And each office has a public IP address. Odoo is installed on the central server at the Head office.

Well,
I need the users to connect on Odoo ONLY from their office.
If I send one user to Office1 that user should connect only at that office with the IP address not at the Office2.

So what I need to set the connection process in Odoo. All the office should have an IP address set the database.
On each connection Odoo must get the IP address of the current user and check if that IP address is the one associated to this Office.

So on Odoo,
1. How can I get the user IP address ?
2. How is the login process works ? 

Were should I start to handle this ?

I need a guide

--
------------------------------------------------------------------------------------------------------------------------------------------------
Kwaye Kant

Skype: g.kwaye
(00) 237 677315145
Douala - Cameroon

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe




--
With Regards,
PRAVEEN KUMAR,
Mob.-9911231213,9897095777
           praveenky@ymail.com

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe



-- 
N. Arranz-Velazquez
OpusVL Odoo Specialist Team (OOST)
Product Owner

OpusVL
Drury House
Drury Lane
Rugby
CV21 3DE

T: 01788 298 450
W: www.opusvl.com

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe



_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe



-- 
N. Arranz-Velazquez
OpusVL Odoo Specialist Team (OOST)
Product Owner

OpusVL
Drury House
Drury Lane
Rugby
CV21 3DE

T: 01788 298 450
W: www.opusvl.com

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe




--
Regards,
Piyush Suva
Erp consultant



--
Regards,
Piyush Suva
Erp consultant
Mo. +91 94277 21188