7ae33deebfbf80fde9235c3cea37c80930fe1f77
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) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 2 years ago

5) Written 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) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 2 years ago

9) This code is published under a 0BSD license.
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

10) 
11) 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.
12) */
13) 
bernd First draft of gitolite-mod...

bernd authored 13 years ago

14) require_once('inc/icons.php');
Bernd Wurst Zeige Clone-URLs als Eingab...

Bernd Wurst authored 6 years ago

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

bernd authored 13 years ago

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

bernd authored 13 years ago

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

bernd authored 13 years ago

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

bernd authored 13 years ago

23) 
Hanno Böck change git urls to https

Hanno Böck authored 7 years ago

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

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

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

Bernd Wurst authored 12 years ago

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

bernd authored 13 years ago

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

Hanno authored 6 years ago

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

bernd authored 13 years ago

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

Hanno authored 6 years ago

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

bernd authored 13 years ago

35) }
36) 
bernd Setze Berechtigung für gitw...

bernd authored 13 years ago

37) foreach ($repos as $repo => $settings) {
Bernd Wurst Umstellung von filter_input...

Bernd Wurst authored 5 years ago

38)     $description = $settings['description'] ? '<br /><em>"'.filter_output_html($settings['description']).'"</em>' : '';
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

39)     $url = get_git_url($repo);
40)     $public = isset($settings['users']['gitweb']) && $settings['users']['gitweb'] == 'R';
41)     $public_string = '';
42)     if ($public) {
43)         $public_viewer = 'https://'.config('gitserver').'/'.$repo.'.git';
44)         $public_clone = 'https://'.config('gitserver').'/git/'.$repo.'.git';
45)         $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

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

Hanno authored 6 years ago

47)     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>");
48)     foreach ($settings['users'] as $user => $rights) {
49)         if ($user == 'gitweb' || $user == 'daemon') {
50)             continue;
51)         }
52)         $grant = '';
53)         switch ($rights) {
Hanno Böck more strict codingstyle wit...

Hanno Böck authored 2 years ago

54)             case 'R': $grant = 'Lesezugriff';
bernd First draft of gitolite-mod...

bernd authored 13 years ago

55)                 break;
Hanno Böck more strict codingstyle wit...

Hanno Böck authored 2 years ago

56)             case 'RW': $grant = 'Lese- und Schreibzugriff';
bernd First draft of gitolite-mod...

bernd authored 13 years ago

57)                 break;
Hanno Böck more strict codingstyle wit...

Hanno Böck authored 2 years ago

58)             case 'RW+': $grant = 'erweiterter Zugriff (inkl. "rewind")';
bernd First draft of gitolite-mod...

bernd authored 13 years ago

59)                 break;
Hanno Böck more strict codingstyle wit...

Hanno Böck authored 2 years ago

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

Hanno authored 6 years ago

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

bernd authored 13 years ago

64) }
65) 
66) if (count($users) > 0) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

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

bernd authored 13 years ago

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

Hanno authored 6 years ago

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

70) }
71) 
72) 
73) 
74) if (count($users) == 0) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

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

bernd authored 13 years ago

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

Hanno authored 6 years ago

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

bernd authored 13 years ago

78) }
79) 
80) foreach ($users as $handle) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

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

82) }
83) 
84) addnew('newkey', 'Neuen SSH-Key eintragen');
85) 
Bernd Wurst add foreign git users and g...

Bernd Wurst authored 12 years ago

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

Hanno authored 6 years ago

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

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

Hanno authored 6 years ago

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

Bernd Wurst authored 12 years ago

91) }
92) 
93) foreach ($foreign_users as $handle) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

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