2626dd47daad110c63a82c0560b134e2364eeac3
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) 
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 5 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 12 years ago

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

Hanno authored 5 years ago

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

bernd authored 12 years ago

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

Hanno authored 5 years ago

29)     $sure = user_is_sure();
30)     if ($sure === null) {
31)         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

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

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

bernd authored 12 years ago

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

Hanno authored 5 years ago

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

bernd authored 12 years ago

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

Hanno authored 5 years ago

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

bernd authored 12 years ago

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

Bernd Wurst authored 12 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 12 years ago

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

Hanno authored 5 years ago

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