private function modifyMirror(Codendi_Request $request) { try { $this->csrf->check(); $mirror_id = $request->get('mirror_id'); $update = $this->git_mirror_mapper->update($mirror_id, $request->get('mirror_url'), $request->get('mirror_hostname'), $request->get('mirror_key'), $request->get('mirror_name')); if (!$update) { $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_git', 'admin_mirror_cannot_update')); } else { $GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('plugin_git', 'admin_mirror_updated')); } } catch (Git_Mirror_MirrorNotFoundException $e) { $this->redirectToEditFormWithError($mirror_id, $GLOBALS['Language']->getText('plugin_git', 'admin_mirror_cannot_update')); } catch (Git_Mirror_MirrorNoChangesException $e) { $this->redirectToEditFormWithError($mirror_id, $GLOBALS['Language']->getText('plugin_git', 'admin_mirror_no_changes')); } catch (Git_Mirror_MissingDataException $e) { $this->redirectToEditFormWithError($mirror_id, $GLOBALS['Language']->getText('plugin_git', 'admin_mirror_fields_required')); } catch (Git_Mirror_HostnameAlreadyUsedException $e) { $this->redirectToEditFormWithError($mirror_id, $GLOBALS['Language']->getText('plugin_git', 'admin_mirror_hostname_duplicate')); } catch (Git_Mirror_HostnameIsReservedException $e) { $this->redirectToEditFormWithError($mirror_id, $GLOBALS['Language']->getText('plugin_git', 'admin_mirror_hostname_reserved', array($request->get('mirror_hostname')))); } }