File inc/user/repo/delete/delete.php changed (mode: 100644) (index fab6c27..2dba86d) |
1 |
1 |
<?php |
<?php |
2 |
2 |
rg_log("/inc/user/repo/delete/delete"); |
rg_log("/inc/user/repo/delete/delete"); |
3 |
3 |
|
|
|
4 |
|
$are_you_sure = rg_var_uint("are_you_sure"); |
|
5 |
|
|
|
6 |
|
$repo_delete_more = $repo_admin_more; |
4 |
7 |
$_delete = ""; |
$_delete = ""; |
5 |
8 |
|
|
6 |
9 |
$errmsg = array(); |
$errmsg = array(); |
7 |
10 |
|
|
8 |
|
do { |
|
9 |
|
$r = rg_repo_delete($db, $ri['repo_id'], $rg_ui); |
|
10 |
|
if ($r === FALSE) { |
|
11 |
|
$errmsg[] = rg_repo_error(); |
|
12 |
|
break; |
|
|
11 |
|
$_show_form = 1; |
|
12 |
|
if ($doit == 1) { |
|
13 |
|
if ($are_you_sure == 0) { |
|
14 |
|
$_delete .= rg_template("user/repo/delete/no.html", $repo_delete_more); |
|
15 |
|
$_show_form = 0; |
|
16 |
|
} else { |
|
17 |
|
do { |
|
18 |
|
if (!rg_token_valid($db, $sid, $token)) { |
|
19 |
|
$del_errmsg[] = "invalid token; try again"; |
|
20 |
|
break; |
|
21 |
|
} |
|
22 |
|
|
|
23 |
|
$r = rg_repo_delete($db, $ri['repo_id'], $rg_ui); |
|
24 |
|
if ($r === FALSE) { |
|
25 |
|
$errmsg[] = rg_repo_error(); |
|
26 |
|
break; |
|
27 |
|
} |
|
28 |
|
|
|
29 |
|
$_delete .= rg_template("user/repo/delete/done.html", $repo_delete_more); |
|
30 |
|
$_show_form = 0; |
|
31 |
|
} while (0); |
13 |
32 |
} |
} |
14 |
|
} while (0); |
|
15 |
|
|
|
16 |
|
$_err = implode("<br />\n", $errmsg); |
|
17 |
|
if (!empty($_err)) { |
|
18 |
|
$_delete .= $_err; |
|
19 |
|
} else { |
|
20 |
|
// redirect to repo page |
|
21 |
|
$url = rg_re_userpage($rg_ui); |
|
22 |
|
rg_redirect($url); |
|
|
33 |
|
} |
|
34 |
|
|
|
35 |
|
if ($_show_form == 1) { |
|
36 |
|
$repo_delete_more['HTML:errmsg'] = rg_template_errmsg($errmsg); |
|
37 |
|
$repo_delete_more['rg_form_token'] = rg_token_get($db, $sid); |
|
38 |
|
$_delete .= rg_template("user/repo/delete/sure.html", $repo_delete_more); |
23 |
39 |
} |
} |
24 |
40 |
|
|
25 |
41 |
?> |
?> |
File inc/user/repo/rights/rights.php changed (mode: 100644) (index 7eb1660..cef3b69) |
... |
... |
$repo_rights_more = $repo_admin_more; |
5 |
5 |
$_rights = ""; |
$_rights = ""; |
6 |
6 |
|
|
7 |
7 |
$target_user = rg_var_str("target_user"); |
$target_user = rg_var_str("target_user"); |
8 |
|
$rights = rg_rights_a2s(rg_var_str("rights")); |
|
9 |
|
$remove_uid = rg_var_uint("remove_uid"); |
|
|
8 |
|
$rights = isset($_REQUEST['rights']) ? rg_rights_a2s(rg_var_str("rights")) : $rg_repo_rights_default; |
|
9 |
|
$delete = rg_var_uint("delete"); |
10 |
10 |
$edit_uid = rg_var_uint("edit_uid"); |
$edit_uid = rg_var_uint("edit_uid"); |
|
11 |
|
$grant = rg_var_uint("grant"); |
|
12 |
|
$rights_delete_ids = rg_var_str("rights_delete_ids"); |
11 |
13 |
|
|
12 |
14 |
// we need it in forms |
// we need it in forms |
13 |
15 |
$repo_id = $ri['repo_id']; |
$repo_id = $ri['repo_id']; |
14 |
16 |
|
|
15 |
17 |
$errmsg = array(); |
$errmsg = array(); |
|
18 |
|
$del_errmsg = array(); |
16 |
19 |
|
|
17 |
|
rg_log("\tDEBUG remove_uid=$remove_uid"); |
|
|
20 |
|
$repo_rights_more['target_user'] = $target_user; |
|
21 |
|
$repo_rights_more['rights'] = $rights; |
18 |
22 |
|
|
19 |
|
while ($remove_uid > 0) { |
|
20 |
|
$e = rg_repo_rights_set($db, $ri, $remove_uid, ""); |
|
21 |
|
if ($e !== TRUE) { |
|
22 |
|
$errmsg[] = rg_repo_error(); |
|
|
23 |
|
while ($delete == 1) { |
|
24 |
|
if (!rg_token_valid($db, $sid, $token)) { |
|
25 |
|
$del_errmsg[] = "invalid token; try again"; |
|
26 |
|
break; |
|
27 |
|
} |
|
28 |
|
|
|
29 |
|
if (empty($rights_delete_ids)) { |
|
30 |
|
$del_errmsg[] = "No user(s) selected."; |
23 |
31 |
break; |
break; |
24 |
32 |
} |
} |
25 |
33 |
|
|
|
34 |
|
foreach ($rights_delete_ids as $remove_uid => $junk) { |
|
35 |
|
$e = rg_repo_rights_set($db, $ri, $remove_uid, ""); |
|
36 |
|
if ($e !== TRUE) { |
|
37 |
|
$del_errmsg[] = rg_repo_error(); |
|
38 |
|
break; |
|
39 |
|
} |
|
40 |
|
} |
|
41 |
|
|
26 |
42 |
break; |
break; |
27 |
43 |
} |
} |
28 |
44 |
|
|
|
... |
... |
while ($edit_uid > 0) { |
41 |
57 |
break; |
break; |
42 |
58 |
} |
} |
43 |
59 |
|
|
44 |
|
$target_user = $target_ui['username']; |
|
45 |
|
$rights = $r['rights']; |
|
|
60 |
|
$repo_rights_more['target_user'] = $target_ui['username']; |
|
61 |
|
$repo_rights_more['rights'] = $r['rights']; |
46 |
62 |
break; |
break; |
47 |
63 |
} |
} |
48 |
64 |
|
|
49 |
|
while ($doit == 1) { |
|
|
65 |
|
// Adding |
|
66 |
|
while ($grant == 1) { |
50 |
67 |
if (!rg_token_valid($db, $sid, $token)) { |
if (!rg_token_valid($db, $sid, $token)) { |
51 |
68 |
$errmsg[] = "invalid token; try again"; |
$errmsg[] = "invalid token; try again"; |
52 |
|
return; |
|
|
69 |
|
break; |
53 |
70 |
} |
} |
54 |
71 |
|
|
55 |
72 |
// lookup user |
// lookup user |
|
... |
... |
while ($doit == 1) { |
67 |
84 |
} |
} |
68 |
85 |
|
|
69 |
86 |
// no need to pre-fill user beause was just added |
// no need to pre-fill user beause was just added |
70 |
|
$target_user = ""; |
|
71 |
|
$rights = ""; |
|
|
87 |
|
$repo_rights_more['target_user'] = ""; |
|
88 |
|
$repo_rights_more['rights'] = ""; |
72 |
89 |
break; |
break; |
73 |
90 |
} |
} |
74 |
91 |
|
|
|
92 |
|
$repo_rights_more['rg_form_token'] = rg_token_get($db, $sid); |
|
93 |
|
$repo_rights_more['HTML:errmsg'] = rg_template_errmsg($errmsg); |
|
94 |
|
$repo_rights_more['HTML:del_errmsg'] = rg_template_errmsg($del_errmsg); |
|
95 |
|
$repo_rights_more['HTML:rights_checkboxes'] = rg_rights_checkboxes("repo", $rights); |
|
96 |
|
|
75 |
97 |
// list rights |
// list rights |
76 |
98 |
$rights_list = rg_repo_rights_load($db, $ri); |
$rights_list = rg_repo_rights_load($db, $ri); |
77 |
99 |
if ($rights_list === FALSE) |
if ($rights_list === FALSE) |
78 |
|
$_rights .= rg_warning("Cannot load rights. Try later"); |
|
|
100 |
|
$_rights .= rg_warning("Cannot load rights. Try later."); |
79 |
101 |
else |
else |
80 |
102 |
$_rights .= rg_template_table("user/repo/rights/list", $rights_list, $repo_rights_more); |
$_rights .= rg_template_table("user/repo/rights/list", $rights_list, $repo_rights_more); |
81 |
103 |
|
|
82 |
104 |
$_rights .= "<br />\n"; |
$_rights .= "<br />\n"; |
83 |
105 |
|
|
84 |
|
$repo_rights_more['rg_action'] = $cop; |
|
85 |
|
$repo_rights_more['rg_form_token'] = rg_token_get($db, $sid); |
|
86 |
|
$repo_rights_more['HTML:errmsg'] = rg_template_errmsg($errmsg); |
|
87 |
|
$repo_rights_more['HTML:rights_checkboxes'] = rg_rights_checkboxes("repo", $rights); |
|
88 |
106 |
$_rights .= rg_template("user/repo/rights/form.html", $repo_rights_more); |
$_rights .= rg_template("user/repo/rights/form.html", $repo_rights_more); |
89 |
107 |
?> |
?> |
File root/index.php changed (mode: 100644) (index d95974b..03d0592) |
2 |
2 |
error_reporting(E_ALL); |
error_reporting(E_ALL); |
3 |
3 |
ini_set("track_errors", "On"); |
ini_set("track_errors", "On"); |
4 |
4 |
|
|
|
5 |
|
$more = array(); |
5 |
6 |
$INC = dirname(__FILE__) . "/../inc"; |
$INC = dirname(__FILE__) . "/../inc"; |
6 |
7 |
require_once("/etc/rocketgit/config.php"); |
require_once("/etc/rocketgit/config.php"); |
7 |
8 |
require_once($INC . "/init.inc.php"); |
require_once($INC . "/init.inc.php"); |
|
... |
... |
$op = ""; $subop = ""; $subsubop = ""; $cop = ""; |
26 |
27 |
$rr = array("user" => "", "repo" => "", "prefix" => ""); |
$rr = array("user" => "", "repo" => "", "prefix" => ""); |
27 |
28 |
$paras = array(); |
$paras = array(); |
28 |
29 |
$rg_ui = array(); |
$rg_ui = array(); |
29 |
|
$more = array(); |
|
30 |
30 |
|
|
31 |
31 |
// We have variable 'vv' passed from webserver - build 'op' and rest of paras |
// We have variable 'vv' passed from webserver - build 'op' and rest of paras |
32 |
32 |
$vv = rg_var_str("vv"); |
$vv = rg_var_str("vv"); |
|
... |
... |
if ($rg_ui['uid'] > 0) |
146 |
146 |
else |
else |
147 |
147 |
$more['rg_username'] = ""; |
$more['rg_username'] = ""; |
148 |
148 |
|
|
|
149 |
|
|
|
150 |
|
// Some variables from the database |
|
151 |
|
$r = rg_state_get_uint($db, "first_install"); |
|
152 |
|
if ($r > 0) { |
|
153 |
|
$more['first_install_text'] = gmdate("Y-m-d H:i", $r); |
|
154 |
|
} else { |
|
155 |
|
$more['first_install_text'] = "?"; |
|
156 |
|
} |
|
157 |
|
|
|
158 |
|
|
149 |
159 |
rg_prof_end("MAIN"); |
rg_prof_end("MAIN"); |
150 |
160 |
|
|
151 |
161 |
// TODO: Do something with the profiling, here |
// TODO: Do something with the profiling, here |
File root/themes/default/main.css changed (mode: 100644) (index 83062c4..8396c17) |
... |
... |
body { |
7 |
7 |
font-family: helvetica, sans-serif; |
font-family: helvetica, sans-serif; |
8 |
8 |
font-size: 10pt; |
font-size: 10pt; |
9 |
9 |
line-height: 105%; |
line-height: 105%; |
|
10 |
|
background-color: #DDDDDD; |
10 |
11 |
} |
} |
11 |
12 |
|
|
12 |
13 |
table { |
table { |
|
... |
... |
form input[type="submit"] { |
82 |
83 |
.menu ul li { display: inline; } |
.menu ul li { display: inline; } |
83 |
84 |
.menu ul li a { |
.menu ul li a { |
84 |
85 |
text-decoration: none; |
text-decoration: none; |
85 |
|
color: #666666; |
|
|
86 |
|
color: #FFFFFF; |
86 |
87 |
font-size: 11pt; |
font-size: 11pt; |
87 |
88 |
font-weight: bold; |
font-weight: bold; |
88 |
89 |
padding: 3px 12px 3px 0px; |
padding: 3px 12px 3px 0px; |
89 |
90 |
} |
} |
90 |
|
.menu ul li a:hover { color: #AAAAAA; } |
|
|
91 |
|
.menu ul li a:hover { color: #FF0000; } |
91 |
92 |
.menu ul li a.selected { color: #BBBBBB; } |
.menu ul li a.selected { color: #BBBBBB; } |
92 |
93 |
.menu ul li a.selected:hover { color: #CCCCCC; } |
.menu ul li a.selected:hover { color: #CCCCCC; } |
93 |
94 |
|
|
|
... |
... |
form input[type="submit"] { |
108 |
109 |
#header { |
#header { |
109 |
110 |
overflow: hidden; |
overflow: hidden; |
110 |
111 |
border-bottom: 1px solid #CCCCCC; |
border-bottom: 1px solid #CCCCCC; |
111 |
|
background-color: #FFFFFF; |
|
|
112 |
|
background-color: #888888; |
112 |
113 |
padding: 0 15px 0 15px; |
padding: 0 15px 0 15px; |
113 |
114 |
} |
} |
114 |
115 |
#header table { |
#header table { |
115 |
116 |
border-collapse: collapse; |
border-collapse: collapse; |
116 |
117 |
border: 0; |
border: 0; |
117 |
118 |
border-spacing: 0; |
border-spacing: 0; |
118 |
|
background-color: #FFFFFF; |
|
|
119 |
|
background-color: #888888; |
119 |
120 |
margin: 3px 0 3px 0; |
margin: 3px 0 3px 0; |
120 |
121 |
} |
} |
121 |
122 |
#header table td { |
#header table td { |
|
... |
... |
form input[type="submit"] { |
138 |
139 |
#footer { |
#footer { |
139 |
140 |
overflow: hidden; |
overflow: hidden; |
140 |
141 |
border-top: 1px solid #CCCCCC; |
border-top: 1px solid #CCCCCC; |
141 |
|
background-color: #FFFFFF; |
|
142 |
142 |
padding: 5px 15px 5px 15px; |
padding: 5px 15px 5px 15px; |
143 |
143 |
} |
} |
144 |
144 |
#footer table { |
#footer table { |
145 |
145 |
border-collapse: collapse; |
border-collapse: collapse; |
146 |
146 |
border: 0; |
border: 0; |
147 |
147 |
border-spacing: 0; |
border-spacing: 0; |
148 |
|
background-color: #FFFFFF; |
|
149 |
148 |
} |
} |
150 |
149 |
#footer table td { |
#footer table td { |
151 |
150 |
padding: 3px 40px 3px 0; |
padding: 3px 40px 3px 0; |
152 |
151 |
border: 0px; |
border: 0px; |
153 |
152 |
font-size: 10pt; |
font-size: 10pt; |
154 |
153 |
line-height: 120%; |
line-height: 120%; |
|
154 |
|
background-color: #DDDDDD; |
155 |
155 |
} |
} |
156 |
156 |
|
|
157 |
157 |
.formarea { |
.formarea { |
|
... |
... |
form input[type="submit"] { |
212 |
212 |
.submenu { |
.submenu { |
213 |
213 |
border: 1px solid #CCCCCC; |
border: 1px solid #CCCCCC; |
214 |
214 |
border-bottom: 1px solid #CCCCCC; |
border-bottom: 1px solid #CCCCCC; |
215 |
|
background-color: #FFFFBB; |
|
|
215 |
|
background-color: #888888; |
216 |
216 |
margin-bottom: 3px; |
margin-bottom: 3px; |
217 |
|
display: table; |
|
|
217 |
|
display: block; |
|
218 |
|
padding-left: 5px; |
218 |
219 |
} |
} |
219 |
220 |
.submenu ul li {} |
.submenu ul li {} |
220 |
221 |
|
|
|
... |
... |
form input[type="submit"] { |
238 |
239 |
margin: 3px 0px; |
margin: 3px 0px; |
239 |
240 |
} |
} |
240 |
241 |
|
|
241 |
|
.repo_body { display: table; } |
|
|
242 |
|
.repo_body { display: block; } |
242 |
243 |
|
|
243 |
244 |
.urls { padding: 3px 0px; margin: 5px 0px; } |
.urls { padding: 3px 0px; margin: 5px 0px; } |
244 |
245 |
.urls ul { list-style-type: none; } |
.urls ul { list-style-type: none; } |