Automatic login based on the IP address

Author Message

Xavier Dutoit

Monday 04 September 2006 9:13:41 am

Hi,

I'd like to be able to automatically log in anyone with a specific IP address (or belonging to a specific ip range). For instance, everyone connecting with 192.168.*.* would be the user staff instead of being anonymous.

I suppose than writing a LoginHandler (as done for the cookieuser extension) would do it, wouldn't it ?

Has it be done already ? Would it be useful for some of you ?

X+

http://www.sydesy.com

Clemens T

Monday 04 September 2006 9:43:54 am

I'd say: don't do it. Because you could get reaal security problems when you try something like this.
Greets,
Clemens
ps: sorry for the brief comment, gtg.

Xavier Dutoit

Monday 04 September 2006 10:12:51 am

Hi,

Could you elaborate ?

I think I should inspire myself more on the sso instead of the cookieuser:
http://ez.no/community/forum/developer/setting_user_role_based_on_ip_address

http://www.sydesy.com

Clemens T

Monday 04 September 2006 3:51:01 pm

Sure Xavier!

For example: http://www.inetprivacy.com/a4proxy/fake-ip-address.htm

Good luck!
Clemens

Xavier Dutoit

Tuesday 05 September 2006 2:40:14 am

Hi,

The $_SERVER['REMOTE_HOST'] is going to contain the ip of the proxy, isn't it ?

That was the variable I intended to test for my purpose, and if one of the admin put the IP address of a public proxy, then that's not my problem.

In other word, if ou put the IP address of the gateway of a company and say that's the user "partner", every pc connected via that gateway is going to been see as a partner, and that's what I want.

Does it make sense ?
X+

http://www.sydesy.com

Clemens T

Tuesday 05 September 2006 4:22:28 am

Yes, that makes sense. And I think you should write your own LoginHandler, yes. For someone with your experience this shouldn't be too hard ;).

Grtz

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 01:15:15
Script start
Timing: Jan 31 2025 01:15:15
Module start 'layout'
Timing: Jan 31 2025 01:15:15
Module start 'content'
Timing: Jan 31 2025 01:15:15
Module end 'content'
Timing: Jan 31 2025 01:15:15
Script end

Main resources:

Total runtime0.0256 sec
Peak memory usage8,192.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 588.2500151.2266
Module start 'layout' 0.00560.0042 739.4766220.7188
Module start 'content' 0.00990.0142 960.19531,001.8047
Module end 'content' 0.02410.0014 1,962.000037.9922
Script end 0.0255  1,999.9922 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002811.0509140.0002
Check MTime0.00114.3364140.0001
Mysql Total
Database connection0.00114.149910.0011
Mysqli_queries0.00238.964830.0008
Looping result0.00000.055010.0000
Template Total0.00114.110.0011
Template load0.00083.230410.0008
Template processing0.00020.899910.0002
Override
Cache load0.00062.256810.0006
General
dbfile0.00155.682180.0002
String conversion0.00000.040140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs