3ef995c2108fe77d22c0b556fb9717cb848bc48f
bernd First draft of gitolite-mod...

bernd authored 13 years ago

1) <?php
Hanno Böck Add newlines before comment...

Hanno Böck authored 8 months ago

2) 
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 13 years ago

3) /*
4) This file belongs to the Webinterface of schokokeks.org Hosting
5) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 3 years ago

6) Written by schokokeks.org Hosting, namely
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 13 years ago

7)   Bernd Wurst <bernd@schokokeks.org>
8)   Hanno Böck <hanno@schokokeks.org>
9) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 3 years ago

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

Bernd Wurst authored 13 years ago

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

bernd authored 13 years ago

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

Hanno authored 7 years ago

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

bernd authored 13 years ago

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

Hanno authored 7 years ago

27)     $sure = user_is_sure();
28)     if ($sure === null) {
Hanno Böck Spaces between string conca...

Hanno Böck authored 2 years ago

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

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

Hanno authored 7 years ago

31)     } elseif ($sure === true) {
32)         delete_repo($_GET['repo']);
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 2 years ago

33)         if (!$debugmode) {
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

34)             header('Location: git');
35)         }
36)         die();
37)     } elseif ($sure === false) {
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 2 years ago

38)         if (!$debugmode) {
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

39)             header("Location: git");
40)         }
41)         die();
42)     }
bernd First draft of gitolite-mod...

bernd authored 13 years ago

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

Hanno authored 7 years ago

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

bernd authored 13 years ago

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

Hanno authored 7 years ago

51)     $sure = user_is_sure();
52)     if ($sure === null) {
Hanno Böck Spaces between string conca...

Hanno Böck authored 2 years ago

53)         are_you_sure("handle={$_GET['handle']}", '<p>Soll der SSH-Key »' . $_GET['handle'] . '« wirklich gelöscht werden?</p>');
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

54)     } elseif ($sure === true) {
55)         delete_key($_GET['handle']);
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 2 years ago

56)         if (!$debugmode) {
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

57)             header('Location: git');
58)         }
59)         die();
60)     } elseif ($sure === false) {
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 2 years ago

61)         if (!$debugmode) {
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

62)             header("Location: git");
63)         }
64)         die();
65)     }
bernd First draft of gitolite-mod...

bernd authored 13 years ago

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

Bernd Wurst authored 13 years ago

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

Hanno authored 7 years ago

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

Bernd Wurst authored 13 years ago

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

Hanno authored 7 years ago

74)     $sure = user_is_sure();
75)     if ($sure === null) {
Hanno Böck Spaces between string conca...

Hanno Böck authored 2 years ago

76)         are_you_sure("foreignhandle={$_GET['foreignhandle']}", '<p>Soll der GIT-Benutzer »' . $_GET['foreignhandle'] . '« wirklich aus Ihrer Konfiguration werden?</p>');
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

77)     } elseif ($sure === true) {
78)         delete_foreign_user($_GET['foreignhandle']);
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 2 years ago

79)         if (!$debugmode) {
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

80)             header('Location: git');
81)         }
82)         die();
83)     } elseif ($sure === false) {
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 2 years ago

84)         if (!$debugmode) {
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

85)             header("Location: git");
86)         }
87)         die();
88)     }