private function showEditMirror(Codendi_Request $request) { $title = $GLOBALS['Language']->getText('plugin_git', 'descriptor_name'); $renderer = TemplateRendererFactory::build()->getRenderer(dirname(GIT_BASE_DIR) . '/templates'); try { $mirror = $this->git_mirror_mapper->fetch($request->get('mirror_id')); } catch (Git_Mirror_MirrorNotFoundException $e) { $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_git', 'admin_mirror_cannot_update')); $GLOBALS['Response']->redirect('/plugins/git/admin/?pane=mirrors_admin'); } $admin_presenter = new Git_AdminMirrorEditPresenter($title, $this->csrf, $mirror); $GLOBALS['HTML']->header(array('title' => $title, 'selected_top_tab' => 'admin')); $renderer->renderToPage('admin-plugin', $admin_presenter); $GLOBALS['HTML']->footer(array()); }
public function updateMirror($mirror_id, $old_hostname) { $git_modifications = new Git_Gitolite_GitModifications(); if (!$this->gitoliterc_reader->getHostname()) { return $git_modifications; } $mirror = $this->mirror_data_mapper->fetch($mirror_id); if ($old_hostname && $old_hostname != $mirror->hostname) { $this->removeMirrorConfiguration($old_hostname, $git_modifications); } if ($mirror->hostname) { $this->dumpConfForMirror($mirror, $git_modifications); } return $git_modifications; }