LDAP - Prevent user creation

Author Message

Fernando Palma

Tuesday 11 March 2008 3:38:26 am

Hi there.

I'm setting up a web site with LDAP autentication, that works great for me.

My problem is that I don't won't users to be created when they do the autentication, I only wont them that the username/password be validated by the LDAP server.

I have allready created a script that imports all users I wont to EZ in the LDAP group.

Is there any config setting to disable LDAP user creation or do I have do "go down to the code" and make the changes I wont?

best regards.

../fpalma

André R.

Tuesday 11 March 2008 6:09:32 am

Seems like you need to fork the ldap login handler into you own login handler to be able to do that. Since the ldap login handler authorizes the user against the eZ Publish user after you login (on each request after user is logged in).

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Fernando Palma

Tuesday 11 March 2008 8:22:47 am

Thanks André.

I have solved the problem by hacking the ezldapuser.

I was "on the search" for a cleaner solution.

Any way, can any one explain to me how to do a clean "fork" for this, like creating my own auth method like an extension and activate it like the ldap one?

Best regards.

../fpalma

André R.

Tuesday 11 March 2008 9:39:09 am

Sure, it is actually very simple.

Structure:

extension
- <extension_name>
-- login_handler
--- ez<login_handler_name>user.php
-- settings
--- site.ini

Site.ini:

[UserSettings]
ExtensionDirectory[]=<extension_name>

#used login handlers, comment out standard if you don't want it as fall back
LoginHandler[]
LoginHandler[]=<login_handler_name>
LoginHandler[]=standard

Then you activate the extension, in admin or in settings/override/site.ini*
(Might want to place the login handler specific ldap.ini settings inside the extension settings folder also!)

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Fernando Palma

Tuesday 11 March 2008 10:48:06 am

Thanks,

I will try that, then I will give you the feed-back.

Best regards.

../fpalma

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 08:18:50
Script start
Timing: Jan 31 2025 08:18:50
Module start 'layout'
Timing: Jan 31 2025 08:18:50
Module start 'content'
Timing: Jan 31 2025 08:18:51
Module end 'content'
Timing: Jan 31 2025 08:18:51
Script end

Main resources:

Total runtime1.1327 sec
Peak memory usage4,096.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 588.2500151.2266
Module start 'layout' 0.00610.0029 739.476636.6641
Module start 'content' 0.00901.1229 776.1406954.7813
Module end 'content' 1.13190.0008 1,730.921915.8516
Script end 1.1327  1,746.7734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2926160.0002
Check MTime0.00140.1263160.0001
Mysql Total
Database connection0.00070.063310.0007
Mysqli_queries1.074694.8661630.0171
Looping result0.00050.0461610.0000
Template Total1.088296.120.5441
Template load0.00220.197320.0011
Template processing1.086095.873020.5430
Template load and register function0.00160.143410.0016
states
state_id_array0.00240.211410.0024
state_identifier_array0.00240.211020.0012
Override
Cache load0.00190.1647310.0001
Sytem overhead
Fetch class attribute can translate value0.00050.047220.0003
Fetch class attribute name0.00250.221760.0004
XML
Image XML parsing0.00050.044820.0003
class_abstraction
Instantiating content class attribute0.00000.001670.0000
General
dbfile0.00090.0763170.0001
String conversion0.00000.000640.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
5content/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
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.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: 19
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs