View Issue Details

IDProjectCategoryView StatusLast Update
14793Bug reports[All Projects] Survey participants (Tokens)public2019-04-30 09:12
ReporterjollyjumpAssigned Toc_schmitz 
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version3.17.x 
Target VersionFixed in Version3.17.x 
Summary14793: Sorting of participant (query) groups wrong
Description

The query groups defined in LDAP have a "name" and an "id".

Using the webinterface for any survey, adding participants using an LDAP-query, the list in the drop-down menu is sorted by the "name".

Regardless of the visible sorting, the "id" of participants will be used which belongs to the entry number that was selected.

Thus, the wrong participants are added.

Steps To Reproduce

if you define two (or more) queries in the file config/ldap.php,
not in alphabetical order e.g.

$query_id = 0;
$ldap_queries[$query_id]['ldapServerId'] = 0;
$ldap_queries[$query_id]['name'] = 'Second Group';
$ldap_queries[$query_id]['userbase'] = 'ou=accounts,dc=example,dc=org';
$ldap_queries[$query_id]['userfilter'] = '(&(objectClass=inetOrgPerson)(gidNumber=10000))';
..
$query_id = 1;
$ldap_queries[$query_id]['ldapServerId'] = 0;
$ldap_queries[$query_id]['name'] = 'First Group';
$ldap_queries[$query_id]['userbase'] = 'ou=accounts,dc=example,dc=org';
$ldap_queries[$query_id]['userfilter'] = '(&(objectClass=inetOrgPerson)(gidNumber=10001))';

then

TagsNo tags attached.
Complete LimeSurvey version number (& build)3.17.1 190408
I will donate to the project if issue is resolvedNo
Browser
Database & DB-Versionmariadb 10.3.14+maria~bionic
Server OS (if known)debian 9.8
Webserver software & version (if known)apache 2.4.25
PHP Versionphp 7.3.3

Activities

jollyjump

jollyjump

2019-04-23 17:29

reporter   ~51553

at least I found where the sorting happens application/views/admin/token/ldapform.php

                <?php echo CHtml::form(array("admin/tokens/sa/importldap/surveyid/{$iSurveyId}"), 'post', array('class'=>'')); ?>

                    <!-- LDAP query  -->
                    <div class="form-group">
                        <label for="ldapQueries" class=" control-label">
                            <?php eT("Select the LDAP query you want to run:"); ?>
                        </label>
                        <div class="">
                            <select name='ldapQueries' class="form-control">
                                <?php $names = array_column($ldap_queries, 'name');
                                      array_multisort($names, $ldap_queries);
                                      foreach ($ldap_queries as $q_number => $q): ?>
                                    <option value="<?php echo $q_number; ?>"><?php echo $q['name']; ?></option>
                                <?php endforeach; ?>
                            </select>
                        </div>
                    </div>
c_schmitz

c_schmitz

2019-04-24 17:21

administrator   ~51576

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=28863

c_schmitz

c_schmitz

2019-04-30 09:12

administrator   ~51674

Fixed in Version 3.1.7.3

Related Changesets

LimeSurvey: master a5f19d4b

2019-04-24 16:42:31

c_schmitz

Details Diff
Fixed issue 14793: Faulty assignments of query groups when importing participants from LDAP Affected Issues
14793
mod - application/views/admin/token/ldapform.php Diff File

Issue History

Date Modified Username Field Change
2019-04-23 17:23 jollyjump New Issue
2019-04-23 17:29 jollyjump Note Added: 51553
2019-04-24 16:40 c_schmitz Assigned To => c_schmitz
2019-04-24 16:40 c_schmitz Status new => assigned
2019-04-24 16:43 c_schmitz Status assigned => resolved
2019-04-24 16:43 c_schmitz Resolution open => fixed
2019-04-24 16:43 c_schmitz Fixed in Version => 3.17.x
2019-04-24 17:21 c_schmitz Changeset attached => LimeSurvey master a5f19d4b
2019-04-24 17:21 c_schmitz Note Added: 51576
2019-04-30 09:12 c_schmitz Note Added: 51674
2019-04-30 09:12 c_schmitz Status resolved => closed