Code Duplication    Length = 13-15 lines in 2 locations

plugins/ldap-change-password/ChangePasswordLdapDriver.php 2 locations

@@ 141-153 (lines=13) @@
138
					$this->oLogger->Write("ldap_start_tls failed: ".$oCon, \MailSo\Log\Enumerations\Type::WARNING, 'LDAP');
139
				}
140
141
				if (!@\ldap_bind($oCon, $sUserDn, $sPrevPassword))
142
				{
143
					if ($this->oLogger)
144
					{
145
						$sError = $oCon ? @\ldap_error($oCon) : '';
146
						$iErrno = $oCon ? @\ldap_errno($oCon) : 0;
147
148
						$this->oLogger->Write('ldap_bind error: '.$sError.' ('.$iErrno.')',
149
							\MailSo\Log\Enumerations\Type::WARNING, 'LDAP');
150
					}
151
152
					return false;
153
				}
154
			}
155
			else
156
			{
@@ 194-208 (lines=15) @@
191
			$aEntry = array();
192
			$aEntry[$this->sPasswordField] = (string) $sEncodedNewPassword;
193
194
			if (!!@\ldap_modify($oCon, $sUserDn, $aEntry))
195
			{
196
				$bResult = true;
197
			}
198
			else
199
			{
200
				if ($this->oLogger)
201
				{
202
					$sError = $oCon ? @\ldap_error($oCon) : '';
203
					$iErrno = $oCon ? @\ldap_errno($oCon) : 0;
204
205
					$this->oLogger->Write('ldap_modify error: '.$sError.' ('.$iErrno.')',
206
						\MailSo\Log\Enumerations\Type::WARNING, 'LDAP');
207
				}
208
			}
209
		}
210
		catch (\Exception $oException)
211
		{