Hanno Böck This code is published under a 0BSD license. 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. */ require_role(ROLE_SYSTEMUSER); include("git.php"); $section = 'git_git'; $repos = list_repos(); $users = list_users(); $foreign_users = list_foreign_users(); $action = ''; $form = ''; html_header(" "); if (isset($_GET['repo']) && isset($repos[$_GET['repo']])) { $action = 'editrepo'; title("Zugriff auf GIT-Repository ändern"); output("

Legen Sie hier fest, welche Berechtigungen für welche SSH-Keys gelten sollen.

"); $form .= ''; } else { $action = 'newrepo'; title("Neues GIT-Repository anlegen"); output("

Geben Sie einen Namen für das neue Repository an und legen Sie fest, welche Berechtigungen für welche SSH-Keys gelten sollen.

"); $form .= '
Name des Repository'.filter_output_html($_GET['repo']).'
'; } $form .= '
Berechtigungen'; foreach ($users as $user) { $r = $rw = $rwplus = ''; if (isset($_GET['repo']) && isset($repos[$_GET['repo']])) { $permissions = $repos[$_GET['repo']]['users']; if (isset($permissions[$user])) { switch ($permissions[$user]) { case 'RW+': $rwplus = ' selected="selected"'; break; case 'RW': $rw = ' selected="selected"'; break; case 'R': $r = ' selected="selected"'; break; } } } $form .= '

'.$user.':

'; } foreach ($foreign_users as $user) { $r = $rw = $rwplus = ''; if (isset($_GET['repo']) && isset($repos[$_GET['repo']])) { $permissions = $repos[$_GET['repo']]['users']; if (isset($permissions[$user])) { switch ($permissions[$user]) { case 'RW+': $rwplus = ' selected="selected"'; break; case 'RW': $rw = ' selected="selected"'; break; case 'R': $r = ' selected="selected"'; break; } } } $form .= '

'.$user.':

'; } $checked = (isset($_GET['repo']) && isset($repos[$_GET['repo']]) && isset($repos[$_GET['repo']]['users']['gitweb']) && $repos[$_GET['repo']]['users']['gitweb'] == 'R') ? ' checked="checked"' : ''; $description = (isset($_GET['repo']) && isset($repos[$_GET['repo']])) ? $repos[$_GET['repo']]['description'] : ''; $disabled = $checked ? '' : ' disabled="disabled"'; $form .= '


'; $form .= '
'; $form .= '

'; output(html_form('git_edit', 'save', 'action='.$action, $form));