<?php
/*
This file belongs to the Webinterface of schokokeks.org Hosting
Written by schokokeks.org Hosting, namely
Bernd Wurst <bernd@schokokeks.org>
Hanno Böck <hanno@schokokeks.org>
This code is published under a 0BSD license.
Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
*/
require_role(ROLE_SYSTEMUSER);
$data_dir = realpath(dirname(__FILE__) . '/../../../../gitolite-data/');
$config_file = $data_dir . '/gitolite-admin/conf/webinterface.conf';
$config_dir = $data_dir . '/gitolite-admin/conf/webinterface';
$key_dir = $data_dir . '/gitolite-admin/keydir';
DEBUG("gitolite-data_dir: " . $data_dir);
$git_wrapper = realpath(dirname(__FILE__) . '/../scripts/git-wrapper.sh');
function check_env()
{
global $git_wrapper, $data_dir, $config_file, $config_dir, $key_dir;
if (!is_executable($git_wrapper)) {
system_failure("git_wrapper.sh is not executable: {$git_wrapper}");
}
if (!(is_file($data_dir . '/sshkey') && is_file($data_dir . '/sshkey.pub'))) {
system_failure("SSH-key not found. Please setup the gitolite-module correctly. Run ./data/initialize.sh");
}
if (!is_dir($data_dir . '/gitolite-admin')) {
system_failure("Repository gitolite-admin ot found. Initial checkout must be made manually. Run ./data/initialize.sh");
}
if (!is_dir($config_dir)) {
system_failure("gitolite-admin repository is not prepared.");
}
if (!(is_dir($key_dir) && is_writeable($config_file))) {
system_failure("Repository gitolite-admin is corrupted or webinterface.conf is not writeable.");
}
}
function validate_name($name)
{
return (preg_match('/^[[:alnum:]][[:alnum:]._-]*$/', $name));
}
function get_git_url($repo)