BUGFIX: adds more flexible LDAP-configuration

Please report bugs here!

Moderator: Thorsten

Post Reply
derLars
Posts: 13
Joined: Tue Aug 04, 2009 3:25 pm

BUGFIX: adds more flexible LDAP-configuration

Post by derLars » Wed Aug 05, 2009 2:08 pm

well, my previous post is in nirvana, so here we go again. ;)

I am currently working on getting PMF in my company and we wanted a tight integration with our Active Directory. In order to do so, I had to make some changes. The attached patch works against the current 2.5.0-stable release and does the following:

Code: Select all

* FIX: blank screen, if LDAP-server is unreachable
* adds support for LDAP-datamapping, e.g. against an ADS. --> see inc/dataldap.php
* adds support for multi-domain-authentication, e.g. against an ADS-Global Catalog (users may login with "DOMAIN\username"). --> see inc/dataldap.php
* adds support for php-ldap-options, e.g. for ldap-protocol or referral-handling. see inc/dataldap.php
The patch will override your current configuration, so ONLY USE AGAINST AN UNPACKED fresh package without having run the installer.
No interfaces have been made incompatible with the 2.5.0-release, however I had to add an optional field in the Auth-handler to allow the multi-domain-feature.

Please provide feedback, if the patch works in your configuration.

Regards,
Lars
You do not have the required permissions to view the files attached to this post.

Thorsten
Posts: 14769
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: BUGFIX: adds more flexible LDAP-configuration

Post by Thorsten » Wed Aug 05, 2009 2:31 pm

Hi Lars,

thank you very much!!!

I'll check your patch!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

Thorsten
Posts: 14769
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: BUGFIX: adds more flexible LDAP-configuration

Post by Thorsten » Wed Aug 05, 2009 8:07 pm

Hi,
derLars wrote:No interfaces have been made incompatible with the 2.5.0-release, however I had to add an optional field in the Auth-handler to allow the multi-domain-feature.
I added your patch to phpMyFAQ 2.5.1 and 2.6.0-alpha. I have to fix some issues because you broke the AuthDriver interface but no problems with that.

One thing is missing:
I have to extend the install script so that the options can be added easily.

My plan for phpMyFAQ 2.6.0 is to move some things from dataldap.php to the configuration table.

Please check the stable snapshot tomorrow if everything is still working.

Thanks a lot for your work!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

Thorsten
Posts: 14769
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: BUGFIX: adds more flexible LDAP-configuration

Post by Thorsten » Wed Aug 05, 2009 8:54 pm

Hi,

I moved the special LDAP configuration to the file constants_ldap.php in the folder inc/. I also added some more LDAP information in our documentation.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

derLars
Posts: 13
Joined: Tue Aug 04, 2009 3:25 pm

Re: BUGFIX: adds more flexible LDAP-configuration

Post by derLars » Thu Aug 06, 2009 12:12 pm

right, I forgot to add that file while preparing the directory for the patch - sorry.

I would prefer if we would keep the config together somehow. Right now there are four places for configurations, which do not have a speaking name. And while the database-based configuration is nice for moving the installation somewhere else, I would prefer a seperate config-folder instead of the inc/...-configuration files. Further enhancements would then have an easier configuration, since they could provide their own configuration file (e.g. for a PMF_Auth_Radius there would be a config/radius.php, for the PMF_Auth_Ldap there would be a config/ldap.php). Non-basic-configuration could still be in the database if you think that this has more advantages over the loss of usability.

What do you think?

Regards,
Lars

Thorsten
Posts: 14769
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: BUGFIX: adds more flexible LDAP-configuration

Post by Thorsten » Thu Aug 06, 2009 12:16 pm

Hi,

yes, but this is something for version 2.6 and not 2.5.x. :-)

My idea would a complete refactoring of the configuration stuff for version 2.6 and moving all configuration related files to a new folder, e.g. "config".

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

derLars
Posts: 13
Joined: Tue Aug 04, 2009 3:25 pm

Re: BUGFIX: adds more flexible LDAP-configuration

Post by derLars » Thu Aug 06, 2009 12:49 pm

I totally dig that proposal. :mrgreen:

On another question: could you tell me what you do not like about Smarty?

Thorsten
Posts: 14769
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: BUGFIX: adds more flexible LDAP-configuration

Post by Thorsten » Thu Aug 06, 2009 1:04 pm

Hi,
derLars wrote:On another question: could you tell me what you do not like about Smarty?
I don't like logic in a template engine.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

derLars
Posts: 13
Joined: Tue Aug 04, 2009 3:25 pm

Re: BUGFIX: adds more flexible LDAP-configuration

Post by derLars » Thu Aug 06, 2009 1:11 pm

well, but following an MVC-pattern, the displaylogic should be in the view-module, while the data from the controllers is in raw-format. This really allows much higher flexibility, e.g. how many new articles should be shown in the sidebar (which should only concern the view-module). Most templates in wordpress e.g. would not be possible without some logic in the view.

How about a tradeoff: we work towards a greater modularization (which you wanted to do anyways as you said in an earlier post), thus allowing the use of different view-engines. The default remains the current module, but those who want more flexibility may use another engine. How about that?

Thorsten
Posts: 14769
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: BUGFIX: adds more flexible LDAP-configuration

Post by Thorsten » Thu Aug 06, 2009 1:30 pm

Hi,

my goal is to move phpMyFAQ towards to a MVC design pattern. The current state is because of the age of phpMyFAQ which was started in 2001 as a PHP 3 application. Every major release is also a refactored version with new features and new architecture improvements. But it's a long way. :-)

For example the goals for 2.6 are the migration to UTF-8 and more refactoring and even more object orientation.

Help is always welcome! You can also write me an email or contact me via Skype.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

derLars
Posts: 13
Joined: Tue Aug 04, 2009 3:25 pm

Re: BUGFIX: adds more flexible LDAP-configuration

Post by derLars » Thu Aug 06, 2009 2:38 pm

hmm, alright... How is your opinion about using frameworks like the Zend Framework as a far goal? I've been developing with ZF for two years now and am always surprised over the speed of development and the minimal performance loss.

Thorsten
Posts: 14769
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: BUGFIX: adds more flexible LDAP-configuration

Post by Thorsten » Thu Aug 06, 2009 2:45 pm

Hi,

I'm working for the biggest PHP company in Germany. We're also working with ZF for 3 years now.

Sure, it would be possible to implement something like phpMyFAQ upon a existing framework like ZF but it would take too long and I'm doing phpMyFAQ in my spare time for fun.

I know that I re-invent the wheel for many times with phpMyFAQ but it's okay for me. :-)

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

Post Reply