Code Duplication    Length = 6-9 lines in 2 locations

src/php/Apix/Plugin/Auth.php 2 locations

@@ 75-80 (lines=6) @@
72
            $context = array('user' => $session->getUsername());
73
74
            // check the username is in the authorised list.
75
            if (null !== $users && !in_array($context['user'], $users)) {
76
77
                $logger->notice('Auth: User unauthorised [{user}]', $context);
78
79
                throw new Exception('Access unauthorised', 401);
80
            }
81
82
            // check user group
83
            $context['group'] = $session->getGroup();
@@ 84-92 (lines=9) @@
81
82
            // check user group
83
            $context['group'] = $session->getGroup();
84
            if (null !== $groups && !in_array($context['group'], $groups) ) {
85
86
                $logger->notice(
87
                    'Auth: Sessions\'s group unauthorised [{user}/{group}]".',
88
                    $context
89
                );
90
91
                throw new Exception('Access unauthorised.', 401);
92
            }
93
94
            // check for (required) trusted user IPs
95
            if ($session->hasTrustedIps()) {