Code Duplication    Length = 7-7 lines in 2 locations

src/Controller/AppController.php 2 locations

@@ 184-190 (lines=7) @@
181
                    //To prevent multiple flash messages.
182
                    $this->Flash->config(['clear' => true]);
183
                    $this->Flash->error(__("Hello {0}, The website is under maintenance, only you and the staff groups have the access !", h($user->full_name)));
184
                } else {
185
                    if (!($controller == 'Pages' && $action == 'maintenance') &&
186
                        !($controller == 'Users' && $action == 'login') &&
187
                        !($controller == 'Users' && $action == 'logout')) {
188
                        $this->redirect(['controller' => 'pages', 'action' => 'maintenance', 'prefix' => false]);
189
                    }
190
                }
191
            } else {
192
                if (!($controller == 'Pages' && $action == 'maintenance') &&
193
                    !($controller == 'Users' && $action == 'login') &&
@@ 191-197 (lines=7) @@
188
                        $this->redirect(['controller' => 'pages', 'action' => 'maintenance', 'prefix' => false]);
189
                    }
190
                }
191
            } else {
192
                if (!($controller == 'Pages' && $action == 'maintenance') &&
193
                    !($controller == 'Users' && $action == 'login') &&
194
                    !($controller == 'Users' && $action == 'logout')) {
195
                    $this->redirect(['controller' => 'pages', 'action' => 'maintenance', 'prefix' => false]);
196
                }
197
            }
198
        }
199
200
        //JavaScript Notifications.