Setting user role based on IP address

Author Message

Newbie Girl

Wednesday 26 April 2006 1:48:00 am

I have obtained my users IP address in the "pagelayout.tpl", and based on the IP address I should tell EZ that the user is of a special user group so that the user is automatically logged in and do not have to log in manually. Do anyone have any suggestions on how to tell eZ that my user is of a special user group so that he/she automatically is logged in?

I would be very glad to here some suggestions (newbie in this game...:) )

Kristof Coomans

Wednesday 26 April 2006 3:51:41 am

With the Single Sign On handler plugin system this could be easily accomplished.
It will be included in eZ publish 3.8 ( http://pubsvn.ez.no/nextgen/trunk/doc/features/3.8/single_sign_on_handler.txt )

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Newbie Girl

Wednesday 26 April 2006 4:19:30 am

Thank you very much for answering me!

Unfortunately, I have to program this on eZ 3.7.2 on a project going on right now, so I have to figure out a different way to do this. Would be very glad to here more on alternative solutions :)

I am thinking on writing a Javascript in my "Pagelayout.tpl" that automatically sends in username/password, but I am not really confident if this is right solution.

Kristof Coomans

Wednesday 26 April 2006 4:46:57 am

You could try to backport the Single Sign On plugin system to eZ 3.7 ;-) It was committed on the trunk in SVN rev. 15462, and you only have to modify one kernel file, so I guess it's the most ez way.

Good luck!

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Łukasz Serwatka

Wednesday 26 April 2006 5:45:56 am

I can confirm that SSO works with 3.7 after applying the patch. You can generate patch by running

svn diff -r 15461:15462

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Newbie Girl

Tuesday 02 May 2006 12:10:16 am

Thank you both very much for answering me! :)

Siniša Šehović

Wednesday 10 May 2006 9:00:18 am

Hi Lukasz

I don't se SSO handlers on trunck?

How can I get it?

S.

---
If at first you don't succeed, look in the trash for the instructions.

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 19 2025 06:30:08
Script start
Timing: Jan 19 2025 06:30:08
Module start 'layout'
Timing: Jan 19 2025 06:30:08
Module start 'content'
Timing: Jan 19 2025 06:30:10
Module end 'content'
Timing: Jan 19 2025 06:30:10
Script end

Main resources:

Total runtime1.2475 sec
Peak memory usage4,096.0000 KB
Database Queries73

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0086 589.2578152.6250
Module start 'layout' 0.00860.0039 741.882839.4453
Module start 'content' 0.01251.2335 781.3281662.2344
Module end 'content' 1.24600.0015 1,443.562516.1563
Script end 1.2474  1,459.7188 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00440.3536160.0003
Check MTime0.00160.1317160.0001
Mysql Total
Database connection0.00100.079410.0010
Mysqli_queries1.176894.3341730.0161
Looping result0.00090.0712710.0000
Template Total1.204096.520.6020
Template load0.00290.228620.0014
Template processing1.201296.286520.6006
Template load and register function0.00020.017610.0002
states
state_id_array0.00160.129810.0016
state_identifier_array0.00190.149420.0009
Override
Cache load0.00280.2241290.0001
Sytem overhead
Fetch class attribute can translate value0.00100.077940.0002
Fetch class attribute name0.00160.1253100.0002
XML
Image XML parsing0.00200.159940.0005
class_abstraction
Instantiating content class attribute0.00000.0028110.0000
General
dbfile0.00130.1045290.0000
String conversion0.00000.000840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs