3b8a0d58af7b98f5ce5ae5fb1f5a1705149f219c
bernd First strike: list reposito...

bernd authored 12 years ago

1) <?php
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

2) /*
3) This file belongs to the Webinterface of schokokeks.org Hosting
4) 
5) Written 2008-2012 by schokokeks.org Hosting, namely
6)   Bernd Wurst <bernd@schokokeks.org>
7)   Hanno Böck <hanno@schokokeks.org>
8) 
9) To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
10) 
11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
12) http://creativecommons.org/publicdomain/zero/1.0/
13) 
14) 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.
15) */
16) 
bernd First draft of gitolite-mod...

bernd authored 12 years ago

17) require_once('inc/icons.php');
bernd First strike: list reposito...

bernd authored 12 years ago

18) 
19) include('git.php');
20) require_role(ROLE_SYSTEMUSER);
21) 
bernd GIT-URL eingebaut

bernd authored 12 years ago

22) $section = 'git_git';
bernd First draft of gitolite-mod...

bernd authored 12 years ago

23) title("GIT-Zugänge");
bernd First strike: list reposito...

bernd authored 12 years ago

24) 
bernd First draft of gitolite-mod...

bernd authored 12 years ago

25) output("<p>Das verteilte Versionskontrollsystem <a href=\"http://www.git-scm.org\">GIT</a> ist ein populäres Werkzeug um Programmcode zu verwalten. Mit dieser Oberfläche können Sie GIT-repositories erstellen und den Zugriff für mehrere Benutzer festlegen.</p>");
bernd Typo

bernd authored 12 years ago

26) output("<p>Wir verwenden das beliebte System »gitolite« um diese Funktionalität anzubieten. Gitolite erlaubt bei Bedarf weitaus feingliedrigere Kontrolle als dieses Webinterface. Fragen Sie bitte den Support, wenn Sie Interesse daran haben zusätzliche Berechtigungen einzurichten.</p>");
bernd First draft of gitolite-mod...

bernd authored 12 years ago

27) 
28) $repos = list_repos();
29) $users = list_users();
Bernd Wurst add foreign git users and g...

Bernd Wurst authored 12 years ago

30) $foreign_users = list_foreign_users();
bernd First draft of gitolite-mod...

bernd authored 12 years ago

31) 
32) if (count($repos) == 0) {
33)   output("<p><em>bisher haben Sie keine GIT-Repositories</em></p>");
34) } else {
35)   output("<h3>Ihre GIT-Repositories</h3>"); 
36) }
37) 
bernd Setze Berechtigung für gitw...

bernd authored 12 years ago

38) foreach ($repos as $repo => $settings) {
39)   $description = $settings['description'] ? '<br /><em>"'.$settings['description'].'"</em>' : '';
bernd show URL

bernd authored 12 years ago

40)   $url = get_git_url($repo);
bernd Bessere Handhabung öffentli...

bernd authored 12 years ago

41)   $public = isset($settings['users']['gitweb']) && $settings['users']['gitweb'] == 'R';
42)   $public_string = '';
43)   if ($public) {
Bernd Wurst changed git repository URL...

Bernd Wurst authored 12 years ago

44)     $public_url = 'http://'.config('gitserver').'/'.$repo.'.git';
45)     $git_url = 'git://'.config('gitserver').'/'.$repo.'.git';
bernd Kosmetik

bernd authored 12 years ago

46)     $public_string = '<br />(Öffentlicher Lesezugriff über <a href="'.$public_url.'">'.$public_url.'</a> und '.$git_url.')';
bernd Bessere Handhabung öffentli...

bernd authored 12 years ago

47)   }
bernd Sortiere Repositories und U...

bernd authored 12 years ago

48)   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)."{$description}<br />push-Adresse: {$url} {$public_string}</p><ul>");
bernd Setze Berechtigung für gitw...

bernd authored 12 years ago

49)   foreach ($settings['users'] as $user => $rights) {
bernd GIT-URL eingebaut

bernd authored 12 years ago

50)     if ($user == 'gitweb' || $user == 'daemon') {
bernd Bessere Handhabung öffentli...

bernd authored 12 years ago

51)       continue;
52)     }
bernd First draft of gitolite-mod...

bernd authored 12 years ago

53)     $grant = '';
54)     switch ($rights) {
55)       case 'R': $grant = 'Lesezugriff';
56)                 break;
57)       case 'RW': $grant = 'Lese- und Schreibzugriff';
58)                 break;
59)       case 'RW+': $grant = 'erweiterter Zugriff (inkl. "rewind")';
60)                 break;
61)     }    
62)     output("<li>{$user}: {$grant}</li>");
63)   }
64)   output("</ul></div>");
65) }
66) 
67) if (count($users) > 0) {
68)   addnew('edit', 'Neues GIT-Repository anlegen');
69) } else {
70)   output('<p><em>Bitte legen Sie zunächst mindestens einen SSH-Key an.</em></p>');
71) }
72) 
73) 
74) 
75) if (count($users) == 0) {
76)   output('<p><em>Es sind bisher keine SSH-Keys eingerichtet.</em></p>');
77) } else {
78)   output('<h3>Ihre aktuell hinterlegten SSH-Keys</h3>');
79) }
80) 
81) foreach ($users as $handle) {
82)   output('<p><strong>'.$handle.'</strong> '.internal_link('newkey', icon_edit('Hinterlegten SSH-Key ändern'), 'handle='.$handle)." ".internal_link('delete', icon_delete('SSH-Key löschen'), 'handle='.$handle)."</p>");
83) }
84) 
85) addnew('newkey', 'Neuen SSH-Key eintragen');
86)