354c05a4ddd678c49bcbba458bffa7d13482139a
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) {
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

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']);
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 6 months ago

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

Hanno authored 5 years ago

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

Hanno Böck authored 6 months ago

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

Hanno authored 5 years ago

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) {
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

52)         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 5 years ago

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

Hanno Böck authored 6 months ago

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

Hanno authored 5 years ago

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

Hanno Böck authored 6 months ago

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

Hanno authored 5 years ago

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) {
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

75)         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 5 years ago

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

Hanno Böck authored 6 months ago

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

Hanno authored 5 years ago

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

Hanno Böck authored 6 months ago

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

Hanno authored 5 years ago

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