49f497c9b2166d433f26df4e7e0eee63d975562f
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) 
Bernd Wurst Copyright year update

Bernd Wurst authored 6 years ago

5) Written 2008-2018 by schokokeks.org Hosting, namely
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

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 Wurst Zeige Clone-URLs als Eingab...

Bernd Wurst authored 6 years ago

18) require_once('inc/jquery.php');
19) javascript();
bernd First strike: list reposito...

bernd authored 12 years ago

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

bernd authored 12 years ago

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

bernd authored 12 years ago

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

bernd authored 12 years ago

26) 
Hanno Böck change git urls to https

Hanno Böck authored 7 years ago

27) output("<p>Das verteilte Versionskontrollsystem <a href=\"https://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

28) 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

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

Bernd Wurst authored 12 years ago

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

bernd authored 12 years ago

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

bernd authored 12 years ago

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

bernd authored 12 years ago

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

bernd authored 12 years ago

43)   $public = isset($settings['users']['gitweb']) && $settings['users']['gitweb'] == 'R';
44)   $public_string = '';
45)   if ($public) {
Bernd Wurst Zeige Clone-URLs als Eingab...

Bernd Wurst authored 6 years ago

46)     $public_viewer = 'https://'.config('gitserver').'/'.$repo.'.git';
47)     $public_clone = 'https://'.config('gitserver').'/git/'.$repo.'.git';
48)     $public_string = '<br />(Öffentlich einsehbar über <a href="'.$public_viewer.'">'.$public_viewer.'</a>, öffentliche clone-URL <input id="public_'.$repo.'_url" type="text" readonly="readonly" value="'.$public_clone.'"><button class="copyurl" id="public_'.$repo.'">Copy!</button>)';
bernd Bessere Handhabung öffentli...

bernd authored 12 years ago

49)   }
Bernd Wurst Zeige Clone-URLs als Eingab...

Bernd Wurst authored 6 years ago

50)   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 />SSH-Clone/Push-URL: <input type=\"text\" id=\"private_{$repo}_url\" readonly=\"readonly\" value=\"{$url}\"><button class=\"copyurl\" id=\"private_{$repo}\">Copy!</button> {$public_string}</p><ul>");
bernd Setze Berechtigung für gitw...

bernd authored 12 years ago

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

bernd authored 12 years ago

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

bernd authored 12 years ago

53)       continue;
54)     }
bernd First draft of gitolite-mod...

bernd authored 12 years ago

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