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
    {
@@ 475-488 (lines=14) @@
472
        return $this->reUser->getValue('new_email');
473
    }
474
475
    public function setNewEMail($value)
476
    {
477
        if ($value !== null) {
478
            if (!is_valid_email_address($value)) {
479
                return false;
480
            }
481
482
            if (self::existEMail($value)) {
483
                return false;
484
            }
485
        }
486
487
        return $this->reUser->setValue('new_email', $value);
488
    }
489
490
    public function getWatchmailMode()
491
    {