Forums / Developer / Setting user role based on IP address

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.

eZ debug

Timing: Jan 19 2025 03:27:34
Script start
Timing: Jan 19 2025 03:27:34
Module start 'content'
Timing: Jan 19 2025 03:27:35
Module end 'content'
Timing: Jan 19 2025 03:27:35
Script end

Main resources:

Total runtime1.4258 sec
Peak memory usage4,096.0000 KB
Database Queries210

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0087 588.9766180.8281
Module start 'content' 0.00871.2970 769.8047667.3125
Module end 'content' 1.30580.1200 1,437.1172341.0547
Script end 1.4258  1,778.1719 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.2979210.0002
Check MTime0.00150.1057210.0001
Mysql Total
Database connection0.00110.075110.0011
Mysqli_queries1.342594.15472100.0064
Looping result0.00210.15052080.0000
Template Total1.377196.620.6885
Template load0.00260.184220.0013
Template processing1.374496.395920.6872
Template load and register function0.00020.014510.0002
states
state_id_array0.00300.207210.0030
state_identifier_array0.00130.089320.0006
Override
Cache load0.00190.1343290.0001
Sytem overhead
Fetch class attribute can translate value0.00120.082150.0002
Fetch class attribute name0.00120.0837100.0001
XML
Image XML parsing0.00190.131050.0004
class_abstraction
Instantiating content class attribute0.00000.0014110.0000
General
dbfile0.00690.4844400.0002
String conversion0.00000.000730.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
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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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