View Issue Details

IDProjectCategoryView StatusLast Update
14674Bug reports[All Projects] Installationpublic2019-03-22 05:46
Reporternova168168 Assigned To 
PrioritynoneSeveritymajor 
Status newResolutionopen 
Product Version3.15.x 
Target VersionFixed in Version 
Summary14674: can't import survey participants from ldap
Description

I can't import the survey participants from LDAP

LimeSurvey Version : 3.15.0+181008

PHP Version 5.6.39

Steps To Reproduce
  1. configured the ldap.php
  2. restart LimeSurvey
  3. login system
  4. click Survey participants
  5. click Create --> LDAP query
  6. click Upload
Additional Information

after enable the debug mode , the system shown this error :

PHP notice
Constant LDAP_OPT_DIAGNOSTIC_MESSAGE already defined

/volume1/web/LimeSurvey/application/controllers/admin/tokens.php(1883)

1871
1872 $aData['duplicatelist'] = $duplicatelist;
1873 $aData['invalidemaillist'] = $invalidemaillist;
1874 $aData['invalidemailcount'] = $invalidemailcount;
1875 $aData['resultnum'] = $resultnum;
1876 $aData['xv'] = $xv;
1877 $aData['xy'] = $xy;
1878 $aData['xz'] = $xz;
1879
1880 $this->_renderWrappedTemplate('token', array('ldappost'), $aData);
1881 } else {
1882 $sErrorMessage = ldap_error($ds);
1883 define("LDAP_OPT_DIAGNOSTIC_MESSAGE", 0x0032);
1884 if (ldap_get_option($ds, LDAP_OPT_DIAGNOSTIC_MESSAGE, $extended_error)) {
1885 $sErrorMessage .= ' - '.$extended_error;
1886 }
1887 $aData['sError'] = sprintf(gT("Can't bind to the LDAP directory. Error message: %s"), ldap_error($ds));
1888 $this->_renderWrappedTemplate('token', array('ldapform'), $aData);
1889 }
1890 try {
1891 @ldap_close($ds);
1892 } catch (Exception $e) {
1893 // No handling needed
1894 }
1895
Stack Trace
#0
– /volume1/web/LimeSurvey/application/controllers/admin/tokens.php(1883): define("LDAP_OPT_DIAGNOSTIC_MESSAGE", 50)
1878 $aData['xz'] = $xz;
1879
1880 $this->_renderWrappedTemplate('token', array('ldappost'), $aData);
1881 } else {
1882 $sErrorMessage = ldap_error($ds);
1883 define("LDAP_OPT_DIAGNOSTIC_MESSAGE", 0x0032);
1884 if (ldap_get_option($ds, LDAP_OPT_DIAGNOSTIC_MESSAGE, $extended_error)) {
1885 $sErrorMessage .= ' - '.$extended_error;
1886 }
1887 $aData['sError'] = sprintf(gT("Can't bind to the LDAP directory. Error message: %s"), ldap_error($ds));
1888 $this->_renderWrappedTemplate('token', array('ldapform'), $aData);
#1
unknown(0): tokens->importldap("371646")
#2

  • /volume1/web/LimeSurvey/framework/web/actions/CAction.php(109): ReflectionMethod->invokeArgs(tokens, array("371646"))
    #3
    – /volume1/web/LimeSurvey/application/core/Survey_Common_Action.php(83): CAction->runWithParamsInternal(tokens, ReflectionMethod, array("r" => "admin/tokens/sa/importldap/surveyid/371646", "sa" => "importldap", "surveyid" => "371646", "iSurveyId" => "371646", ...))
    78 $oMethod = new ReflectionMethod($this, $sDefault);
    79 }
    80
    81 // We're all good to go, let's execute it
    82 // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
    83 return parent::runWithParamsInternal($this, $oMethod, $params);
    84 }
    85
    86 /*
    87
    Some functions have different parameters, which are just an alias of the
    88 * usual parameters we're getting in the url. This function just populates
    #4
  • /volume1/web/LimeSurvey/framework/web/CController.php(308): Survey_Common_Action->runWithParams(array("r" => "admin/tokens/sa/importldap/surveyid/371646", "sa" => "importldap", "surveyid" => "371646"))
    #5
  • /volume1/web/LimeSurvey/framework/web/CController.php(286): CController->runAction(tokens)
    #6
  • /volume1/web/LimeSurvey/framework/web/CController.php(265): CController->runActionWithFilters(tokens, array())
    #7
    – /volume1/web/LimeSurvey/application/controllers/AdminController.php(158): CController->run("tokens")
    153 $this->redirect(array('/admin/authentication/sa/login'));
    154 }
    155 }
    156 }
    157
    158 return parent::run($action);
    159 }
    160
    161 /*
    162
    Routes all the actions to their respective places
    163 *
    #8
  • /volume1/web/LimeSurvey/framework/web/CWebApplication.php(282): AdminController->run("tokens")
    #9
  • /volume1/web/LimeSurvey/framework/web/CWebApplication.php(141): CWebApplication->runController("admin/tokens/sa/importldap/surveyid/371646")
    #10
  • /volume1/web/LimeSurvey/framework/base/CApplication.php(185): CWebApplication->processRequest()
    #11
  • /volume1/web/LimeSurvey/index.php(194): CApplication->run()
    2019-03-22 12:21:37 nginx/1.13.3 Yii Framework/1.1.19

    the below is the LDAP.php setting :

    $serverId = 0;
    $LDAP_server[$serverId] = "l72.16.2.184";
    $LDAP_server[$serverId] = "389";
    $LDAP_server[$serverId] = "ldapv2";
    $LDAP_server[$serverId] = "none";
    $LDAP_server[$serverId] = false;
    $LDAP_server[$serverId] = "CN=administrator,CN=users,DC=xxx,DC=yyy";
    $LDAP_server[$serverId] = "password";
    $query_id = 0;
    $LDAP_queries[$query_id] = 0;
    $LDAP_queries[$query_id] = 'Staff with an enabled account';
    $LDAP_queries[$query_id] = 'OU=Users,DC=xxx,DC=yyy';
    $LDAP_queries[$query_id] = '(&(objectCategory=Person)(objectClass=user)(!(userAccountControl=514)))';
    $LDAP_queries[$query_id] = 'sub';
    $LDAP_queries[$query_id] = 'givenname';
    $LDAP_queries[$query_id] = 'sn';
    $LDAP_queries[$query_id] = 'mail';

TagsNo tags attached.
Complete LimeSurvey version number (& build)LimeSurvey Version : 3.15.0+181008
I will donate to the project if issue is resolvedYes
Browser
Database & DB-Versionmysqlnd 5.0.11-dev - 20120503
Server OS (if known)Linux DiskStation 2.6.32.12 #23824
Webserver software & version (if known)nginx version: nginx/1.13.3
PHP VersionPHP Version 5.6.39

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2019-03-22 05:46 nova168168 New Issue