Forums / Developer / Automatic login based on the IP address

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

eZ debug

Timing: Jan 30 2025 21:39:07
Script start
Timing: Jan 30 2025 21:39:07
Module start 'content'
Timing: Jan 30 2025 21:39:07
Module end 'content'
Timing: Jan 30 2025 21:39:08
Script end

Main resources:

Total runtime0.2246 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0084 588.0469370.2891
Module start 'content' 0.00840.0137 958.33591,005.5469
Module end 'content' 0.02210.2024 1,963.88283,893.7422
Script end 0.2245  5,857.6250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00492.1601200.0002
Check MTime0.00150.6662200.0001
Mysql Total
Database connection0.00070.319710.0007
Mysqli_queries0.124055.24251410.0009
Looping result0.00150.67841390.0000
Template Total0.201989.910.2019
Template load0.00070.333110.0007
Template processing0.201289.582410.2012
Override
Cache load0.00050.241310.0005
Sytem overhead
Fetch class attribute can translate value0.00190.839410.0019
XML
Image XML parsing0.00030.126010.0003
General
dbfile0.00763.3729200.0004
String conversion0.00000.003130.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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