2626dd47daad110c63a82c0560b134e2364eeac3
bernd First strike: list reposito...

bernd authored 13 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) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

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 13 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 13 years ago

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

bernd authored 13 years ago

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

bernd authored 13 years ago

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

bernd authored 13 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 13 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 13 years ago

33) 
34) if (count($repos) == 0) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

35)     output("<p><em>bisher haben Sie keine GIT-Repositories</em></p>");
bernd First draft of gitolite-mod...

bernd authored 13 years ago

36) } else {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

37)     output("<h3>Ihre GIT-Repositories</h3>");
bernd First draft of gitolite-mod...

bernd authored 13 years ago

38) }
39) 
bernd Setze Berechtigung für gitw...

bernd authored 13 years ago

40) foreach ($repos as $repo => $settings) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

41)     $description = $settings['description'] ? '<br /><em>"'.$settings['description'].'"</em>' : '';
42)     $url = get_git_url($repo);
43)     $public = isset($settings['users']['gitweb']) && $settings['users']['gitweb'] == 'R';
44)     $public_string = '';
45)     if ($public) {
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 13 years ago

49)     }
Hanno Fix coding style with php-c...

Hanno 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>");
51)     foreach ($settings['users'] as $user => $rights) {
52)         if ($user == 'gitweb' || $user == 'daemon') {
53)             continue;
54)         }
55)         $grant = '';
56)         switch ($rights) {
bernd First draft of gitolite-mod...

bernd authored 13 years ago

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;
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

63)     }
64)         output("<li>{$user}: {$grant}</li>");
65)     }
66)     output("</ul></div>");
bernd First draft of gitolite-mod...

bernd authored 13 years ago

67) }
68) 
69) if (count($users) > 0) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

70)     addnew('edit', 'Neues GIT-Repository anlegen');
bernd First draft of gitolite-mod...

bernd authored 13 years ago

71) } else {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

72)     output('<p><em>Bitte legen Sie zunächst mindestens einen SSH-Key an.</em></p>');
bernd First draft of gitolite-mod...

bernd authored 13 years ago

73) }
74) 
75) 
76) 
77) if (count($users) == 0) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

78)     output('<p><em>Es sind bisher keine SSH-Keys eingerichtet.</em></p>');
bernd First draft of gitolite-mod...

bernd authored 13 years ago

79) } else {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

80)     output('<h3>Ihre aktuell hinterlegten SSH-Keys</h3>');
bernd First draft of gitolite-mod...

bernd authored 13 years ago

81) }
82) 
83) foreach ($users as $handle) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

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>");
bernd First draft of gitolite-mod...

bernd authored 13 years ago

85) }
86) 
87) addnew('newkey', 'Neuen SSH-Key eintragen');
88) 
Bernd Wurst add foreign git users and g...

Bernd Wurst authored 12 years ago

89) 
90) if (count($foreign_users) == 0) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

91)     output('<p><em>Es sind bisher keine GIT-Benutzer anderer Kunden eingetragen.</em></p>');
Bernd Wurst add foreign git users and g...

Bernd Wurst authored 12 years ago

92) } else {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

93)     output('<h3>GIT-Benutzer anderer Kunden</h3>');
Bernd Wurst add foreign git users and g...

Bernd Wurst authored 12 years ago

94) }
95) 
96) foreach ($foreign_users as $handle) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

97)     output('<p><strong>'.$handle.'</strong> '.internal_link('delete', icon_delete('Benutzer aus diesem Kundenaccount entfernen'), 'foreignhandle='.$handle)."</p>");