Code Duplication    Length = 8-8 lines in 2 locations

Auth/class.User.php 2 locations

@@ 508-515 (lines=8) @@
505
506
    private function checkForUnsettableElements($data)
507
    {
508
        if(isset($data->mail))
509
        {
510
            if($data->mail !== $this->mail)
511
            {
512
                throw new \Exception('Unable to change email!');
513
            }
514
            unset($data->mail);
515
        }
516
        if(isset($data->uid))
517
        {
518
            if($data->uid !== $this->uid)
@@ 516-523 (lines=8) @@
513
            }
514
            unset($data->mail);
515
        }
516
        if(isset($data->uid))
517
        {
518
            if($data->uid !== $this->uid)
519
            {
520
                throw new \Exception('Unable to change uid!');
521
            }
522
            unset($data->uid);
523
        }
524
    }
525
526
    private function editAddressElements($data)