Browse code

show URL

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@2093 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on21/12/2011 16:51:52
Showing2 changed files
... ...
@@ -19,7 +19,8 @@ if (count($repos) == 0) {
19 19
 }
20 20
 
21 21
 foreach ($repos as $repo => $access) {
22
-  output("<div><p><strong>{$repo}</strong> ".internal_link('edit', icon_edit('Zugriffsrechte bearbeiten'), 'repo='.$repo)." ".internal_link('delete', icon_delete('Repository löschen'), 'repo='.$repo)."</p><ul>");
22
+  $url = get_git_url($repo);
23
+  output("<div><p><strong>{$repo}</strong> ".internal_link('edit', icon_edit('Zugriffsrechte bearbeiten'), 'repo='.$repo)." ".internal_link('delete', icon_delete('Repository löschen'), 'repo='.$repo)."<br />{$url}</p><ul>");
23 24
   foreach ($access as $user => $rights) {
24 25
     $grant = '';
25 26
     switch ($rights) {
... ...
@@ -35,6 +35,14 @@ function validate_name($name) {
35 35
   return (preg_match('/^[[:alnum:]][[:alnum:]._-]*$/', $name));
36 36
 }
37 37
 
38
+function get_git_url($repo) {
39
+  $remote = git_wrapper('remote --verbose');
40
+  DEBUG('gitolite-admin repo: '.$remote[0]);
41
+  $url = preg_replace('#^.*\s+(\S+):gitolite-admin.*#', '$1', $remote[0]);
42
+  DEBUG('URL: '.$url);
43
+  return $url.':'.$repo;
44
+}
45
+
38 46
 
39 47
 function git_wrapper($commandline)
40 48
 {
... ...
@@ -51,6 +59,7 @@ function git_wrapper($commandline)
51 59
     system_failure('Interner Fehler!');
52 60
     // FIXME: Hier sollte auf jeden Fall ein Logging angeworfen werden!
53 61
   }
62
+  return $output;
54 63
 }
55 64
 
56 65
 function refresh_gitolite()