File inc/repo.inc.php changed (mode: 100644) (index 783f9d6..28c981c) |
... |
... |
$rg_repo_path_rights = array( |
32 |
32 |
); |
); |
33 |
33 |
|
|
34 |
34 |
$rg_repo_rights = array( |
$rg_repo_rights = array( |
35 |
|
"A" => "Access repo", |
|
36 |
|
"E" => "Create/edit repo", |
|
37 |
|
"D" => "Delete repo", |
|
|
35 |
|
'A' => 'Access repo', |
|
36 |
|
'a' => 'Access bug tracker', |
|
37 |
|
'B' => 'Add bugs', |
|
38 |
|
'C' => 'Close bugs', |
|
39 |
|
'D' => 'Delete repo', |
|
40 |
|
'd' => 'Delete bugs', |
|
41 |
|
'E' => 'Create/edit repo', |
|
42 |
|
'G' => 'Grant rights', |
38 |
43 |
'K' => 'Lock repo', |
'K' => 'Lock repo', |
39 |
|
"G" => "Grant rights", |
|
40 |
|
"a" => "Access bug tracker", |
|
41 |
|
"B" => "Add bugs", |
|
42 |
|
"r" => "Reopen bugs", |
|
43 |
|
"d" => "Delete bugs", |
|
44 |
|
"C" => "Close bugs", |
|
|
44 |
|
'r' => 'Reopen bugs', |
|
45 |
|
'T' => 'Delete artifacts', |
|
46 |
|
't' => 'Access artifacts', |
45 |
47 |
'W' => 'Manage hooks' |
'W' => 'Manage hooks' |
46 |
48 |
); |
); |
47 |
49 |
|
|
|
... |
... |
rg_rights_register("repo_refs", $rg_repo_refs_rights, "FMH", |
52 |
54 |
"rg_repo_compare_refs", "rg_repo_rights_inject"); |
"rg_repo_compare_refs", "rg_repo_rights_inject"); |
53 |
55 |
rg_rights_register("repo_path", $rg_repo_path_rights, "P", |
rg_rights_register("repo_path", $rg_repo_path_rights, "P", |
54 |
56 |
"rg_repo_compare_paths", "rg_repo_rights_inject"); |
"rg_repo_compare_paths", "rg_repo_rights_inject"); |
55 |
|
rg_rights_register("repo", $rg_repo_rights, "AaB", |
|
|
57 |
|
rg_rights_register("repo", $rg_repo_rights, 'AaBt', |
56 |
58 |
FALSE, "rg_repo_rights_inject"); |
FALSE, "rg_repo_rights_inject"); |
57 |
59 |
|
|
58 |
60 |
|
|
|
... |
... |
function rg_repo_rights_inject($db, $obj_id, $type, $owner, $uid) |
298 |
300 |
|
|
299 |
301 |
if (strcmp($type, "repo") == 0) { |
if (strcmp($type, "repo") == 0) { |
300 |
302 |
$a['uid'] = 0; |
$a['uid'] = 0; |
301 |
|
$a['rights'] = "AaB"; // access repo + access bug tracker + add bugs |
|
302 |
|
$a['rights'] = "Aa"; // access repo + access bug tracker + add bugs |
|
|
303 |
|
$a['rights'] = 'AaBt'; |
303 |
304 |
$a['description'] = 'Autogenerated (repo is public)'; |
$a['description'] = 'Autogenerated (repo is public)'; |
304 |
305 |
$ret[] = $a; |
$ret[] = $a; |
305 |
306 |
} else if (strcmp($type, "repo_refs") == 0) { |
} else if (strcmp($type, "repo_refs") == 0) { |
|
... |
... |
function rg_repo_edit_high_level($db, &$rg) |
1898 |
1899 |
if (!$edit) { |
if (!$edit) { |
1899 |
1900 |
// Defaults |
// Defaults |
1900 |
1901 |
$rg['ri'] = array(); |
$rg['ri'] = array(); |
|
1902 |
|
$rg['ri']['exists'] = 0; |
1901 |
1903 |
$rg['ri']['repo_id'] = '0'; |
$rg['ri']['repo_id'] = '0'; |
1902 |
1904 |
$rg['ri']['master'] = '0'; |
$rg['ri']['master'] = '0'; |
1903 |
1905 |
$rg['ri']['name'] = ''; |
$rg['ri']['name'] = ''; |
|
... |
... |
function rg_repo_stats($rg) |
2211 |
2213 |
} |
} |
2212 |
2214 |
|
|
2213 |
2215 |
$path = rg_repo_path_by_id($rg['ri']['uid'], $rg['ri']['repo_id']); |
$path = rg_repo_path_by_id($rg['ri']['uid'], $rg['ri']['repo_id']); |
|
2216 |
|
|
|
2217 |
|
$r = rg_git_repo_is_empty($path); |
|
2218 |
|
if ($r == -1) { |
|
2219 |
|
$ret = rg_template('internal_err.html', $rg, TRUE /*xss*/); |
|
2220 |
|
break; |
|
2221 |
|
} |
|
2222 |
|
if ($r == 1) { |
|
2223 |
|
$ret = rg_template('repo/err/not_init.html', $rg, TRUE /*xss*/); |
|
2224 |
|
break; |
|
2225 |
|
} |
|
2226 |
|
|
2214 |
2227 |
$log = rg_git_log($path, 0 /*max*/, '', '', FALSE /*also_patch*/, |
$log = rg_git_log($path, 0 /*max*/, '', '', FALSE /*also_patch*/, |
2215 |
2228 |
0 /*patch_limit*/); |
0 /*patch_limit*/); |
2216 |
2229 |
if ($log === FALSE) { |
if ($log === FALSE) { |