Code Duplication    Length = 4-4 lines in 4 locations

module/Admin/src/Admin/Controller/UsersController.php 4 locations

@@ 270-273 (lines=4) @@
267
268
        $user_id    = $this->params()->fromRoute('user_id', '');
269
        $token        = $this->params()->fromRoute('confirmtoken', '');
270
        if (empty($user_id) || empty($token)) {
271
            $this->flashMessenger()->addWarningMessage($this->translate("missing parameters"));
272
            return $this->redirect()->toRoute($config["zfcuser_registration_redirect_route"], array());
273
        }
274
275
        if (is_numeric($user_id) ) {
276
            $oUser = $users->findById($user_id);
@@ 280-283 (lines=4) @@
277
        } else {
278
            $oUser = $users->findByUsername($user_id);
279
        }
280
        if (!$oUser ) {
281
            $this->flashMessenger()->addWarningMessage($this->translate("user could not be found"));
282
            return $this->redirect()->toRoute($config["zfcuser_registration_redirect_route"], array());
283
        }
284
        if (($oUser->getState() != 0) || ($oUser->getToken() != $token) ) {
285
            $this->flashMessenger()->addWarningMessage($this->translate("confirmation token is invalid"));
286
            return $this->redirect()->toRoute($config["zfcuser_registration_redirect_route"], array());
@@ 329-332 (lines=4) @@
326
327
        $user_id    = $this->params()->fromRoute('user_id', '');
328
        $token        = $this->params()->fromRoute('activatetoken', '');
329
        if (empty($user_id) || empty($token)) {
330
            $this->flashMessenger()->addWarningMessage($this->translate("missing parameters"));
331
            return $this->redirect()->toRoute($config["zfcuser_registration_redirect_route"], array());
332
        }
333
334
        if (is_numeric($user_id) ) {
335
            $oUser = $users->findById($user_id);
@@ 339-342 (lines=4) @@
336
        } else {
337
            $oUser = $users->findByUsername($user_id);
338
        }
339
        if (!$oUser ) {
340
            $this->flashMessenger()->addWarningMessage($this->translate("user could not be found"));
341
            return $this->redirect()->toRoute($config["zfcuser_registration_redirect_route"], array());
342
        }
343
        if (($oUser->getState() != 0) || ($oUser->getToken() != $token) ) {
344
            $this->flashMessenger()->addWarningMessage($this->translate("activation token is invalid"));
345
            return $this->redirect()->toRoute($config["zfcuser_registration_redirect_route"], array());