Code Duplication    Length = 5-6 lines in 2 locations

apps/user_ldap/lib/user/user.php 2 locations

@@ 506-510 (lines=5) @@
503
	 * @return null
504
	 */
505
	private function setOwnCloudAvatar() {
506
		if(!$this->image->valid()) {
507
			$this->log->log('user_ldap', 'jpegPhoto data invalid for '.$this->dn,
508
				\OCP\Util::ERROR);
509
			return;
510
		}
511
		//make sure it is a square and not bigger than 128x128
512
		$size = min(array($this->image->width(), $this->image->height(), 128));
513
		if(!$this->image->centerCrop($size)) {
@@ 513-518 (lines=6) @@
510
		}
511
		//make sure it is a square and not bigger than 128x128
512
		$size = min(array($this->image->width(), $this->image->height(), 128));
513
		if(!$this->image->centerCrop($size)) {
514
			$this->log->log('user_ldap',
515
				'croping image for avatar failed for '.$this->dn,
516
				\OCP\Util::ERROR);
517
			return;
518
		}
519
520
		if(!$this->fs->isLoaded()) {
521
			$this->fs->setup($this->uid);