Code Duplication    Length = 12-14 lines in 2 locations

htdocs/lib2/logic/user.class.php 2 locations

@@ 151-162 (lines=12) @@
148
     * @param string $value
149
     * @return bool
150
     */
151
    public function setUsername($value)
152
    {
153
        if (!mb_ereg_match(REGEX_USERNAME, $value)) {
154
            return false;
155
        }
156
157
        if (is_valid_email_address($value)) {
158
            return false;
159
        }
160
161
        return $this->reUser->setValue('username', $value);
162
    }
163
164
    public function getUsernameChanged()
165
    {
@@ 485-498 (lines=14) @@
482
        return $this->reUser->getValue('new_email');
483
    }
484
485
    public function setNewEMail($value)
486
    {
487
        if ($value !== null) {
488
            if (!is_valid_email_address($value)) {
489
                return false;
490
            }
491
492
            if (self::existEMail($value)) {
493
                return false;
494
            }
495
        }
496
497
        return $this->reUser->setValue('new_email', $value);
498
    }
499
500
    public function getWatchmailMode()
501
    {