Forums / Install & configuration / LDAP - Prevent user creation

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

eZ debug

Timing: Jan 31 2025 01:16:14
Script start
Timing: Jan 31 2025 01:16:14
Module start 'content'
Timing: Jan 31 2025 01:16:14
Module end 'content'
Timing: Jan 31 2025 01:16:14
Script end

Main resources:

Total runtime0.1967 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.0062 589.1641370.2891
Module start 'content' 0.00620.0138 959.45311,005.6719
Module end 'content' 0.02000.1766 1,965.12503,893.8438
Script end 0.1966  5,858.9688 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00462.3414200.0002
Check MTime0.00140.6981200.0001
Mysql Total
Database connection0.00060.327010.0006
Mysqli_queries0.099350.48591410.0007
Looping result0.00140.69451390.0000
Template Total0.176189.510.1761
Template load0.00080.406710.0008
Template processing0.175289.110310.1752
Override
Cache load0.00060.280210.0006
Sytem overhead
Fetch class attribute can translate value0.00180.894510.0018
XML
Image XML parsing0.00040.194710.0004
General
dbfile0.00723.6744200.0004
String conversion0.00000.002530.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