e31f1e42197d87dcf16ecb5b8f45e4810a75c2b2
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 Lizenzinfos in eigenes Modu...

Bernd Wurst authored 10 years ago

5) Written 2008-2014 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) 
11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
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'])) {
24)   $repos = list_repos();
25)   if (!array_key_exists($_GET['repo'], $repos)) {
26)     system_failure("Es sollte ein unbekanntes Repository gelöscht werden!");
27)   }
28) 
29)   $sure = user_is_sure();
30)   if ($sure === NULL)
31)   {
32)     are_you_sure("repo={$_GET['repo']}", '<p>Soll das GIT-Repository »'.$_GET['repo'].'« wirklich gelöscht werden?</p>
33)     <p>Alle Inhalte die in diesem Repository gespeichert sind, werden gelöscht!</p>');
34)   }
35)   elseif ($sure === true)
36)   {
bernd Fürs erste feature-complete

bernd authored 12 years ago

37)     delete_repo($_GET['repo']);
bernd First draft of gitolite-mod...

bernd authored 12 years ago

38)     if (! $debugmode)
39)       header('Location: git');
40)     die();
41)   }
42)   elseif ($sure === false)
43)   {
44)     if (! $debugmode)
45)       header("Location: git");
46)     die();
47)   }
48) }
49) 
50) if (isset($_GET['handle'])) {
51)   $users = list_users();
52)   if (!in_array($_GET['handle'], $users)) {
Bernd Wurst add foreign git users and g...

Bernd Wurst authored 12 years ago

53)     system_failure("Es sollte ein unbekannter Benutzer gelöscht werden!");
bernd First draft of gitolite-mod...

bernd authored 12 years ago

54)   }
55) 
56)   $sure = user_is_sure();
57)   if ($sure === NULL)
58)   {
59)     are_you_sure("handle={$_GET['handle']}", '<p>Soll der SSH-Key »'.$_GET['handle'].'« wirklich gelöscht werden?</p>');
60)   }
61)   elseif ($sure === true)
62)   {
63)     delete_key($_GET['handle']);
64)     if (! $debugmode)
65)       header('Location: git');
66)     die();
67)   }
68)   elseif ($sure === false)
69)   {
70)     if (! $debugmode)
71)       header("Location: git");
72)     die();
73)   }
74) }