Skip to content

Commit

Permalink
Item14165: add nullformat to %LDAP macro
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDaum committed Sep 2, 2016
1 parent 6d90f7f commit 9e06492
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
14 changes: 7 additions & 7 deletions .gitignore
@@ -1,8 +1,8 @@
*.swp
LdapNgPlugin.md5
LdapNgPlugin.sha1
LdapNgPlugin.tgz
LdapNgPlugin.txt
LdapNgPlugin.zip
LdapNgPlugin_installer
LdapNgPlugin_installer.pl
/LdapNgPlugin.md5
/LdapNgPlugin.sha1
/LdapNgPlugin.tgz
/LdapNgPlugin.txt
/LdapNgPlugin.zip
/LdapNgPlugin_installer
/LdapNgPlugin_installer.pl
2 changes: 2 additions & 0 deletions data/System/LdapNgPlugin.txt
Expand Up @@ -24,6 +24,7 @@ Parameters:
base of the LdapContrib
* =scope=: scope of search; possible values: sub, base, one
* =format=: format string used to display a database record
* =nullformat=: format string to be used when no results have been found, defaults to the empty string
* =header=: header to prepend the output; default: '$dn'
* =footer=: footer to appended to the output
* =separator=: separator between database records; default: '$n'
Expand Down Expand Up @@ -157,6 +158,7 @@ implements a fast solr-based person search with a different =SolrWikiUsersView=
%$DEPENDENCIES%

---++ Change History
| 02 Sep 2016: | added =nullformat= parameter to %LDAP macro |
| 23 May 2016: | added =value_separator= to fetch multi-value attributes from LDAP |
| 31 Aug 2015: | added support to index profile images stored in LDAP and indexed in Solr |
| 16 Dec 2014: | added view template for [[%USERSWEB%.WikiUsers]]; \
Expand Down
4 changes: 2 additions & 2 deletions lib/Foswiki/Plugins/LdapNgPlugin.pm
Expand Up @@ -19,8 +19,8 @@ use strict;
use warnings;

our $core;
our $VERSION = '6.20';
our $RELEASE = '23 May 2016';
our $VERSION = '6.30';
our $RELEASE = '02 Sep 2016';
our $NO_PREFS_IN_TOPIC = 1;
our $SHORTDESCRIPTION = 'Query and display data from an LDAP directory';

Expand Down
5 changes: 4 additions & 1 deletion lib/Foswiki/Plugins/LdapNgPlugin/Core.pm
Expand Up @@ -99,6 +99,7 @@ sub handleLdap {
my $theLimit = $params->{limit} || 0;
my $theSkip = $params->{skip} || 0;
my $theHideNull = Foswiki::Func::isTrue($params->{hidenull}, 0);
my $theNullFormat = $params->{nullformat} || '';
my $theClear = $params->{clear} || '';
my $theExclude = $params->{exclude} || '';
my $theInclude = $params->{include} || '';
Expand Down Expand Up @@ -190,7 +191,9 @@ sub handleLdap {
$ldap->finish();

my $count = scalar(@results);
return '' if $theHideNull && !$count;
unless ($count) {
return $theHideNull?"":$theNullFormat;
}

my $result = expandVars($theHeader . join($theSep, @results) . $theFooter, count => $count);

Expand Down
2 changes: 1 addition & 1 deletion lib/Foswiki/Plugins/LdapNgPlugin/build.pl
@@ -1,4 +1,4 @@
#!/usr/bin/perl -w
#!/usr/bin/env perl
BEGIN {
foreach my $pc (split(/:/, $ENV{FOSWIKI_LIBS})) {
unshift @INC, $pc;
Expand Down

0 comments on commit 9e06492

Please sign in to comment.