Code Duplication    Length = 3-3 lines in 5 locations

src/system/UsersModule/Controller/UserAdministrationController.php 1 location

@@ 139-141 (lines=3) @@
136
     */
137
    public function modifyAction(Request $request, UserEntity $user)
138
    {
139
        if (!$this->hasPermission('ZikulaUsersModule::', $user->getUname() . "::" . $user->getUid(), ACCESS_EDIT)) {
140
            throw new AccessDeniedException();
141
        }
142
        if (UsersConstant::USER_ID_ANONYMOUS === $user->getUid()) {
143
            throw new AccessDeniedException($this->__("Error! You can't edit the guest account."));
144
        }

src/system/ZAuthModule/Controller/UserAdministrationController.php 4 locations

@@ 215-217 (lines=3) @@
212
     */
213
    public function modifyAction(Request $request, AuthenticationMappingEntity $mapping)
214
    {
215
        if (!$this->hasPermission('ZikulaZAuthModule::', $mapping->getUname() . "::" . $mapping->getUid(), ACCESS_EDIT)) {
216
            throw new AccessDeniedException();
217
        }
218
        if (1 === $mapping->getUid()) {
219
            throw new AccessDeniedException($this->__("Error! You can't edit the guest account."));
220
        }
@@ 327-329 (lines=3) @@
324
     */
325
    public function sendConfirmationAction(Request $request, AuthenticationMappingEntity $mapping)
326
    {
327
        if (!$this->hasPermission('ZikulaZAuthModule', $mapping->getUname() . '::' . $mapping->getUid(), ACCESS_MODERATE)) {
328
            throw new AccessDeniedException();
329
        }
330
        $changePasswordExpireDays = $this->getVar(ZAuthConstant::MODVAR_EXPIRE_DAYS_CHANGE_PASSWORD, ZAuthConstant::DEFAULT_EXPIRE_DAYS_CHANGE_PASSWORD);
331
        $lostPasswordId = $this->get('zikula_zauth_module.helper.lost_password_verification_helper')->createLostPasswordId($mapping);
332
        $mailSent = $this->get('zikula_zauth_module.helper.mail_helper')->sendNotification($mapping->getEmail(), 'lostpassword', [
@@ 353-355 (lines=3) @@
350
     */
351
    public function sendUserNameAction(Request $request, AuthenticationMappingEntity $mapping)
352
    {
353
        if (!$this->hasPermission('ZikulaZAuthModule', $mapping->getUname() . '::' . $mapping->getUid(), ACCESS_MODERATE)) {
354
            throw new AccessDeniedException();
355
        }
356
        $mailSent = $this->get('zikula_zauth_module.helper.mail_helper')->sendNotification($mapping->getEmail(), 'lostuname', [
357
            'uname' => $mapping->getUname(),
358
            'requestedByAdmin' => true,
@@ 378-380 (lines=3) @@
375
     */
376
    public function togglePasswordChangeAction(Request $request, UserEntity $user)
377
    {
378
        if (!$this->hasPermission('ZikulaZAuthModule', $user->getUname() . '::' . $user->getUid(), ACCESS_MODERATE)) {
379
            throw new AccessDeniedException();
380
        }
381
        if ($user->getAttributes()->containsKey(ZAuthConstant::REQUIRE_PASSWORD_CHANGE_KEY)) {
382
            $mustChangePass = $user->getAttributes()->get(ZAuthConstant::REQUIRE_PASSWORD_CHANGE_KEY);
383
        } else {