Skip to content

add option zimbra in ldap app - #4567

Closed
johuder33 wants to merge 1 commit into
nextcloud:masterfrom
johuder33:add-ability-zimbra-ldap
Closed

add option zimbra in ldap app#4567
johuder33 wants to merge 1 commit into
nextcloud:masterfrom
johuder33:add-ability-zimbra-ldap

Conversation

@johuder33

@johuder33johuder33 commented Apr 27, 2017

Copy link
Copy Markdown

this PR allow us to connect zimbra LDAP with the user_ldap app, now zimbra users can login with their zimbra accounts to Nextcloud.

@mention-bot

Copy link
Copy Markdown

@johuder33, thanks for your PR! By analyzing the history of the files in this pull request, we identified @blizzz, @LukasReschke and @leo-b to be potential reviewers.

@blizzz

blizzz commented Apr 28, 2017

Copy link
Copy Markdown
Member

@johuder33 thanks for your contribution! May I ask you to look into:

  1. Could you sign-off your commit (-s parameter in git commit, more info)

  2. since I have no resources to regularly test against Zimbra, are you OK with being added to @nextcloud/ldap group, in case anything (issue, PR, …) related to Zimbra appears?

  3. Can you add comments in the code how the format for Zimbra members looks like?

  4. What is the context of the change in dynamic groups (new lines 660ff)?

  5. Please keep the new lines at the end of the files

@johuder33

Copy link
Copy Markdown
Author

@blizzz Ok, I will modify the code and explain it too.

@go2sh

go2sh commented May 3, 2017

Copy link
Copy Markdown
Contributor

I just had a quick look. Wouldn't it be nice to have a general approach for Group Membership with E-Mails. There are some other ObjectClasses which work the same way only a different attribute. We could make group membership attributes configurable with a switch weather it contains a email address or a user id.

@johuder33

Copy link
Copy Markdown
Author

@go2sh Thank you for your suggestion, right now I working on this, I hope for the next days I can make your suggestion, it would be nice too. I will considere your comment for the next PR. 👍

@go2sh

go2sh commented May 4, 2017

Copy link
Copy Markdown
Contributor

If you need some help with it, feel free to ask ;)

@johuder33
johuder33force-pushed the add-ability-zimbra-ldap branch from dd5fe48 to 5c6a7fcCompareMay 4, 2017 16:59
@codecov

codecovBot commented May 4, 2017

Copy link
Copy Markdown

Codecov Report

Merging #4567 into master will decrease coverage by 0.02%.
The diff coverage is 6.06%.

@@ Coverage Diff @@## master #4567 +/- ##
============================================
- Coverage 54.28% 54.26% -0.03% - Complexity 22099 22106 +7 
============================================
Files 1361 1361 Lines 84708 84739 +31 Branches 1322 1322 ============================================
- Hits 45983 45980 -3 - Misses 38725 38759 +34
Impacted FilesCoverage ΔComplexity Δ
apps/user_ldap/templates/settings.php0% <ø> (ø)0 <0> (ø)⬇️
apps/user_ldap/lib/Wizard.php17.13% <0%> (-0.03%)226 <0> (ø)
apps/user_ldap/lib/Group_LDAP.php56.75% <6.45%> (-2.98%)167 <0> (+7)
lib/private/Security/CertificateManager.php92.78% <0%> (-1.04%)38% <0%> (ø)
core/js/js.js61.21% <0%> (-0.57%)0% <0%> (ø)
lib/private/Server.php93.51% <0%> (+0.14%)120% <0%> (ø)⬇️

…ra accounts
Signed-off-by: Juorder Gonzalez quiñonez <juordergonzalezquinonez@MBPdeJuorder2.home>
@johuder33
johuder33force-pushed the add-ability-zimbra-ldap branch from 5c6a7fc to da20a58CompareMay 4, 2017 17:43
@johuder33

Copy link
Copy Markdown
Author

@blizzz the changes are done, please add me to the group @nextcloud/ldap, there's not problem with that.

Any doubt you have please let me know.

@ChristophWurst

Copy link
Copy Markdown
Member

igned-off-by: Juorder Gonzalez quiñonez juordergonzalezquinonez@MBPdeJuorder2.home

FYI looks like your git config is not set to your real email address 😉 That's also why GitHub doesn't recognize it's your commit.


if(strtolower($this->access->connection->ldapGroupMemberAssocAttr) === 'zimbramailforwardingaddress') {
// array containing domains
$dns = array();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these days you can use short notation $dns = []; :)

if(strtolower($this->access->connection->ldapGroupMemberAssocAttr) === 'zimbramailforwardingaddress') {
// array containing domains
$dns = array();
// loop througth array members

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

$dns = array();
// loop througth array members
foreach($members as $mailOfMember) {
// split the email of each member eg. member_name@zimbra.com

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intendentation here and the following four lines appears wrong

// array containing domains
$dns = array();
// loop througth array members
foreach($members as $mailOfMember) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this can take a lot of time on big groups with many members. Do you think it is possible to use the provided $uid attribute and attempt to look up the user directly?

);
if ($userMatch !== false) {
// match found so this user is in this group
$pos = strpos($dynamicGroup['dn'][0], ',');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you test this against groups having a , in their cn?

// we need to extract the group name
// so we extracted from cn=myGroup,ou=people,dc=domain,dc=com
// we extract from position 3 to 7 in the string above, so we have: myGroup
$groups[] = $membershipGroup;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be dealt with $this->access->dn2groupname, because we rely on mappings here and avoid name collisions (e.g. with groups from other backends). Adding the group just like this won't have it mapped and further operations against this group might not work.

$member = $memberParts[0];

// replace all '%uid' with the value of $member and get the filter query
$filter = $this->access->combineFilterWidthAnd(array(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in method name, it should be combineFilterWithAnd

@blizzz

Copy link
Copy Markdown
Member

@johuder33 thanks a lot! Please see my review comments, important points are a typo in method name, one worry about group mapping and a question on speeding up one part. I also invited you to the group.

@MorrisJobkeMorrisJobke added 2. developing Work in progress and removed 3. to review Waiting for reviews labels May 10, 2017
@rullzerrullzer added this to the Nextcloud 13 milestone May 23, 2017
@blizzz

Copy link
Copy Markdown
Member

@johuder33 any update? i move it 14 due to feature freeze.

@blizzzblizzz modified the milestones: Nextcloud 13, Nextcloud 14Nov 13, 2017
@MorrisJobke

Copy link
Copy Markdown
Member

No feedback for 10 months -> closing

😢

@MorrisJobkeMorrisJobke removed this from the Nextcloud 14 milestone Mar 7, 2018
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@johuder33@mention-bot@blizzz@go2sh@ChristophWurst@MorrisJobke@rullzer