Code Duplication    Length = 13-15 lines in 2 locations

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

@@ 129-141 (lines=13) @@
126
			{
127
				@\ldap_set_option($oCon, LDAP_OPT_PROTOCOL_VERSION, 3);
128
129
				if (!@\ldap_bind($oCon, $sUserDn, $sPrevPassword))
130
				{
131
					if ($this->oLogger)
132
					{
133
						$sError = $oCon ? @\ldap_error($oCon) : '';
134
						$iErrno = $oCon ? @\ldap_errno($oCon) : 0;
135
136
						$this->oLogger->Write('ldap_bind error: '.$sError.' ('.$iErrno.')',
137
							\MailSo\Log\Enumerations\Type::WARNING, 'LDAP');
138
					}
139
140
					return false;
141
				}
142
			}
143
			else
144
			{
@@ 182-196 (lines=15) @@
179
			$aEntry = array();
180
			$aEntry[$this->sPasswordField] = (string) $sEncodedNewPassword;
181
182
			if (!!@\ldap_modify($oCon, $sUserDn, $aEntry))
183
			{
184
				$bResult = true;
185
			}
186
			else
187
			{
188
				if ($this->oLogger)
189
				{
190
					$sError = $oCon ? @\ldap_error($oCon) : '';
191
					$iErrno = $oCon ? @\ldap_errno($oCon) : 0;
192
193
					$this->oLogger->Write('ldap_modify error: '.$sError.' ('.$iErrno.')',
194
						\MailSo\Log\Enumerations\Type::WARNING, 'LDAP');
195
				}
196
			}
197
		}
198
		catch (\Exception $oException)
199
		{