[Patch] Fixes for IdentityProvider and LDAP

Reklov

Joined: 2012-04-08
Posts: 3
Posted: Sun, 2012-04-08 14:44

Hi there,

after some hours trying to figure out a way to make Gallery3 and module LDAP work with the given LDAP server, I came up with the two patches attached:

gallery3-0001-IdentityProvider-and-user-Some-fixes.patch.gz
-----------------------------------------------------------
IdentityProvider and user: Some fixes

* check for $new_provider::admin_user() before sending the event
* if uninstalling $new_provider failed, log error but still try to
install $current_provider again
* changed user_installer::install() to activate() so that user can be
enabled again after failing the first time

ldap-0001-ldap-Several-fixes-and-improvements.patch.gz
------------------------------------------------------
ldap: Several fixes and improvements

* changed ldap_installer::install() to activate() so that ldap can be
enabled again after failing the first time
* if some information is not available from ldap server return
"better" values (e.g. no group instead of group = NULL)
* added function Ldap_User::loaded() which is called by user profile
* added configurable admin email address if not given by server
* make ldap work when there is no group management on ldap server
(create local groups for everybody and registered_users) and allow
guest user to be managed by server (configurable guest name)
* require everybody_group and registered_users_group to be in groups

The changes regarding renaming install() to activate() could be superfluous with the other fixes since there should not go anything wrong during install and uninstall. However, they do no harm and are really practical if something does go wrong.

Hope you can make some use of those (I diffed against current git checkouts).

Cheers,
Reklov

AttachmentSize
gallery3-0001-IdentityProvider-and-user-Some-fixes.patch_.gz1.05 KB
ldap-0001-ldap-Several-fixes-and-improvements.patch_.gz2.98 KB
 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25959
Posted: Mon, 2012-04-09 04:08

Thanks for that. I think there is a LDAP ticket or two in the tracker.
http://sourceforge.net/apps/trac/gallery/
best create a ticket ( none exists ) and attach your patches so it does not get lost in the forums.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Reklov

Joined: 2012-04-08
Posts: 3
Posted: Sat, 2012-04-14 13:39

A bit delayed, but the ticket is created: https://sourceforge.net/apps/trac/gallery/ticket/1834

 
kokihi

Joined: 2012-06-14
Posts: 1
Posted: Thu, 2012-06-14 02:35

Hi,
I tried to download and install those two patch files.
However, I got the following error:

[root@test]# patch p0 < ldap-0001-ldap-Several-fixes-and-improvements.patch
patch unexpectedly ends in middle of line
patch: **** Only garbage was found in the patch input.

I wondered if there is another way to install patch files.

 
Reklov

Joined: 2012-04-08
Posts: 3
Posted: Fri, 2012-06-15 15:23

Hi,

try this command:

patch -p0 < ldap-0001-ldap-Several-fixes-and-improvements.patch

If this doesn't work, be sure that the patchfile is not zipped (ending on .gz); in this case use gunzip to unpack.

Cheers,
Reklov