private function createMirror(Codendi_Request $request) { $url = $request->get('new_mirror_url'); $hostname = $request->get('new_mirror_hostname'); $ssh_key = $request->get('new_mirror_key'); $password = $request->get('new_mirror_pwd'); $name = $request->get('new_mirror_name'); $this->csrf->check(); try { $this->git_mirror_mapper->save($url, $hostname, $ssh_key, $password, $name); } catch (Git_Mirror_MissingDataException $e) { $this->redirectToCreateWithError($GLOBALS['Language']->getText('plugin_git', 'admin_mirror_fields_required')); } catch (Git_Mirror_CreateException $e) { $this->redirectToCreateWithError($GLOBALS['Language']->getText('plugin_git', 'admin_mirror_save_failed')); } catch (Git_Mirror_HostnameAlreadyUsedException $e) { $this->redirectToCreateWithError($GLOBALS['Language']->getText('plugin_git', 'admin_mirror_hostname_duplicate')); } catch (Git_Mirror_HostnameIsReservedException $e) { $this->redirectToCreateWithError($GLOBALS['Language']->getText('plugin_git', 'admin_mirror_hostname_reserved', array($hostname))); } }