Browse code

Fix codingstyle

Hanno authored on 27/10/2019 08:54:14
Showing 1 changed files
... ...
@@ -92,4 +92,3 @@ $form .= '</td></tr></table>';
92 92
 $form .= '<p><input type="submit" value="Speichern" /></p>';
93 93
 
94 94
 output(html_form('git_edit', 'save', 'action='.$action, $form));
95
-
Browse code

Umstellung von filter_input_general() auf filter_output_html()

Bernd Wurst authored on 21/09/2019 17:07:48
Showing 1 changed files
... ...
@@ -40,7 +40,7 @@ if (isset($_GET['repo']) && isset($repos[$_GET['repo']])) {
40 40
     $action = 'editrepo';
41 41
     title("Zugriff auf GIT-Repository ändern");
42 42
     output("<p>Legen Sie hier fest, welche Berechtigungen für welche SSH-Keys gelten sollen.</p>");
43
-    $form .= '<table><tr><td>Name des Repository</td><td><input type="hidden" name="repo" value="'.filter_input_general($_GET['repo']).'" />'.filter_input_general($_GET['repo']).'</td></tr>';
43
+    $form .= '<table><tr><td>Name des Repository</td><td><input type="hidden" name="repo" value="'.filter_output_html($_GET['repo']).'" />'.filter_output_html($_GET['repo']).'</td></tr>';
44 44
 } else {
45 45
     $action = 'newrepo';
46 46
     title("Neues GIT-Repository anlegen");
... ...
@@ -87,8 +87,9 @@ $checked = (isset($_GET['repo']) && isset($repos[$_GET['repo']]) && isset($repos
87 87
 $description = (isset($_GET['repo']) && isset($repos[$_GET['repo']])) ? $repos[$_GET['repo']]['description'] : '';
88 88
 $disabled = $checked ? '' : ' disabled="disabled"';
89 89
 $form .= '<p><input type="checkbox" name="gitweb" id="gitweb" value="r"'.$checked.' onclick="showDescription()" /> <label for="gitweb">Öffentlicher Lesezugriff via gitweb</label><br />
90
-<label for="description">Beschreibung des Repository:</label> <input type="text" name="description" id="description" value="'.$description.'"'.$disabled.' /></p>';
90
+<label for="description">Beschreibung des Repository:</label> <input type="text" name="description" id="description" value="'.filter_output_html($description).'"'.$disabled.' /></p>';
91 91
 $form .= '</td></tr></table>';
92 92
 $form .= '<p><input type="submit" value="Speichern" /></p>';
93 93
 
94 94
 output(html_form('git_edit', 'save', 'action='.$action, $form));
95
+
Browse code

Fix coding style with php-cs-checker, see https://cs.sensiolabs.org/

Hanno authored on 26/06/2018 13:58:19
Showing 1 changed files
... ...
@@ -8,7 +8,7 @@ Written 2008-2018 by schokokeks.org Hosting, namely
8 8
 
9 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 10
 
11
-You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
11
+You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
12 12
 http://creativecommons.org/publicdomain/zero/1.0/
13 13
 
14 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.
... ...
@@ -37,24 +37,24 @@ html_header("<script type=\"text/javascript\">
37 37
 ");
38 38
 
39 39
 if (isset($_GET['repo']) && isset($repos[$_GET['repo']])) {
40
-  $action = 'editrepo';
41
-  title("Zugriff auf GIT-Repository ändern");
42
-  output("<p>Legen Sie hier fest, welche Berechtigungen für welche SSH-Keys gelten sollen.</p>");
43
-  $form .= '<table><tr><td>Name des Repository</td><td><input type="hidden" name="repo" value="'.filter_input_general($_GET['repo']).'" />'.filter_input_general($_GET['repo']).'</td></tr>';
40
+    $action = 'editrepo';
41
+    title("Zugriff auf GIT-Repository ändern");
42
+    output("<p>Legen Sie hier fest, welche Berechtigungen für welche SSH-Keys gelten sollen.</p>");
43
+    $form .= '<table><tr><td>Name des Repository</td><td><input type="hidden" name="repo" value="'.filter_input_general($_GET['repo']).'" />'.filter_input_general($_GET['repo']).'</td></tr>';
44 44
 } else {
45
-  $action = 'newrepo';
46
-  title("Neues GIT-Repository anlegen");
47
-  output("<p>Geben Sie einen Namen für das neue Repository an und legen Sie fest, welche Berechtigungen für welche SSH-Keys gelten sollen.</p>");
48
-  $form .= '<table><tr><td><label for="repo">Name des Repository</label></td><td><input type="text" id="repo" name="repo" /></td></tr>';
45
+    $action = 'newrepo';
46
+    title("Neues GIT-Repository anlegen");
47
+    output("<p>Geben Sie einen Namen für das neue Repository an und legen Sie fest, welche Berechtigungen für welche SSH-Keys gelten sollen.</p>");
48
+    $form .= '<table><tr><td><label for="repo">Name des Repository</label></td><td><input type="text" id="repo" name="repo" /></td></tr>';
49 49
 }
50 50
 
51 51
 $form .= '<tr><td>Berechtigungen</td><td>';
52 52
 foreach ($users as $user) {
53
-  $r = $rw = $rwplus = '';
54
-  if (isset($_GET['repo']) && isset($repos[$_GET['repo']])) {
55
-    $permissions = $repos[$_GET['repo']]['users'];
56
-    if (isset($permissions[$user])) {
57
-      switch ($permissions[$user]) {
53
+    $r = $rw = $rwplus = '';
54
+    if (isset($_GET['repo']) && isset($repos[$_GET['repo']])) {
55
+        $permissions = $repos[$_GET['repo']]['users'];
56
+        if (isset($permissions[$user])) {
57
+            switch ($permissions[$user]) {
58 58
         case 'RW+': $rwplus = ' selected="selected"';
59 59
                     break;
60 60
         case 'RW': $rw = ' selected="selected"';
... ...
@@ -62,16 +62,16 @@ foreach ($users as $user) {
62 62
         case 'R': $r = ' selected="selected"';
63 63
                   break;
64 64
       }
65
+        }
65 66
     }
66
-  }
67
-  $form .= '<p>'.$user.': <select name="'.$user.'"><option value="-">Zugriff verweigern</option><option value="r"'.$r.'>Lesezugriff erlauben</option><option value="rw"'.$rw.'>Lese- und Schreibzugriff</option><option value="rwplus"'.$rwplus.'>erweiterter Lese- und Schreibzugriff (inkl. &quot;rewind&quot;)</option></select></p>';
67
+    $form .= '<p>'.$user.': <select name="'.$user.'"><option value="-">Zugriff verweigern</option><option value="r"'.$r.'>Lesezugriff erlauben</option><option value="rw"'.$rw.'>Lese- und Schreibzugriff</option><option value="rwplus"'.$rwplus.'>erweiterter Lese- und Schreibzugriff (inkl. &quot;rewind&quot;)</option></select></p>';
68 68
 }
69 69
 foreach ($foreign_users as $user) {
70
-  $r = $rw = $rwplus = '';
71
-  if (isset($_GET['repo']) && isset($repos[$_GET['repo']])) {
72
-    $permissions = $repos[$_GET['repo']]['users'];
73
-    if (isset($permissions[$user])) {
74
-      switch ($permissions[$user]) {
70
+    $r = $rw = $rwplus = '';
71
+    if (isset($_GET['repo']) && isset($repos[$_GET['repo']])) {
72
+        $permissions = $repos[$_GET['repo']]['users'];
73
+        if (isset($permissions[$user])) {
74
+            switch ($permissions[$user]) {
75 75
         case 'RW+': $rwplus = ' selected="selected"';
76 76
                     break;
77 77
         case 'RW': $rw = ' selected="selected"';
... ...
@@ -79,9 +79,9 @@ foreach ($foreign_users as $user) {
79 79
         case 'R': $r = ' selected="selected"';
80 80
                   break;
81 81
       }
82
+        }
82 83
     }
83
-  }
84
-  $form .= '<p>'.$user.': <select name="'.$user.'"><option value="-">Zugriff verweigern</option><option value="r"'.$r.'>Lesezugriff erlauben</option><option value="rw"'.$rw.'>Lese- und Schreibzugriff</option><option value="rwplus"'.$rwplus.'>erweiterter Lese- und Schreibzugriff (inkl. &quot;rewind&quot;)</option></select></p>';
84
+    $form .= '<p>'.$user.': <select name="'.$user.'"><option value="-">Zugriff verweigern</option><option value="r"'.$r.'>Lesezugriff erlauben</option><option value="rw"'.$rw.'>Lese- und Schreibzugriff</option><option value="rwplus"'.$rwplus.'>erweiterter Lese- und Schreibzugriff (inkl. &quot;rewind&quot;)</option></select></p>';
85 85
 }
86 86
 $checked = (isset($_GET['repo']) && isset($repos[$_GET['repo']]) && isset($repos[$_GET['repo']]['users']['gitweb']) && $repos[$_GET['repo']]['users']['gitweb'] == 'R') ? ' checked="checked"' : '';
87 87
 $description = (isset($_GET['repo']) && isset($repos[$_GET['repo']])) ? $repos[$_GET['repo']]['description'] : '';
... ...
@@ -92,4 +92,3 @@ $form .= '</td></tr></table>';
92 92
 $form .= '<p><input type="submit" value="Speichern" /></p>';
93 93
 
94 94
 output(html_form('git_edit', 'save', 'action='.$action, $form));
95
-
Browse code

Copyright year update

Bernd Wurst authored on 13/01/2018 06:07:05
Showing 1 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 /*
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting
4 4
 
5
-Written 2008-2014 by schokokeks.org Hosting, namely
5
+Written 2008-2018 by schokokeks.org Hosting, namely
6 6
   Bernd Wurst <bernd@schokokeks.org>
7 7
   Hanno Böck <hanno@schokokeks.org>
8 8
 
Browse code

Lizenzinfos in eigenes Modul ausgelagert und Copyright auf 2014 angepasst

Bernd Wurst authored on 08/02/2014 05:45:07
Showing 1 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 /*
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting
4 4
 
5
-Written 2008-2013 by schokokeks.org Hosting, namely
5
+Written 2008-2014 by schokokeks.org Hosting, namely
6 6
   Bernd Wurst <bernd@schokokeks.org>
7 7
   Hanno Böck <hanno@schokokeks.org>
8 8
 
Browse code

Updated copyright notice (2012 => 2013)

Bernd Wurst authored on 19/01/2013 10:49:50
Showing 1 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 /*
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting
4 4
 
5
-Written 2008-2012 by schokokeks.org Hosting, namely
5
+Written 2008-2013 by schokokeks.org Hosting, namely
6 6
   Bernd Wurst <bernd@schokokeks.org>
7 7
   Hanno Böck <hanno@schokokeks.org>
8 8
 
Browse code

add foreign git users and grant permissions to them

Bernd Wurst authored on 12/03/2012 09:31:30
Showing 1 changed files
... ...
@@ -22,6 +22,7 @@ $section = 'git_git';
22 22
 
23 23
 $repos = list_repos();
24 24
 $users = list_users();
25
+$foreign_users = list_foreign_users();
25 26
 
26 27
 $action = '';
27 28
 $form = '';
... ...
@@ -65,6 +66,23 @@ foreach ($users as $user) {
65 66
   }
66 67
   $form .= '<p>'.$user.': <select name="'.$user.'"><option value="-">Zugriff verweigern</option><option value="r"'.$r.'>Lesezugriff erlauben</option><option value="rw"'.$rw.'>Lese- und Schreibzugriff</option><option value="rwplus"'.$rwplus.'>erweiterter Lese- und Schreibzugriff (inkl. &quot;rewind&quot;)</option></select></p>';
67 68
 }
69
+foreach ($foreign_users as $user) {
70
+  $r = $rw = $rwplus = '';
71
+  if (isset($_GET['repo']) && isset($repos[$_GET['repo']])) {
72
+    $permissions = $repos[$_GET['repo']]['users'];
73
+    if (isset($permissions[$user])) {
74
+      switch ($permissions[$user]) {
75
+        case 'RW+': $rwplus = ' selected="selected"';
76
+                    break;
77
+        case 'RW': $rw = ' selected="selected"';
78
+                   break;
79
+        case 'R': $r = ' selected="selected"';
80
+                  break;
81
+      }
82
+    }
83
+  }
84
+  $form .= '<p>'.$user.': <select name="'.$user.'"><option value="-">Zugriff verweigern</option><option value="r"'.$r.'>Lesezugriff erlauben</option><option value="rw"'.$rw.'>Lese- und Schreibzugriff</option><option value="rwplus"'.$rwplus.'>erweiterter Lese- und Schreibzugriff (inkl. &quot;rewind&quot;)</option></select></p>';
85
+}
68 86
 $checked = (isset($_GET['repo']) && isset($repos[$_GET['repo']]) && isset($repos[$_GET['repo']]['users']['gitweb']) && $repos[$_GET['repo']]['users']['gitweb'] == 'R') ? ' checked="checked"' : '';
69 87
 $description = (isset($_GET['repo']) && isset($repos[$_GET['repo']])) ? $repos[$_GET['repo']]['description'] : '';
70 88
 $disabled = $checked ? '' : ' disabled="disabled"';
Browse code

Added license tags for CC0, README and COPYING

Bernd Wurst authored on 11/03/2012 15:40:04
Showing 1 changed files
... ...
@@ -1,4 +1,19 @@
1 1
 <?php
2
+/*
3
+This file belongs to the Webinterface of schokokeks.org Hosting
4
+
5
+Written 2008-2012 by schokokeks.org Hosting, namely
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
+
2 17
 require_role(ROLE_SYSTEMUSER);
3 18
 
4 19
 include("git.php");
Browse code

Bessere Handhabung öffentlich abrufbarer Repositories

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@2095 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on 21/12/2011 16:51:53
Showing 1 changed files
... ...
@@ -11,6 +11,15 @@ $users = list_users();
11 11
 $action = '';
12 12
 $form = '';
13 13
 
14
+html_header("<script type=\"text/javascript\">
15
+  function showDescription( ) {
16
+    var do_it = (document.getElementById('gitweb').checked == false);
17
+    var inputfield = document.getElementById('description');
18
+    inputfield.disabled = do_it;
19
+    }
20
+</script>
21
+");
22
+
14 23
 if (isset($_GET['repo']) && isset($repos[$_GET['repo']])) {
15 24
   $action = 'editrepo';
16 25
   title("Zugriff auf GIT-Repository ändern");
... ...
@@ -43,8 +52,9 @@ foreach ($users as $user) {
43 52
 }
44 53
 $checked = (isset($_GET['repo']) && isset($repos[$_GET['repo']]) && isset($repos[$_GET['repo']]['users']['gitweb']) && $repos[$_GET['repo']]['users']['gitweb'] == 'R') ? ' checked="checked"' : '';
45 54
 $description = (isset($_GET['repo']) && isset($repos[$_GET['repo']])) ? $repos[$_GET['repo']]['description'] : '';
46
-$form .= '<p><input type="checkbox" name="gitweb" id="gitweb" value="r"'.$checked.' /> <label for="gitweb">Öffentlicher Lesezugriff via gitweb</label><br />
47
-<label for="description">Beschreibung des Repository:</label> <input type="text" name="description" id="description" value="'.$description.'" /></p>';
55
+$disabled = $checked ? '' : ' disabled="disabled"';
56
+$form .= '<p><input type="checkbox" name="gitweb" id="gitweb" value="r"'.$checked.' onclick="showDescription()" /> <label for="gitweb">Öffentlicher Lesezugriff via gitweb</label><br />
57
+<label for="description">Beschreibung des Repository:</label> <input type="text" name="description" id="description" value="'.$description.'"'.$disabled.' /></p>';
48 58
 $form .= '</td></tr></table>';
49 59
 $form .= '<p><input type="submit" value="Speichern" /></p>';
50 60
 
Browse code

Setze Berechtigung für gitweb und Beschreibung

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@2094 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on 21/12/2011 16:51:53
Showing 1 changed files
... ...
@@ -6,7 +6,6 @@ include("git.php");
6 6
 $section = 'git_git';
7 7
 
8 8
 $repos = list_repos();
9
-
10 9
 $users = list_users();
11 10
 
12 11
 $action = '';
... ...
@@ -28,9 +27,9 @@ $form .= '<tr><td>Berechtigungen</td><td>';
28 27
 foreach ($users as $user) {
29 28
   $r = $rw = $rwplus = '';
30 29
   if (isset($_GET['repo']) && isset($repos[$_GET['repo']])) {
31
-    $repo = $repos[$_GET['repo']];
32
-    if (isset($repo[$user])) {
33
-      switch ($repo[$user]) {
30
+    $permissions = $repos[$_GET['repo']]['users'];
31
+    if (isset($permissions[$user])) {
32
+      switch ($permissions[$user]) {
34 33
         case 'RW+': $rwplus = ' selected="selected"';
35 34
                     break;
36 35
         case 'RW': $rw = ' selected="selected"';
... ...
@@ -40,8 +39,12 @@ foreach ($users as $user) {
40 39
       }
41 40
     }
42 41
   }
43
-  $form .= $user.': <select name="'.$user.'"><option value="-">Zugriff verweigern</option><option value="r"'.$r.'>Lesezugriff erlauben</option><option value="rw"'.$rw.'>Lese- und Schreibzugriff</option><option value="rwplus"'.$rwplus.'>erweiterter Lese- und Schreibzugriff (inkl. &quot;rewind&quot;)</option></select><br />';
42
+  $form .= '<p>'.$user.': <select name="'.$user.'"><option value="-">Zugriff verweigern</option><option value="r"'.$r.'>Lesezugriff erlauben</option><option value="rw"'.$rw.'>Lese- und Schreibzugriff</option><option value="rwplus"'.$rwplus.'>erweiterter Lese- und Schreibzugriff (inkl. &quot;rewind&quot;)</option></select></p>';
44 43
 }
44
+$checked = (isset($_GET['repo']) && isset($repos[$_GET['repo']]) && isset($repos[$_GET['repo']]['users']['gitweb']) && $repos[$_GET['repo']]['users']['gitweb'] == 'R') ? ' checked="checked"' : '';
45
+$description = (isset($_GET['repo']) && isset($repos[$_GET['repo']])) ? $repos[$_GET['repo']]['description'] : '';
46
+$form .= '<p><input type="checkbox" name="gitweb" id="gitweb" value="r"'.$checked.' /> <label for="gitweb">Öffentlicher Lesezugriff via gitweb</label><br />
47
+<label for="description">Beschreibung des Repository:</label> <input type="text" name="description" id="description" value="'.$description.'" /></p>';
45 48
 $form .= '</td></tr></table>';
46 49
 $form .= '<p><input type="submit" value="Speichern" /></p>';
47 50
 
Browse code

Fürs erste feature-complete

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@2092 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on 21/12/2011 16:51:52
Showing 1 changed files
... ...
@@ -5,6 +5,45 @@ include("git.php");
5 5
 
6 6
 $section = 'git_git';
7 7
 
8
+$repos = list_repos();
8 9
 
10
+$users = list_users();
9 11
 
12
+$action = '';
13
+$form = '';
14
+
15
+if (isset($_GET['repo']) && isset($repos[$_GET['repo']])) {
16
+  $action = 'editrepo';
17
+  title("Zugriff auf GIT-Repository ändern");
18
+  output("<p>Legen Sie hier fest, welche Berechtigungen für welche SSH-Keys gelten sollen.</p>");
19
+  $form .= '<table><tr><td>Name des Repository</td><td><input type="hidden" name="repo" value="'.filter_input_general($_GET['repo']).'" />'.filter_input_general($_GET['repo']).'</td></tr>';
20
+} else {
21
+  $action = 'newrepo';
22
+  title("Neues GIT-Repository anlegen");
23
+  output("<p>Geben Sie einen Namen für das neue Repository an und legen Sie fest, welche Berechtigungen für welche SSH-Keys gelten sollen.</p>");
24
+  $form .= '<table><tr><td><label for="repo">Name des Repository</label></td><td><input type="text" id="repo" name="repo" /></td></tr>';
25
+}
26
+
27
+$form .= '<tr><td>Berechtigungen</td><td>';
28
+foreach ($users as $user) {
29
+  $r = $rw = $rwplus = '';
30
+  if (isset($_GET['repo']) && isset($repos[$_GET['repo']])) {
31
+    $repo = $repos[$_GET['repo']];
32
+    if (isset($repo[$user])) {
33
+      switch ($repo[$user]) {
34
+        case 'RW+': $rwplus = ' selected="selected"';
35
+                    break;
36
+        case 'RW': $rw = ' selected="selected"';
37
+                   break;
38
+        case 'R': $r = ' selected="selected"';
39
+                  break;
40
+      }
41
+    }
42
+  }
43
+  $form .= $user.': <select name="'.$user.'"><option value="-">Zugriff verweigern</option><option value="r"'.$r.'>Lesezugriff erlauben</option><option value="rw"'.$rw.'>Lese- und Schreibzugriff</option><option value="rwplus"'.$rwplus.'>erweiterter Lese- und Schreibzugriff (inkl. &quot;rewind&quot;)</option></select><br />';
44
+}
45
+$form .= '</td></tr></table>';
46
+$form .= '<p><input type="submit" value="Speichern" /></p>';
47
+
48
+output(html_form('git_edit', 'save', 'action='.$action, $form));
10 49
 
Browse code

First draft of gitolite-module, only key-management implemented

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@2091 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on 21/12/2011 16:51:51
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,10 @@
1
+<?php
2
+require_role(ROLE_SYSTEMUSER);
3
+
4
+include("git.php");
5
+
6
+$section = 'git_git';
7
+
8
+
9
+
10
+