dcc202fb249a446ac15c7cf413b9f1b4a3f31b58
bernd First draft of gitolite-mod...

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

Hanno Böck authored 1 year 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 1 year 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 12 years ago

14) require_role(ROLE_SYSTEMUSER);
15) require_once('inc/security.php');
16) 
17) include('git.php');
18) $section = 'git_git';
19) 
20) if (isset($_GET['repo'])) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

21)     $repos = list_repos();
22)     if (!array_key_exists($_GET['repo'], $repos)) {
23)         system_failure("Es sollte ein unbekanntes Repository gelöscht werden!");
24)     }
bernd First draft of gitolite-mod...

bernd authored 12 years ago

25) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

26)     $sure = user_is_sure();
27)     if ($sure === null) {
28)         are_you_sure("repo={$_GET['repo']}", '<p>Soll das GIT-Repository »'.$_GET['repo'].'« wirklich gelöscht werden?</p>
bernd First draft of gitolite-mod...

bernd authored 12 years ago

29)     <p>Alle Inhalte die in diesem Repository gespeichert sind, werden gelöscht!</p>');
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

30)     } elseif ($sure === true) {
31)         delete_repo($_GET['repo']);
32)         if (! $debugmode) {
33)             header('Location: git');
34)         }
35)         die();
36)     } elseif ($sure === false) {
37)         if (! $debugmode) {
38)             header("Location: git");
39)         }
40)         die();
41)     }
bernd First draft of gitolite-mod...

bernd authored 12 years ago

42) }
43) 
44) if (isset($_GET['handle'])) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

45)     $users = list_users();
46)     if (!in_array($_GET['handle'], $users)) {
47)         system_failure("Es sollte ein unbekannter Benutzer gelöscht werden!");
48)     }
bernd First draft of gitolite-mod...

bernd authored 12 years ago

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

Hanno authored 5 years ago

50)     $sure = user_is_sure();
51)     if ($sure === null) {
52)         are_you_sure("handle={$_GET['handle']}", '<p>Soll der SSH-Key »'.$_GET['handle'].'« wirklich gelöscht werden?</p>');
53)     } elseif ($sure === true) {
54)         delete_key($_GET['handle']);
55)         if (! $debugmode) {
56)             header('Location: git');
57)         }
58)         die();
59)     } elseif ($sure === false) {
60)         if (! $debugmode) {
61)             header("Location: git");
62)         }
63)         die();
64)     }
bernd First draft of gitolite-mod...

bernd authored 12 years ago

65) }
Bernd Wurst add foreign git users and g...

Bernd Wurst authored 12 years ago

66) 
67) if (isset($_GET['foreignhandle'])) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

68)     $users = list_foreign_users();
69)     if (!in_array($_GET['foreignhandle'], $users)) {
70)         system_failure("Es sollte ein unbekannter Benutzer gelöscht werden!");
71)     }
Bernd Wurst add foreign git users and g...

Bernd Wurst authored 12 years ago

72) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

73)     $sure = user_is_sure();
74)     if ($sure === null) {
75)         are_you_sure("foreignhandle={$_GET['foreignhandle']}", '<p>Soll der GIT-Benutzer »'.$_GET['foreignhandle'].'« wirklich aus Ihrer Konfiguration werden?</p>');
76)     } elseif ($sure === true) {
77)         delete_foreign_user($_GET['foreignhandle']);
78)         if (! $debugmode) {
79)             header('Location: git');
80)         }
81)         die();
82)     } elseif ($sure === false) {
83)         if (! $debugmode) {
84)             header("Location: git");
85)         }
86)         die();
87)     }