View Issue Details

This bug affects 1 person(s).
 12
IDProjectCategoryView StatusLast Update
18413Bug reportsAuthenticationpublic2022-10-24 12:33
ReporterDennis1993 Assigned ToDenisChenu  
PrioritynormalSeverityblock 
Status closedResolutionfixed 
Product Version5.4.x 
Summary18413: PHP 8.1 und LDAP funtkionieren nicht mehr
Description

Hallo,

seit dem Update von PHP auf 8.1 klappt der Login per LDAP nicht mehr.

Die Seite bricht immer mit einem Error 500 ab und folgender Meldung:
Cannot use object of type LDAP\Connection as array

Steps To Reproduce

Steps to reproduce

  • Update PHP to 8.1
  • Try to login with LDAP data

Expected result

Login should be working

Actual result

No login possible

Tagsldap
Bug heat12
Complete LimeSurvey version number (& build)5.4.4
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMariaDB 10.5
Server OS (if known)
Webserver software & version (if known)
PHP Version8.1.11

Relationships

child of 18427 closedDenisChenu LDAP plugin error when try to create new user on PHP8.1 

Users monitoring this issue

There are no users monitoring this issue.

Activities

ollehar

ollehar

2022-10-13 12:19

administrator   ~72231

Thanks for testing. For now, please downgrade to PHP 8.0, or feel free to do a pull request on Github.

c_schmitz

c_schmitz

2022-10-13 14:36

administrator   ~72233

@Dennis1993 Can you enable debug = 2 in application/config/config.php and try again, please? Paste the complete error message here.

Dennis1993

Dennis1993

2022-10-13 17:34

reporter   ~72242

Hey,

thanks for your answer.
With the debug log I can fix the problem.

Here my fix for PHP 8.1 and LDAP:
Open the file /application/core/plugins/AuthLDAP/AuthLDAP.php

Search for:

if (!is_resource($ldapconn)) {

replace it with:

if ($ldapconn === false) {

Thats it!
In PHP 8.1 the following is changed:
PHP 8.1: LDAP: resources migrated to LDAP\Connection, LDAP\Result, and LDAP\ResultEntry objects

I try to create a pull request for that :)
Thanks!

Dennis1993

Dennis1993

2022-10-13 17:46

reporter   ~72243

Pull request: https://github.com/LimeSurvey/LimeSurvey/pull/2665

c_schmitz

c_schmitz

2022-10-13 20:59

administrator   ~72248

Great - thank you!

guest

guest

2022-10-13 21:24

viewer   ~72249

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

ollehar

ollehar

2022-10-14 10:52

administrator   ~72251

Does this change still work on PHP 8.0?

DenisChenu

DenisChenu

2022-10-14 12:15

developer   ~72252

The change is NOT good : in case of some error : AuthLDAP->createConnection(); return an array …

Hard to have a clean report without debug set but :
on ly localhots : SSL not forced OK,
Force SSL : receive "Invalid password"

See the PHP Warning : createConnection retun an array

PHP warning.html (28,706 bytes)   
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>PHP warning</title>

<style type="text/css">
/*<![CDATA[*/
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent;margin:0;padding:0;}
body{line-height:1;}
ol,ul{list-style:none;}
blockquote,q{quotes:none;}
blockquote:before,blockquote:after,q:before,q:after{content:none;}
:focus{outline:0;}
ins{text-decoration:none;}
del{text-decoration:line-through;}
table{border-collapse:collapse;border-spacing:0;}

body {
	font: normal 9pt "Verdana";
	color: #000;
	background: #fff;
}

h1 {
	font: normal 18pt "Verdana";
	color: #f00;
	margin-bottom: .5em;
}

h2 {
	font: normal 14pt "Verdana";
	color: #800000;
	margin-bottom: .5em;
}

h3 {
	font: bold 11pt "Verdana";
}

pre {
	font: normal 11pt Menlo, Consolas, "Lucida Console", Monospace;
}

pre span.error {
	display: block;
	background: #fce3e3;
}

pre span.ln {
	color: #999;
	padding-right: 0.5em;
	border-right: 1px solid #ccc;
}

pre span.error-ln {
	font-weight: bold;
}

.container {
	margin: 1em 4em;
}

.version {
	color: gray;
	font-size: 8pt;
	border-top: 1px solid #aaa;
	padding-top: 1em;
	margin-bottom: 1em;
}

.message {
	color: #000;
	padding: 1em;
	font-size: 11pt;
	background: #f3f3f3;
	-webkit-border-radius: 10px;
	-moz-border-radius: 10px;
	border-radius: 10px;
	margin-bottom: 1em;
	line-height: 160%;
}

.source {
	margin-bottom: 1em;
}

.code pre {
	background-color: #ffe;
	margin: 0.5em 0;
	padding: 0.5em;
	line-height: 125%;
	border: 1px solid #eee;
}

.source .file {
	margin-bottom: 1em;
	font-weight: bold;
}

.traces {
	margin: 2em 0;
}

.trace {
	margin: 0.5em 0;
	padding: 0.5em;
}

.trace.app {
	border: 1px dashed #c00;
}

.trace .number {
	text-align: right;
	width: 2em;
	padding: 0.5em;
}

.trace .content {
	padding: 0.5em;
}

.trace .plus,
.trace .minus {
	display:inline;
	vertical-align:middle;
	text-align:center;
	border:1px solid #000;
	color:#000;
	font-size:10px;
	line-height:10px;
	margin:0;
	padding:0 1px;
	width:10px;
	height:10px;
}

.trace.collapsed .minus,
.trace.expanded .plus,
.trace.collapsed pre {
	display: none;
}

.trace-file {
	cursor: pointer;
	padding: 0.2em;
}

.trace-file:hover {
	background: #f0ffff;
}
/*]]>*/
</style>
</head>

<body>
<div class="container">
	<h1>PHP warning</h1>

	<p class="message">
		ldap_start_tls(): Unable to start TLS: Protocol error	</p>

	<div class="source">
		<p class="file">/home/limesurvey.shnoulle.net/www/application/core/plugins/AuthLDAP/AuthLDAP.php(359)</p>
		<div class="code"><pre><span class="ln">347</span>         }
<span class="ln">348</span> 
<span class="ln">349</span>         $connectionSuccessful = ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, $ldapver);
<span class="ln">350</span>         if (!$connectionSuccessful) {
<span class="ln">351</span>             return array("errorCode" =&gt; 1, "errorMessage" =&gt; gT('Error creating LDAP connection'));
<span class="ln">352</span>         }
<span class="ln">353</span>         ldap_set_option($ldapconn, LDAP_OPT_REFERRALS, $ldapoptreferrals);
<span class="ln">354</span> 
<span class="ln">355</span>         // Apply TLS only if ldaps is not used - you can use either SSL or TLS - both does not work
<span class="ln">356</span>         // TLS also requires LDAPv3
<span class="ln">357</span>         if (!empty($ldaptls) &amp;&amp; $ldaptls == '1' &amp;&amp; $ldapver == 3 &amp;&amp; preg_match("/^ldaps:\/\//", $ldapserver) === 0) {
<span class="ln">358</span>             // starting TLS secure layer
<span class="error"><span class="ln error-ln">359</span>             if (!ldap_start_tls($ldapconn)) {
</span><span class="ln">360</span>                 ldap_unbind($ldapconn); // Could not properly connect, unbind everything.
<span class="ln">361</span>                 return array("errorCode" =&gt; 100, 'errorMessage' =&gt; ldap_error($ldapconn));
<span class="ln">362</span>             }
<span class="ln">363</span>         }
<span class="ln">364</span> 
<span class="ln">365</span>         return $ldapconn;
<span class="ln">366</span>     }
<span class="ln">367</span> 
<span class="ln">368</span>     public function beforeLogin()
<span class="ln">369</span>     {
<span class="ln">370</span>         if ($this-&gt;get('is_default', null, null, false) == true) {
<span class="ln">371</span>             // This is configured to be the default login method
</pre></div>	</div>

	<div class="traces">
		<h2>Stack Trace</h2>
				<table style="width:100%;">
						<tbody><tr class="trace app expanded">
			<td class="number">
				#0			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/home/limesurvey.shnoulle.net/www/application/core/plugins/AuthLDAP/AuthLDAP.php(359): <strong>ldap_start_tls</strong>(resource)				</div>

				<div class="code"><pre><span class="ln">354</span> 
<span class="ln">355</span>         // Apply TLS only if ldaps is not used - you can use either SSL or TLS - both does not work
<span class="ln">356</span>         // TLS also requires LDAPv3
<span class="ln">357</span>         if (!empty($ldaptls) &amp;&amp; $ldaptls == '1' &amp;&amp; $ldapver == 3 &amp;&amp; preg_match("/^ldaps:\/\//", $ldapserver) === 0) {
<span class="ln">358</span>             // starting TLS secure layer
<span class="error"><span class="ln error-ln">359</span>             if (!ldap_start_tls($ldapconn)) {
</span><span class="ln">360</span>                 ldap_unbind($ldapconn); // Could not properly connect, unbind everything.
<span class="ln">361</span>                 return array("errorCode" =&gt; 100, 'errorMessage' =&gt; ldap_error($ldapconn));
<span class="ln">362</span>             }
<span class="ln">363</span>         }
<span class="ln">364</span> 
</pre></div>			</td>
		</tr>
						<tr class="trace app expanded">
			<td class="number">
				#1			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/home/limesurvey.shnoulle.net/www/application/core/plugins/AuthLDAP/AuthLDAP.php(482): <strong>AuthLDAP</strong>-&gt;<strong>createConnection</strong>()				</div>

				<div class="code"><pre><span class="ln">477</span>         $bindpwd = $this-&gt;get('bindpwd');
<span class="ln">478</span>         $groupsearchbase        = $this-&gt;get('groupsearchbase');
<span class="ln">479</span>         $groupsearchfilter      = $this-&gt;get('groupsearchfilter');
<span class="ln">480</span> 
<span class="ln">481</span>         // Try to connect
<span class="error"><span class="ln error-ln">482</span>         $ldapconn = $this-&gt;createConnection();
</span><span class="ln">483</span>         if ($ldapconn === false) {
<span class="ln">484</span>             $this-&gt;setAuthFailure($ldapconn['errorCode'], gT($ldapconn['errorMessage']));
<span class="ln">485</span>             return;
<span class="ln">486</span>         }
<span class="ln">487</span> 
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#2			</td>
			<td class="content">
				<div class="trace-file">
										&nbsp;unknown(0): <strong>AuthLDAP</strong>-&gt;<strong>newUserSession</strong>()				</div>

							</td>
		</tr>
						<tr class="trace app expanded">
			<td class="number">
				#3			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/home/limesurvey.shnoulle.net/www/application/libraries/PluginManager/PluginManager.php(269): <strong>call_user_func</strong>(array(AuthLDAP, "newUserSession"))				</div>

				<div class="code"><pre><span class="ln">264</span>                 if (
<span class="ln">265</span>                     !$event-&gt;isStopped()
<span class="ln">266</span>                     &amp;&amp; (empty($target) || in_array(get_class($subscription[0]), $target))
<span class="ln">267</span>                 ) {
<span class="ln">268</span>                     $subscription[0]-&gt;setEvent($event);
<span class="error"><span class="ln error-ln">269</span>                     call_user_func($subscription);
</span><span class="ln">270</span>                 }
<span class="ln">271</span>             }
<span class="ln">272</span>         }
<span class="ln">273</span> 
<span class="ln">274</span>         return $event;
</pre></div>			</td>
		</tr>
						<tr class="trace app collapsed">
			<td class="number">
				#4			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/home/limesurvey.shnoulle.net/www/application/core/LSUserIdentity.php(73): <strong>LimeSurvey\PluginManager\PluginManager</strong>-&gt;<strong>dispatchEvent</strong>(LimeSurvey\PluginManager\PluginEvent)				</div>

				<div class="code"><pre><span class="ln">68</span>                 $result-&gt;setError(self::ERROR_UNKNOWN_HANDLER);
<span class="ln">69</span>             } else {
<span class="ln">70</span>                 // Delegate actual authentication to plugin
<span class="ln">71</span>                 $authEvent = new PluginEvent('newUserSession', $this); // TODO: rename the plugin function authenticate()
<span class="ln">72</span>                 $authEvent-&gt;set('identity', $this);
<span class="error"><span class="ln error-ln">73</span>                 App()-&gt;getPluginManager()-&gt;dispatchEvent($authEvent);
</span><span class="ln">74</span>                 $pluginResult = $authEvent-&gt;get('result');
<span class="ln">75</span>                 if ($pluginResult instanceof LSAuthResult) {
<span class="ln">76</span>                     $result = $pluginResult;
<span class="ln">77</span>                 } else {
<span class="ln">78</span>                     $result-&gt;setError(self::ERROR_UNKNOWN_IDENTITY);
</pre></div>			</td>
		</tr>
						<tr class="trace app collapsed">
			<td class="number">
				#5			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/home/limesurvey.shnoulle.net/www/application/controllers/admin/Authentication.php(163): <strong>LSUserIdentity</strong>-&gt;<strong>authenticate</strong>()				</div>

				<div class="code"><pre><span class="ln">158</span> 
<span class="ln">159</span>             // Now authenticate
<span class="ln">160</span>             // This call LSUserIdentity::authenticate() (application/core/LSUserIdentity.php))
<span class="ln">161</span>             // which will call the plugin function newUserSession() (eg: Authdb::newUserSession() )
<span class="ln">162</span>             // TODO: for sake of clarity, the plugin function should be renamed to authenticate().
<span class="error"><span class="ln error-ln">163</span>             if ($identity-&gt;authenticate()) {
</span><span class="ln">164</span>                 FailedLoginAttempt::model()-&gt;deleteAttempts(FailedLoginAttempt::TYPE_LOGIN);
<span class="ln">165</span>                 App()-&gt;user-&gt;setState('plugin', $authMethod);
<span class="ln">166</span> 
<span class="ln">167</span>                 Yii::app()-&gt;session['just_logged_in'] = true;
<span class="ln">168</span>                 Yii::app()-&gt;session['loginsummary'] = self::getSummary();
</pre></div>			</td>
		</tr>
						<tr class="trace app collapsed">
			<td class="number">
				#6			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/home/limesurvey.shnoulle.net/www/application/controllers/admin/Authentication.php(47): <strong>Authentication</strong>::<strong>prepareLogin</strong>()				</div>

				<div class="code"><pre><span class="ln">42</span>         }
<span class="ln">43</span>         // The page should be shown only for non logged in users
<span class="ln">44</span>         $this-&gt;redirectIfLoggedIn();
<span class="ln">45</span> 
<span class="ln">46</span>         // Result can be success, fail or data for template
<span class="error"><span class="ln error-ln">47</span>         $result = self::prepareLogin();
</span><span class="ln">48</span> 
<span class="ln">49</span>         $isAjax = isset($_GET['ajax']) &amp;&amp; $_GET['ajax'] == 1;
<span class="ln">50</span>         $succeeded = isset($result[0]) &amp;&amp; $result[0] == 'success';
<span class="ln">51</span>         $failed = isset($result[0]) &amp;&amp; $result[0] == 'failed';
<span class="ln">52</span> 
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#7			</td>
			<td class="content">
				<div class="trace-file">
										&nbsp;unknown(0): <strong>Authentication</strong>-&gt;<strong>index</strong>()				</div>

							</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#8			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/home/limesurvey.shnoulle.net/www/third_party/yiisoft/yii/framework/web/actions/CAction.php(115): <strong>ReflectionMethod</strong>-&gt;<strong>invokeArgs</strong>(Authentication, array())				</div>

				<div class="code"><pre><span class="ln">110</span>             elseif($param-&gt;isDefaultValueAvailable())
<span class="ln">111</span>                 $ps[]=$param-&gt;getDefaultValue();
<span class="ln">112</span>             else
<span class="ln">113</span>                 return false;
<span class="ln">114</span>         }
<span class="error"><span class="ln error-ln">115</span>         $method-&gt;invokeArgs($object,$ps);
</span><span class="ln">116</span>         return true;
<span class="ln">117</span>     }
<span class="ln">118</span> }
</pre></div>			</td>
		</tr>
						<tr class="trace app collapsed">
			<td class="number">
				#9			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/home/limesurvey.shnoulle.net/www/application/core/SurveyCommonAction.php(83): <strong>CAction</strong>-&gt;<strong>runWithParamsInternal</strong>(Authentication,
 ReflectionMethod, array("r" =&gt; "admin/authentication/sa/login", "sa"
 =&gt; "login", "sAction" =&gt; "login"))				</div>

				<div class="code"><pre><span class="ln">78</span>             $oMethod = new ReflectionMethod($this, $sDefault);
<span class="ln">79</span>         }
<span class="ln">80</span> 
<span class="ln">81</span>         // We're all good to go, let's execute it
<span class="ln">82</span>         // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
<span class="error"><span class="ln error-ln">83</span>         return parent::runWithParamsInternal($this, $oMethod, $params);
</span><span class="ln">84</span>     }
<span class="ln">85</span> 
<span class="ln">86</span>     /**
<span class="ln">87</span>      * Some functions have different parameters, which are just an alias of the
<span class="ln">88</span>      * usual parameters we're getting in the url. This function just populates
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#10			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/home/limesurvey.shnoulle.net/www/third_party/yiisoft/yii/framework/web/CController.php(308): <strong>SurveyCommonAction</strong>-&gt;<strong>runWithParams</strong>(array("r" =&gt; "admin/authentication/sa/login", "sa" =&gt; "login", "sAction" =&gt; "login"))				</div>

				<div class="code"><pre><span class="ln">303</span>     {
<span class="ln">304</span>         $priorAction=$this-&gt;_action;
<span class="ln">305</span>         $this-&gt;_action=$action;
<span class="ln">306</span>         if($this-&gt;beforeAction($action))
<span class="ln">307</span>         {
<span class="error"><span class="ln error-ln">308</span>             if($action-&gt;runWithParams($this-&gt;getActionParams())===false)
</span><span class="ln">309</span>                 $this-&gt;invalidActionParams($action);
<span class="ln">310</span>             else
<span class="ln">311</span>                 $this-&gt;afterAction($action);
<span class="ln">312</span>         }
<span class="ln">313</span>         $this-&gt;_action=$priorAction;
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#11			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/home/limesurvey.shnoulle.net/www/third_party/yiisoft/yii/framework/web/CController.php(286): <strong>CController</strong>-&gt;<strong>runAction</strong>(Authentication)				</div>

				<div class="code"><pre><span class="ln">281</span>      * @see runAction
<span class="ln">282</span>      */
<span class="ln">283</span>     public function runActionWithFilters($action,$filters)
<span class="ln">284</span>     {
<span class="ln">285</span>         if(empty($filters))
<span class="error"><span class="ln error-ln">286</span>             $this-&gt;runAction($action);
</span><span class="ln">287</span>         else
<span class="ln">288</span>         {
<span class="ln">289</span>             $priorAction=$this-&gt;_action;
<span class="ln">290</span>             $this-&gt;_action=$action;
<span class="ln">291</span>             CFilterChain::create($this,$action,$filters)-&gt;run();
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#12			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/home/limesurvey.shnoulle.net/www/third_party/yiisoft/yii/framework/web/CController.php(265): <strong>CController</strong>-&gt;<strong>runActionWithFilters</strong>(Authentication, array())				</div>

				<div class="code"><pre><span class="ln">260</span>         {
<span class="ln">261</span>             if(($parent=$this-&gt;getModule())===null)
<span class="ln">262</span>                 $parent=Yii::app();
<span class="ln">263</span>             if($parent-&gt;beforeControllerAction($this,$action))
<span class="ln">264</span>             {
<span class="error"><span class="ln error-ln">265</span>                 $this-&gt;runActionWithFilters($action,$this-&gt;filters());
</span><span class="ln">266</span>                 $parent-&gt;afterControllerAction($this,$action);
<span class="ln">267</span>             }
<span class="ln">268</span>         }
<span class="ln">269</span>         else
<span class="ln">270</span>             $this-&gt;missingAction($actionID);
</pre></div>			</td>
		</tr>
						<tr class="trace app collapsed">
			<td class="number">
				#13			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/home/limesurvey.shnoulle.net/www/application/controllers/AdminController.php(202): <strong>CController</strong>-&gt;<strong>run</strong>("authentication")				</div>

				<div class="code"><pre><span class="ln">197</span>         }
<span class="ln">198</span> 
<span class="ln">199</span>         $this-&gt;runModuleController($action);
<span class="ln">200</span> 
<span class="ln">201</span> 
<span class="error"><span class="ln error-ln">202</span>         return parent::run($action);
</span><span class="ln">203</span>     }
<span class="ln">204</span> 
<span class="ln">205</span>     /**
<span class="ln">206</span>      * Starting with LS4, 3rd party developer can extends any of the LimeSurve controllers.
<span class="ln">207</span>      *
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#14			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/home/limesurvey.shnoulle.net/www/third_party/yiisoft/yii/framework/web/CWebApplication.php(282): <strong>AdminController</strong>-&gt;<strong>run</strong>("authentication")				</div>

				<div class="code"><pre><span class="ln">277</span>         {
<span class="ln">278</span>             list($controller,$actionID)=$ca;
<span class="ln">279</span>             $oldController=$this-&gt;_controller;
<span class="ln">280</span>             $this-&gt;_controller=$controller;
<span class="ln">281</span>             $controller-&gt;init();
<span class="error"><span class="ln error-ln">282</span>             $controller-&gt;run($actionID);
</span><span class="ln">283</span>             $this-&gt;_controller=$oldController;
<span class="ln">284</span>         }
<span class="ln">285</span>         else
<span class="ln">286</span>             throw new CHttpException(404,Yii::t('yii','Unable to resolve the request "{route}".',
<span class="ln">287</span>                 array('{route}'=&gt;$route===''?$this-&gt;defaultController:$route)));
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#15			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/home/limesurvey.shnoulle.net/www/third_party/yiisoft/yii/framework/web/CWebApplication.php(141): <strong>CWebApplication</strong>-&gt;<strong>runController</strong>("admin/authentication/sa/login")				</div>

				<div class="code"><pre><span class="ln">136</span>             foreach(array_splice($this-&gt;catchAllRequest,1) as $name=&gt;$value)
<span class="ln">137</span>                 $_GET[$name]=$value;
<span class="ln">138</span>         }
<span class="ln">139</span>         else
<span class="ln">140</span>             $route=$this-&gt;getUrlManager()-&gt;parseUrl($this-&gt;getRequest());
<span class="error"><span class="ln error-ln">141</span>         $this-&gt;runController($route);
</span><span class="ln">142</span>     }
<span class="ln">143</span> 
<span class="ln">144</span>     /**
<span class="ln">145</span>      * Registers the core application components.
<span class="ln">146</span>      * This method overrides the parent implementation by registering additional core components.
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#16			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/home/limesurvey.shnoulle.net/www/third_party/yiisoft/yii/framework/base/CApplication.php(185): <strong>CWebApplication</strong>-&gt;<strong>processRequest</strong>()				</div>

				<div class="code"><pre><span class="ln">180</span>     public function run()
<span class="ln">181</span>     {
<span class="ln">182</span>         if($this-&gt;hasEventHandler('onBeginRequest'))
<span class="ln">183</span>             $this-&gt;onBeginRequest(new CEvent($this));
<span class="ln">184</span>         register_shutdown_function(array($this,'end'),0,false);
<span class="error"><span class="ln error-ln">185</span>         $this-&gt;processRequest();
</span><span class="ln">186</span>         if($this-&gt;hasEventHandler('onEndRequest'))
<span class="ln">187</span>             $this-&gt;onEndRequest(new CEvent($this));
<span class="ln">188</span>     }
<span class="ln">189</span> 
<span class="ln">190</span>     /**
</pre></div>			</td>
		</tr>
						<tr class="trace app collapsed">
			<td class="number">
				#17			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/home/limesurvey.shnoulle.net/www/index.php(192): <strong>CApplication</strong>-&gt;<strong>run</strong>()				</div>

				<div class="code"><pre><span class="ln">187</span> require_once APPPATH . 'core/LSYii_Application' . EXT;
<span class="ln">188</span> 
<span class="ln">189</span> $config = require_once(APPPATH . 'config/internal' . EXT);
<span class="ln">190</span> 
<span class="ln">191</span> Yii::$enableIncludePath = false;
<span class="error"><span class="ln error-ln">192</span> Yii::createApplication('LSYii_Application', $config)-&gt;run();
</span><span class="ln">193</span> 
<span class="ln">194</span> /* End of file index.php */
<span class="ln">195</span> /* Location: ./index.php */
</pre></div>			</td>
		</tr>
				</tbody></table>
	</div>

	<div class="version">
		2022-10-14 12:08:30 nginx/1.18.0 <a href="https://www.yiiframework.com/">Yii Framework</a>/1.1.26	</div>
</div>

<script type="text/javascript">
/*<![CDATA[*/
var traceReg = new RegExp("(^|\\s)trace-file(\\s|$)");
var collapsedReg = new RegExp("(^|\\s)collapsed(\\s|$)");

var e = document.getElementsByTagName("div");
for(var j=0,len=e.length;j<len;j++){
	if(traceReg.test(e[j].className)){
		e[j].onclick = function(){
			var trace = this.parentNode.parentNode;
			if(collapsedReg.test(trace.className))
				trace.className = trace.className.replace("collapsed", "expanded");
			else
				trace.className = trace.className.replace("expanded", "collapsed");
		}
	}
}
/*]]>*/
</script>




<table class="yiiLog" style="border-spacing:1px;font:11px Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;color:#666666;" width="100%" cellpadding="2">
	<tbody><tr>
		<th style="background:black;color:white;" colspan="5">
			Application Log
		</th>
	</tr>
	<tr style="background-color: #ccc;">
	    <th style="width:120px">Timestamp</th>
		<th>Level</th>
		<th>Category</th>
		<th>Message</th>
	</tr>
	<tr style="background:#FFC0CB">
		<td align="center">12:08:30.221682</td>
		<td>error</td>
		<td>php</td>
		<td><pre>ldap_start_tls(): Unable to start TLS: Protocol error
(/home/limesurvey.shnoulle.net/www/application/core/plugins/AuthLDAP/AuthLDAP.php:359)
Stack trace:
#0
/home/limesurvey.shnoulle.net/www/application/core/plugins/AuthLDAP/AuthLDAP.php(359):
ldap_start_tls()
#1
/home/limesurvey.shnoulle.net/www/application/core/plugins/AuthLDAP/AuthLDAP.php(482):
AuthLDAP-&gt;createConnection()
#2 unknown(0): AuthLDAP-&gt;newUserSession()
#3
/home/limesurvey.shnoulle.net/www/application/libraries/PluginManager/PluginManager.php(269):
call_user_func()
#4
/home/limesurvey.shnoulle.net/www/application/core/LSUserIdentity.php(73):
LimeSurvey\PluginManager\PluginManager-&gt;dispatchEvent()
#5
/home/limesurvey.shnoulle.net/www/application/controllers/admin/Authentication.php(163):
LSUserIdentity-&gt;authenticate()
#6
/home/limesurvey.shnoulle.net/www/application/controllers/admin/Authentication.php(47):
prepareLogin()
#7 unknown(0): Authentication-&gt;index()
#8
/home/limesurvey.shnoulle.net/www/third_party/yiisoft/yii/framework/web/actions/CAction.php(115):
ReflectionMethod-&gt;invokeArgs()
#9
/home/limesurvey.shnoulle.net/www/application/core/SurveyCommonAction.php(83):
Authentication-&gt;runWithParamsInternal()
#10
/home/limesurvey.shnoulle.net/www/third_party/yiisoft/yii/framework/web/CController.php(308):
Authentication-&gt;runWithParams()
#11
/home/limesurvey.shnoulle.net/www/third_party/yiisoft/yii/framework/web/CController.php(286):
AdminController-&gt;runAction()
#12
/home/limesurvey.shnoulle.net/www/third_party/yiisoft/yii/framework/web/CController.php(265):
AdminController-&gt;runActionWithFilters()
#13
/home/limesurvey.shnoulle.net/www/application/controllers/AdminController.php(202):
AdminController-&gt;run()
#14
/home/limesurvey.shnoulle.net/www/third_party/yiisoft/yii/framework/web/CWebApplication.php(282):
AdminController-&gt;run()
#15
/home/limesurvey.shnoulle.net/www/third_party/yiisoft/yii/framework/web/CWebApplication.php(141):
LSYii_Application-&gt;runController()
#16
/home/limesurvey.shnoulle.net/www/third_party/yiisoft/yii/framework/base/CApplication.php(185):
LSYii_Application-&gt;processRequest()
#17 /home/limesurvey.shnoulle.net/www/index.php(192):
LSYii_Application-&gt;run()
REQUEST_URI=/index.php?r=admin/authentication/sa/login</pre></td>
	</tr></tbody></table>
<!-- end of log messages --></body></html>
<!-- start log messages -->
PHP warning.html (28,706 bytes)   
DenisChenu

DenisChenu

2022-10-14 15:35

developer   ~72254

if $ldapconn === false then $ldapconn['errorCode'] is not set …

I fix it again.

DenisChenu

DenisChenu

2022-10-14 15:46

developer   ~72255

https://github.com/LimeSurvey/LimeSurvey/pull/2672

LimeBot

LimeBot

2022-10-18 10:27

administrator   ~72316

Fixed in Release 5.4.6+221018

DenisChenu

DenisChenu

2022-10-18 12:12

developer   ~72320

Not fixed
If error happen : it broke, error are not shown

See: https://github.com/LimeSurvey/LimeSurvey/pull/2672

DenisChenu

DenisChenu

2022-10-18 16:33

developer   ~72337

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

LimeBot

LimeBot

2022-10-24 12:33

administrator   ~72388

Fixed in Release 5.4.8+221024

Related Changesets

LimeSurvey: master a26b5a82

2022-10-13 21:23:54

Dennis1993


Committer: GitHub Details Diff
Fixed issue 18413: Cannot authenticate with LDAP when using PHP 8.1 Affected Issues
18413
mod - application/core/plugins/AuthLDAP/AuthLDAP.php Diff File

LimeSurvey: master 0c1a7cc5

2022-10-18 16:33:02

DenisChenu


Committer: GitHub Details Diff
Fixed issue 18413: Cannot authenticate with LDAP when using PHP 8.1 Affected Issues
18413
mod - application/core/plugins/AuthLDAP/AuthLDAP.php Diff File

Issue History

Date Modified Username Field Change
2022-10-12 21:46 Dennis1993 New Issue
2022-10-13 12:19 ollehar Note Added: 72231
2022-10-13 12:19 ollehar Bug heat 0 => 2
2022-10-13 12:19 ollehar Priority none => normal
2022-10-13 14:36 c_schmitz Note Added: 72233
2022-10-13 14:36 c_schmitz Bug heat 2 => 4
2022-10-13 14:41 c_schmitz Assigned To => c_schmitz
2022-10-13 14:41 c_schmitz Status new => feedback
2022-10-13 17:34 Dennis1993 Note Added: 72242
2022-10-13 17:34 Dennis1993 Bug heat 4 => 6
2022-10-13 17:34 Dennis1993 Status feedback => assigned
2022-10-13 17:46 Dennis1993 Note Added: 72243
2022-10-13 17:46 Dennis1993 Tag Attached: ldap
2022-10-13 20:59 c_schmitz Note Added: 72248
2022-10-13 20:59 c_schmitz Status assigned => resolved
2022-10-13 20:59 c_schmitz Resolution open => fixed
2022-10-13 21:24 Dennis1993 Changeset attached => LimeSurvey master a26b5a82
2022-10-13 21:24 guest Note Added: 72249
2022-10-13 21:24 guest Bug heat 6 => 8
2022-10-14 10:52 ollehar Note Added: 72251
2022-10-14 12:15 DenisChenu Note Added: 72252
2022-10-14 12:15 DenisChenu File Added: PHP warning.html
2022-10-14 12:15 DenisChenu Bug heat 8 => 10
2022-10-14 12:15 DenisChenu Assigned To c_schmitz => DenisChenu
2022-10-14 15:35 DenisChenu Status resolved => assigned
2022-10-14 15:35 DenisChenu Note Added: 72254
2022-10-14 15:46 DenisChenu Assigned To DenisChenu => gabrieljenik
2022-10-14 15:46 DenisChenu Status assigned => ready for code review
2022-10-14 15:46 DenisChenu Note Added: 72255
2022-10-18 10:27 LimeBot Note Added: 72316
2022-10-18 10:27 LimeBot Status ready for code review => closed
2022-10-18 10:27 LimeBot Bug heat 10 => 12
2022-10-18 12:12 DenisChenu Assigned To gabrieljenik => c_schmitz
2022-10-18 12:12 DenisChenu Status closed => feedback
2022-10-18 12:12 DenisChenu Resolution fixed => reopened
2022-10-18 12:12 DenisChenu Note Added: 72320
2022-10-18 16:33 DenisChenu Changeset attached => LimeSurvey master 0c1a7cc5
2022-10-18 16:33 DenisChenu Note Added: 72337
2022-10-18 16:33 DenisChenu Assigned To c_schmitz => DenisChenu
2022-10-18 16:33 DenisChenu Resolution reopened => fixed
2022-10-18 16:33 c_schmitz Status feedback => resolved
2022-10-24 08:33 DenisChenu Relationship added child of 18427
2022-10-24 12:33 LimeBot Note Added: 72388
2022-10-24 12:33 LimeBot Status resolved => closed