File TODO changed (mode: 100644) (index 14b15a7..7191bb5) |
1 |
1 |
== Where I stopped last time == |
== Where I stopped last time == |
2 |
2 |
[ ] Add "Spread the word!" on website. |
[ ] Add "Spread the word!" on website. |
3 |
3 |
|
|
4 |
|
[ ] https access before first launch? |
|
5 |
|
[ ] Check 'description_nice' and apply this everywhere. Maybe we should unset |
|
6 |
|
'description', so people will not be tempted to use it. |
|
7 |
|
Maybe just overwrite 'description'. |
|
8 |
|
Planul este sa auditez peste tot daca folosesc variabile luate cu |
|
9 |
|
rg_var_str, rg_var_re & rg_var_cookie_re. si le trintesc pe |
|
10 |
|
output fara a le trece prin template sau rg_xss_safe. |
|
11 |
|
Apoi, ar trebui sa fac si nl2br pe toate textele, just in case. |
|
12 |
|
Nu e OK. Trebuie doar pentru anumite cazuri: la o descriere pe pagina |
|
13 |
|
proiectului, e nevoie. Dar intr-un form, in textarea, nu e nevoie. |
|
14 |
|
Apoi as putea elimina description_nice. |
|
15 |
|
Deci, cred ca trebuie sa auditez peste tot folosirea lui description. |
|
16 |
|
[ ] Upload kvm image to downloads.rocketgit.com. Sign it? sha256 it? |
|
17 |
4 |
[ ] Security: validate sparas! |
[ ] Security: validate sparas! |
18 |
5 |
[ ] Menus - change color for selected items, not the background color. |
[ ] Menus - change color for selected items, not the background color. |
19 |
6 |
[ ] Daca creez repo, nu-mi creaza dir-ul (de fapt, nu marcheaza in cache ca l-a |
[ ] Daca creez repo, nu-mi creaza dir-ul (de fapt, nu marcheaza in cache ca l-a |
|
21 |
8 |
broken pipe. Foarte ciudat. De ce nu ar putea trimite? |
broken pipe. Foarte ciudat. De ce nu ar putea trimite? |
22 |
9 |
Probabil socket-ul nu mai e deschis pentru ca cache-ul s-a restartat? |
Probabil socket-ul nu mai e deschis pentru ca cache-ul s-a restartat? |
23 |
10 |
[ ] I can do a select before write to be sure socket is open. |
[ ] I can do a select before write to be sure socket is open. |
24 |
|
If I get a error signal from select, reopen the socket. |
|
|
11 |
|
If I get an error signal from select, reopen the socket. |
25 |
12 |
[ ] Check search. |
[ ] Check search. |
|
13 |
|
[ ] Run unit testing. |
26 |
14 |
[ ] SPF? mail-ul ajunge in spam! |
[ ] SPF? mail-ul ajunge in spam! |
|
15 |
|
[ ] Upload kvm image to downloads.rocketgit.com. Sign it? sha256 it? |
27 |
16 |
[ ] Release virtual machine. |
[ ] Release virtual machine. |
|
17 |
|
[ ] https access before first launch? |
28 |
18 |
[ ] |
[ ] |
29 |
19 |
|
|
30 |
20 |
== BEFORE NEXT RELEASE == |
== BEFORE NEXT RELEASE == |
|
21 |
|
[ ] Add uid to events so we can delete old events for tests or abusing users? |
|
22 |
|
[ ] Should we just set no password somehow for ssh access to be able to signal |
|
23 |
|
the user that has no key uploaded? |
31 |
24 |
[ ] When getting another IP, allow ssh on port 443(https)? |
[ ] When getting another IP, allow ssh on port 443(https)? |
32 |
25 |
[ ] Investigate --decorate/--word-diff for git log. |
[ ] Investigate --decorate/--word-diff for git log. |
33 |
26 |
[ ] client_win.html hint is not used. |
[ ] client_win.html hint is not used. |
File inc/repo.inc.php changed (mode: 100644) (index d83dd62..86256f4) |
... |
... |
function rg_repo_path_by_name($uid, $repo_name) |
625 |
625 |
function rg_repo_cosmetic(&$row) |
function rg_repo_cosmetic(&$row) |
626 |
626 |
{ |
{ |
627 |
627 |
$_a = rg_xss_safe($row['description']); |
$_a = rg_xss_safe($row['description']); |
628 |
|
$row['HTML:description_nice'] = nl2br($_a); |
|
|
628 |
|
$row['HTML:description_nlbr'] = nl2br($_a); |
629 |
629 |
} |
} |
630 |
630 |
|
|
631 |
631 |
/* |
/* |
|
... |
... |
function rg_repo_admin_rights($db, $rg, $type) |
1238 |
1238 |
$a['misc'] = rg_var_str("misc"); |
$a['misc'] = rg_var_str("misc"); |
1239 |
1239 |
$a['ip'] = rg_var_str("ip"); |
$a['ip'] = rg_var_str("ip"); |
1240 |
1240 |
$a['prio'] = rg_var_uint("prio"); |
$a['prio'] = rg_var_uint("prio"); |
1241 |
|
$a['description'] = rg_var_str("description"); |
|
|
1241 |
|
$a['description'] = trim(rg_var_str("description")); |
1242 |
1242 |
//rg_log_ml("CHECK: a(POST)=" . print_r($a, TRUE)); |
//rg_log_ml("CHECK: a(POST)=" . print_r($a, TRUE)); |
1243 |
1243 |
|
|
1244 |
1244 |
$errmsg = array(); |
$errmsg = array(); |
|
... |
... |
function rg_repo_edit_high_level($db, &$rg) |
1496 |
1496 |
$rg['ri']['master'] = rg_var_uint("master"); |
$rg['ri']['master'] = rg_var_uint("master"); |
1497 |
1497 |
$rg['ri']['name'] = rg_var_str("name"); // TODO: filter name! |
$rg['ri']['name'] = rg_var_str("name"); // TODO: filter name! |
1498 |
1498 |
$rg['ri']['max_commit_size'] = rg_var_uint("max_commit_size"); |
$rg['ri']['max_commit_size'] = rg_var_uint("max_commit_size"); |
1499 |
|
$rg['ri']['description'] = rg_var_str("description"); |
|
|
1499 |
|
$rg['ri']['description'] = trim(rg_var_str("description")); |
1500 |
1500 |
$rg['ri']['public'] = rg_var_bool("public"); |
$rg['ri']['public'] = rg_var_bool("public"); |
1501 |
|
$rg['ri']['license'] = rg_var_str("license"); |
|
|
1501 |
|
$rg['ri']['license'] = trim(rg_var_str("license")); |
1502 |
1502 |
rg_repo_cosmetic($rg['ri']); |
rg_repo_cosmetic($rg['ri']); |
1503 |
1503 |
//rg_log_ml("CHECK: after repo edit: rg[ri]=" . print_r($rg['ri'], TRUE)); |
//rg_log_ml("CHECK: after repo edit: rg[ri]=" . print_r($rg['ri'], TRUE)); |
1504 |
1504 |
|
|
File inc/rights.inc.php changed (mode: 100644) (index f45d8b0..4103979) |
... |
... |
function rg_rights_a2s($a) |
176 |
176 |
/* |
/* |
177 |
177 |
* Improves a little bit the items of a right |
* Improves a little bit the items of a right |
178 |
178 |
* TODO: we have a circular dependency on user.inc. Remove the lookup and break |
* TODO: we have a circular dependency on user.inc. Remove the lookup and break |
179 |
|
* the dependency. |
|
|
179 |
|
* the dependency. Register a function globally, from user.inc, that will be |
|
180 |
|
* called here. |
180 |
181 |
*/ |
*/ |
181 |
182 |
function rg_rights_cosmetic($db, &$row) |
function rg_rights_cosmetic($db, &$row) |
182 |
183 |
{ |
{ |
|
... |
... |
function rg_rights_cosmetic($db, &$row) |
218 |
219 |
|
|
219 |
220 |
if (!isset($row['description'])) |
if (!isset($row['description'])) |
220 |
221 |
$row['description'] = ""; |
$row['description'] = ""; |
|
222 |
|
|
|
223 |
|
$row['HTML:description_nlbr'] = nl2br(rg_xss_safe($row['description'])); |
221 |
224 |
} |
} |
222 |
225 |
|
|
223 |
226 |
/* |
/* |
|
... |
... |
function rg_rights_test_ip($list, $ip) |
626 |
629 |
* Returns TRUE if all 'needed_rights' are included in 'rights' |
* Returns TRUE if all 'needed_rights' are included in 'rights' |
627 |
630 |
* @list - an array of rights |
* @list - an array of rights |
628 |
631 |
* needed_rights: rights letters; you can use "ab|cd" = (a AND B) OR (C AND d) |
* needed_rights: rights letters; you can use "ab|cd" = (a AND B) OR (C AND d) |
629 |
|
* @misc - if FALSE, we will ignore the 'misc' from db. Is needed in remote access. |
|
630 |
632 |
*/ |
*/ |
631 |
633 |
function rg_rights_test($list, $needed_rights, $ip, $misc) |
function rg_rights_test($list, $needed_rights, $ip, $misc) |
632 |
634 |
{ |
{ |
|
... |
... |
function rg_rights_test($list, $needed_rights, $ip, $misc) |
672 |
674 |
continue; |
continue; |
673 |
675 |
|
|
674 |
676 |
// Test 'misc' match |
// Test 'misc' match |
675 |
|
if ($misc !== FALSE) { |
|
676 |
|
if (empty($v['misc'])) |
|
677 |
|
break; |
|
678 |
|
|
|
|
677 |
|
if (!empty($v['misc'])) { |
679 |
678 |
$cmp_func = $rg_rights_cmp_func[$v['type']]; |
$cmp_func = $rg_rights_cmp_func[$v['type']]; |
680 |
679 |
$r = $cmp_func($v['misc'], $misc); |
$r = $cmp_func($v['misc'], $misc); |
681 |
680 |
if ($r !== TRUE) { |
if ($r !== TRUE) { |
File inc/user/repo-page.php changed (mode: 100644) (index 641bbdf..74d6709) |
... |
... |
if ($rg_git_port != 0) |
71 |
71 |
$urls[]['HTML:url'] = '<a href="' . $rg['git'] . '">' . $rg['git'] . '</a>'; |
$urls[]['HTML:url'] = '<a href="' . $rg['git'] . '">' . $rg['git'] . '</a>'; |
72 |
72 |
$rg['HTML:urls'] = rg_template_table("repo/urls", $urls, $rg); |
$rg['HTML:urls'] = rg_template_table("repo/urls", $urls, $rg); |
73 |
73 |
|
|
74 |
|
function rg_add_clone_hints($db, &$rg) |
|
|
74 |
|
function rg_add_clone_hints($db, &$rg, $ref) |
75 |
75 |
{ |
{ |
76 |
76 |
global $rg_ssh_port; |
global $rg_ssh_port; |
77 |
77 |
global $rg_git_port; |
global $rg_git_port; |
|
... |
... |
function rg_add_clone_hints($db, &$rg) |
97 |
97 |
$x['username'] = $rg['login_ui']['username']; |
$x['username'] = $rg['login_ui']['username']; |
98 |
98 |
$x['needed_rights'] = 'H'; /* anon push */ |
$x['needed_rights'] = 'H'; /* anon push */ |
99 |
99 |
$x['ip'] = $rg['ip']; |
$x['ip'] = $rg['ip']; |
100 |
|
$x['misc'] = FALSE; |
|
|
100 |
|
$x['misc'] = $ref; |
101 |
101 |
if (rg_rights_allow($db, $x) === TRUE) |
if (rg_rights_allow($db, $x) === TRUE) |
102 |
102 |
$hints[]['HTML:hint'] = rg_template("hints/repo/anon_push.html", $rg); |
$hints[]['HTML:hint'] = rg_template("hints/repo/anon_push.html", $rg); |
103 |
103 |
} |
} |
|
... |
... |
function rg_add_clone_hints($db, &$rg) |
109 |
109 |
$_subop = empty($paras) ? "history" : array_shift($paras); |
$_subop = empty($paras) ? "history" : array_shift($paras); |
110 |
110 |
|
|
111 |
111 |
if (strcmp($_subop, "history") == 0) { |
if (strcmp($_subop, "history") == 0) { |
112 |
|
rg_add_clone_hints($db, $rg); |
|
|
112 |
|
rg_add_clone_hints($db, $rg, ''); |
113 |
113 |
|
|
114 |
114 |
$hist = rg_repo_history_load($db, $rg['ri']['repo_id'], 0, 20, 0); |
$hist = rg_repo_history_load($db, $rg['ri']['repo_id'], 0, 20, 0); |
115 |
115 |
if ($hist === FALSE) |
if ($hist === FALSE) |
|
... |
... |
if (strcmp($_subop, "history") == 0) { |
129 |
129 |
$type_ref['ref_url']); |
$type_ref['ref_url']); |
130 |
130 |
$rg = array_merge($rg, $bt); |
$rg = array_merge($rg, $bt); |
131 |
131 |
|
|
132 |
|
rg_add_clone_hints($db, $rg); |
|
|
132 |
|
rg_add_clone_hints($db, $rg, $ref); |
133 |
133 |
|
|
134 |
134 |
$_repo_body .= rg_template("repo/source.html", $rg); |
$_repo_body .= rg_template("repo/source.html", $rg); |
135 |
135 |
|
|
File tests/bug.php changed (mode: 100644) (index 02800c3..5f388b7) |
... |
... |
rg_log_set_file("bug.log"); |
15 |
15 |
|
|
16 |
16 |
require_once("common.php"); |
require_once("common.php"); |
17 |
17 |
|
|
18 |
|
// defaults |
|
19 |
|
$uid = 1; |
|
20 |
|
$ui = array("uid" => $uid, "username" => "userX", "organization" => 0, "email" => "test@embedromix.ro", |
|
21 |
|
"confirmed" => 1); |
|
22 |
|
$repo_name = "bug-A"; |
|
|
18 |
|
$_testns = 'bug'; |
23 |
19 |
|
|
24 |
|
|
|
25 |
|
rg_test_create_repo($db, $ui, $new); |
|
|
20 |
|
rg_test_create_user($db, $u1); |
|
21 |
|
rg_test_create_user($db, $u2); |
|
22 |
|
rg_test_create_repo($db, $u1, $new); |
26 |
23 |
|
|
27 |
24 |
$data = array("bug_id" => 0, |
$data = array("bug_id" => 0, |
28 |
|
"title" => "Bug title", |
|
29 |
|
"body" => "This is the body\nof the\nbug. <>", |
|
30 |
|
"labels" => "label3,label1,label2", |
|
|
25 |
|
"title" => "Bug title<xss>", |
|
26 |
|
"body" => "This is the body\nof the\nbug.<xss>", |
|
27 |
|
"labels" => "label2,label1<xss>", |
31 |
28 |
"state" => 1, |
"state" => 1, |
32 |
29 |
"assigned_uid" => 6); |
"assigned_uid" => 6); |
33 |
30 |
$ri = array("repo_id" => $new['repo_id'], "name" => "repoX"); |
$ri = array("repo_id" => $new['repo_id'], "name" => "repoX"); |
34 |
|
$r = rg_bug_edit($db, $ui, $ri, $data); |
|
|
31 |
|
$r = rg_bug_edit($db, $u1, $ri, $data); |
35 |
32 |
if ($r === FALSE) { |
if ($r === FALSE) { |
36 |
33 |
rg_log("Cannot insert a bug (" . rg_bug_error() . ")!"); |
rg_log("Cannot insert a bug (" . rg_bug_error() . ")!"); |
37 |
34 |
exit(1); |
exit(1); |
|
... |
... |
if ($r === FALSE) { |
43 |
40 |
rg_log("Cannot get labels (" . rg_bug_error() . ")!"); |
rg_log("Cannot get labels (" . rg_bug_error() . ")!"); |
44 |
41 |
exit(1); |
exit(1); |
45 |
42 |
} |
} |
46 |
|
if (strcmp($r[0], "label1") != 0) { |
|
|
43 |
|
if (strcmp($r[0], "label1<xss>") != 0) { |
47 |
44 |
rg_log("Ordering the labels seems to not work."); |
rg_log("Ordering the labels seems to not work."); |
48 |
45 |
exit(1); |
exit(1); |
49 |
46 |
} |
} |
50 |
|
if (strcmp($r[2], "label3") != 0) { |
|
|
47 |
|
if (strcmp($r[1], "label2") != 0) { |
51 |
48 |
rg_log("Ordering the labels seems to not work."); |
rg_log("Ordering the labels seems to not work."); |
52 |
49 |
exit(1); |
exit(1); |
53 |
50 |
} |
} |
54 |
51 |
|
|
55 |
|
// add user |
|
56 |
|
$_u['uid'] = 0; |
|
57 |
|
$_u['realname'] = "user-bug-A real name"; |
|
58 |
|
$_u['username'] = "user-bug-A"; |
|
59 |
|
$_u['email'] = "rg@localhost"; |
|
60 |
|
$_u['pass'] = "pass1"; |
|
61 |
|
$_u['pass2'] = "pass1"; |
|
62 |
|
$_u['is_admin'] = 1; |
|
63 |
|
$_u['rights'] = "C"; |
|
64 |
|
$_u['session_time'] = 3600; |
|
65 |
|
$_u['confirm_token'] = ""; |
|
66 |
|
$_u['plan_id'] = 1000; |
|
67 |
|
$uid = rg_user_edit($db, $_u); |
|
68 |
|
if ($uid === FALSE) { |
|
69 |
|
rg_log("Cannot add user (" . rg_user_error() . ")!"); |
|
70 |
|
exit(1); |
|
71 |
|
} |
|
72 |
|
|
|
73 |
|
$data = array("note" => "This is just a note."); |
|
74 |
|
$r = rg_bug_note_add($db, $new['repo_id'], $bug_id, $uid, $data); |
|
|
52 |
|
$data = array("note" => "This is just a note.<xss>"); |
|
53 |
|
$r = rg_bug_note_add($db, $new['repo_id'], $bug_id, $u2['uid'], $data); |
75 |
54 |
if ($r === FALSE) { |
if ($r === FALSE) { |
76 |
|
rg_log("Cannot add a note (" . rg_bug_error() . ")!"); |
|
|
55 |
|
rg_log("Cannot add a note by u2 (" . rg_bug_error() . ")!"); |
77 |
56 |
exit(1); |
exit(1); |
78 |
57 |
} |
} |
79 |
58 |
|
|
|
... |
... |
if ($r['exists'] != 0) { |
91 |
70 |
} |
} |
92 |
71 |
|
|
93 |
72 |
// Search bugs |
// Search bugs |
94 |
|
$q = array("reported_by" => "user-bug-A", |
|
95 |
|
"assigned_to" => "user-bug-A", |
|
|
73 |
|
$q = array("reported_by" => $u1['username'], |
|
74 |
|
"assigned_to" => $u2['username'], |
96 |
75 |
"state" => "1", |
"state" => "1", |
97 |
76 |
"start" => "2000-01-01", |
"start" => "2000-01-01", |
98 |
77 |
"end" => "2001-01-01", |
"end" => "2001-01-01", |
99 |
|
"title_string" => "IMPOSSIBLE TITLE", |
|
100 |
|
"body_string" => "IMPOSSIBLE BODY", |
|
|
78 |
|
"title_string" => "IMPOSSIBLE TITLE<xss>", |
|
79 |
|
"body_string" => "IMPOSSIBLE BODY<xss>", |
101 |
80 |
"bugs_per_page" => "1"); |
"bugs_per_page" => "1"); |
102 |
|
$r = rg_bug_search($db, $new['repo_id'], $uid, $q); |
|
|
81 |
|
$r = rg_bug_search($db, $new['repo_id'], $u1['uid'], $q); |
103 |
82 |
if ($r === FALSE) { |
if ($r === FALSE) { |
104 |
83 |
rg_log("Cannot search bugs 1 (" . rg_bug_error() . ")!"); |
rg_log("Cannot search bugs 1 (" . rg_bug_error() . ")!"); |
105 |
84 |
exit(1); |
exit(1); |
|
... |
... |
if (count($r) > 0) { |
111 |
90 |
|
|
112 |
91 |
$q = array("title_string" => "g t", |
$q = array("title_string" => "g t", |
113 |
92 |
"body_string" => ""); |
"body_string" => ""); |
114 |
|
$r = rg_bug_search($db, $new['repo_id'], $uid, $q); |
|
|
93 |
|
$r = rg_bug_search($db, $new['repo_id'], $u1['uid'], $q); |
115 |
94 |
if ($r === FALSE) { |
if ($r === FALSE) { |
116 |
95 |
rg_log("Cannot search bugs 2 (" . rg_bug_error() . ")!"); |
rg_log("Cannot search bugs 2 (" . rg_bug_error() . ")!"); |
117 |
96 |
exit(1); |
exit(1); |
File tests/git_log1.expected changed (mode: 100644) (index 168e603..a23c181) |
1 |
1 |
<div class="diff"> |
<div class="diff"> |
2 |
2 |
<br /> |
<br /> |
3 |
|
<a name="dis1"> |
|
|
3 |
|
<a name="dis1"></a> |
4 |
4 |
<table class="chunk" width="100%"> |
<table class="chunk" width="100%"> |
5 |
5 |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>dis1</b> changed (mode: 100644) (index 2c4179b..2bf9115):</td></tr> |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>dis1</b> changed (mode: 100644) (index 2c4179b..2bf9115):</td></tr> |
6 |
6 |
1 #ff0000 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa #eeeeee |
1 #ff0000 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa #eeeeee |
|
10 |
10 |
</div> |
</div> |
11 |
11 |
<div class="diff"> |
<div class="diff"> |
12 |
12 |
<br /> |
<br /> |
13 |
|
<a name="dis1"> |
|
|
13 |
|
<a name="dis1"></a> |
14 |
14 |
<table class="chunk" width="100%"> |
<table class="chunk" width="100%"> |
15 |
15 |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>dis1</b> added (mode: 100644) (index 0000000..2c4179b):</td></tr> |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>dis1</b> added (mode: 100644) (index 0000000..2c4179b):</td></tr> |
16 |
16 |
1 #eeeeee #00ff00 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
1 #eeeeee #00ff00 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
|
19 |
19 |
</div> |
</div> |
20 |
20 |
<div class="diff"> |
<div class="diff"> |
21 |
21 |
<br /> |
<br /> |
22 |
|
<a name="a b c"> |
|
|
22 |
|
<a name="a b c"></a> |
23 |
23 |
<table class="chunk" width="100%"> |
<table class="chunk" width="100%"> |
24 |
24 |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>a b c</b> added (mode: 100644) (index 0000000..72943a1):</td></tr> |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>a b c</b> added (mode: 100644) (index 0000000..72943a1):</td></tr> |
25 |
25 |
1 #eeeeee #00ff00 aaa |
1 #eeeeee #00ff00 aaa |
|
27 |
27 |
</div> |
</div> |
28 |
28 |
<div class="diff"> |
<div class="diff"> |
29 |
29 |
<br /> |
<br /> |
30 |
|
<a name="a3"> |
|
|
30 |
|
<a name="a3"></a> |
31 |
31 |
<table class="chunk" width="100%"> |
<table class="chunk" width="100%"> |
32 |
32 |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>a3</b> deleted (index 193814c..0000000):</td></tr> |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>a3</b> deleted (index 193814c..0000000):</td></tr> |
33 |
33 |
1 #ff0000 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa #eeeeee |
1 #ff0000 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa #eeeeee |
|
35 |
35 |
</div> |
</div> |
36 |
36 |
<div class="diff"> |
<div class="diff"> |
37 |
37 |
<br /> |
<br /> |
38 |
|
<a name="a3"> |
|
|
38 |
|
<a name="a3"></a> |
39 |
39 |
<table class="chunk" width="100%"> |
<table class="chunk" width="100%"> |
40 |
40 |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>a3</b> renamed from a2 (similarity 100%):</td></tr> |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>a3</b> renamed from a2 (similarity 100%):</td></tr> |
41 |
41 |
</table> |
</table> |
42 |
42 |
<br /> |
<br /> |
43 |
|
<a name="c"> |
|
|
43 |
|
<a name="c"></a> |
44 |
44 |
<table class="chunk" width="100%"> |
<table class="chunk" width="100%"> |
45 |
45 |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>c</b> added (mode: 100644) (index 0000000..8ded189):</td></tr> |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>c</b> added (mode: 100644) (index 0000000..8ded189):</td></tr> |
46 |
46 |
1 #eeeeee #00ff00 aaaaaaaaaaaaaaaaaaaa |
1 #eeeeee #00ff00 aaaaaaaaaaaaaaaaaaaa |
|
48 |
48 |
</div> |
</div> |
49 |
49 |
<div class="diff"> |
<div class="diff"> |
50 |
50 |
<br /> |
<br /> |
51 |
|
<a name="a2"> |
|
|
51 |
|
<a name="a2"></a> |
52 |
52 |
<table class="chunk" width="100%"> |
<table class="chunk" width="100%"> |
53 |
53 |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>a2</b> added (mode: 100644) (index 0000000..193814c):</td></tr> |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>a2</b> added (mode: 100644) (index 0000000..193814c):</td></tr> |
54 |
54 |
1 #eeeeee #00ff00 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
1 #eeeeee #00ff00 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
|
56 |
56 |
</div> |
</div> |
57 |
57 |
<div class="diff"> |
<div class="diff"> |
58 |
58 |
<br /> |
<br /> |
59 |
|
<a name="empty.txt"> |
|
|
59 |
|
<a name="empty.txt"></a> |
60 |
60 |
<table class="chunk" width="100%"> |
<table class="chunk" width="100%"> |
61 |
61 |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>empty.txt</b> added (mode: 100644) (index 0000000..e69de29):</td></tr> |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>empty.txt</b> added (mode: 100644) (index 0000000..e69de29):</td></tr> |
62 |
62 |
</table> |
</table> |
63 |
63 |
</div> |
</div> |
64 |
64 |
<div class="diff"> |
<div class="diff"> |
65 |
65 |
<br /> |
<br /> |
66 |
|
<a name="xx"yy"> |
|
|
66 |
|
<a name="xx"yy"></a> |
67 |
67 |
<table class="chunk" width="100%"> |
<table class="chunk" width="100%"> |
68 |
68 |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>xx"yy</b> added (mode: 100644) (index 0000000..e69de29):</td></tr> |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>xx"yy</b> added (mode: 100644) (index 0000000..e69de29):</td></tr> |
69 |
69 |
</table> |
</table> |
70 |
70 |
</div> |
</div> |
71 |
71 |
<div class="diff"> |
<div class="diff"> |
72 |
72 |
<br /> |
<br /> |
73 |
|
<a name="a"> |
|
|
73 |
|
<a name="a"></a> |
74 |
74 |
<table class="chunk" width="100%"> |
<table class="chunk" width="100%"> |
75 |
75 |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>a</b> added (mode: 100644) (index 0000000..193814c):</td></tr> |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>a</b> added (mode: 100644) (index 0000000..193814c):</td></tr> |
76 |
76 |
1 #eeeeee #00ff00 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
1 #eeeeee #00ff00 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
File tests/git_log1.final changed (mode: 100644) (index 168e603..a23c181) |
1 |
1 |
<div class="diff"> |
<div class="diff"> |
2 |
2 |
<br /> |
<br /> |
3 |
|
<a name="dis1"> |
|
|
3 |
|
<a name="dis1"></a> |
4 |
4 |
<table class="chunk" width="100%"> |
<table class="chunk" width="100%"> |
5 |
5 |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>dis1</b> changed (mode: 100644) (index 2c4179b..2bf9115):</td></tr> |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>dis1</b> changed (mode: 100644) (index 2c4179b..2bf9115):</td></tr> |
6 |
6 |
1 #ff0000 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa #eeeeee |
1 #ff0000 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa #eeeeee |
|
10 |
10 |
</div> |
</div> |
11 |
11 |
<div class="diff"> |
<div class="diff"> |
12 |
12 |
<br /> |
<br /> |
13 |
|
<a name="dis1"> |
|
|
13 |
|
<a name="dis1"></a> |
14 |
14 |
<table class="chunk" width="100%"> |
<table class="chunk" width="100%"> |
15 |
15 |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>dis1</b> added (mode: 100644) (index 0000000..2c4179b):</td></tr> |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>dis1</b> added (mode: 100644) (index 0000000..2c4179b):</td></tr> |
16 |
16 |
1 #eeeeee #00ff00 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
1 #eeeeee #00ff00 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
|
19 |
19 |
</div> |
</div> |
20 |
20 |
<div class="diff"> |
<div class="diff"> |
21 |
21 |
<br /> |
<br /> |
22 |
|
<a name="a b c"> |
|
|
22 |
|
<a name="a b c"></a> |
23 |
23 |
<table class="chunk" width="100%"> |
<table class="chunk" width="100%"> |
24 |
24 |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>a b c</b> added (mode: 100644) (index 0000000..72943a1):</td></tr> |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>a b c</b> added (mode: 100644) (index 0000000..72943a1):</td></tr> |
25 |
25 |
1 #eeeeee #00ff00 aaa |
1 #eeeeee #00ff00 aaa |
|
27 |
27 |
</div> |
</div> |
28 |
28 |
<div class="diff"> |
<div class="diff"> |
29 |
29 |
<br /> |
<br /> |
30 |
|
<a name="a3"> |
|
|
30 |
|
<a name="a3"></a> |
31 |
31 |
<table class="chunk" width="100%"> |
<table class="chunk" width="100%"> |
32 |
32 |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>a3</b> deleted (index 193814c..0000000):</td></tr> |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>a3</b> deleted (index 193814c..0000000):</td></tr> |
33 |
33 |
1 #ff0000 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa #eeeeee |
1 #ff0000 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa #eeeeee |
|
35 |
35 |
</div> |
</div> |
36 |
36 |
<div class="diff"> |
<div class="diff"> |
37 |
37 |
<br /> |
<br /> |
38 |
|
<a name="a3"> |
|
|
38 |
|
<a name="a3"></a> |
39 |
39 |
<table class="chunk" width="100%"> |
<table class="chunk" width="100%"> |
40 |
40 |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>a3</b> renamed from a2 (similarity 100%):</td></tr> |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>a3</b> renamed from a2 (similarity 100%):</td></tr> |
41 |
41 |
</table> |
</table> |
42 |
42 |
<br /> |
<br /> |
43 |
|
<a name="c"> |
|
|
43 |
|
<a name="c"></a> |
44 |
44 |
<table class="chunk" width="100%"> |
<table class="chunk" width="100%"> |
45 |
45 |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>c</b> added (mode: 100644) (index 0000000..8ded189):</td></tr> |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>c</b> added (mode: 100644) (index 0000000..8ded189):</td></tr> |
46 |
46 |
1 #eeeeee #00ff00 aaaaaaaaaaaaaaaaaaaa |
1 #eeeeee #00ff00 aaaaaaaaaaaaaaaaaaaa |
|
48 |
48 |
</div> |
</div> |
49 |
49 |
<div class="diff"> |
<div class="diff"> |
50 |
50 |
<br /> |
<br /> |
51 |
|
<a name="a2"> |
|
|
51 |
|
<a name="a2"></a> |
52 |
52 |
<table class="chunk" width="100%"> |
<table class="chunk" width="100%"> |
53 |
53 |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>a2</b> added (mode: 100644) (index 0000000..193814c):</td></tr> |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>a2</b> added (mode: 100644) (index 0000000..193814c):</td></tr> |
54 |
54 |
1 #eeeeee #00ff00 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
1 #eeeeee #00ff00 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
|
56 |
56 |
</div> |
</div> |
57 |
57 |
<div class="diff"> |
<div class="diff"> |
58 |
58 |
<br /> |
<br /> |
59 |
|
<a name="empty.txt"> |
|
|
59 |
|
<a name="empty.txt"></a> |
60 |
60 |
<table class="chunk" width="100%"> |
<table class="chunk" width="100%"> |
61 |
61 |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>empty.txt</b> added (mode: 100644) (index 0000000..e69de29):</td></tr> |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>empty.txt</b> added (mode: 100644) (index 0000000..e69de29):</td></tr> |
62 |
62 |
</table> |
</table> |
63 |
63 |
</div> |
</div> |
64 |
64 |
<div class="diff"> |
<div class="diff"> |
65 |
65 |
<br /> |
<br /> |
66 |
|
<a name="xx"yy"> |
|
|
66 |
|
<a name="xx"yy"></a> |
67 |
67 |
<table class="chunk" width="100%"> |
<table class="chunk" width="100%"> |
68 |
68 |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>xx"yy</b> added (mode: 100644) (index 0000000..e69de29):</td></tr> |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>xx"yy</b> added (mode: 100644) (index 0000000..e69de29):</td></tr> |
69 |
69 |
</table> |
</table> |
70 |
70 |
</div> |
</div> |
71 |
71 |
<div class="diff"> |
<div class="diff"> |
72 |
72 |
<br /> |
<br /> |
73 |
|
<a name="a"> |
|
|
73 |
|
<a name="a"></a> |
74 |
74 |
<table class="chunk" width="100%"> |
<table class="chunk" width="100%"> |
75 |
75 |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>a</b> added (mode: 100644) (index 0000000..193814c):</td></tr> |
<tr style="border: 1px; background: #dddddd"><td colspan="4">File <b>a</b> added (mode: 100644) (index 0000000..193814c):</td></tr> |
76 |
76 |
1 #eeeeee #00ff00 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
1 #eeeeee #00ff00 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
File tests/http_bug.php changed (mode: 100644) (index 35aae2e..9802330) |
... |
... |
require_once("common.php"); |
18 |
18 |
$_testns = 'http_bug'; |
$_testns = 'http_bug'; |
19 |
19 |
$rg_cache_enable = TRUE; |
$rg_cache_enable = TRUE; |
20 |
20 |
|
|
21 |
|
rg_test_create_user($db, $rg_ui); |
|
22 |
|
rg_test_create_user($db, $rg_ui2); |
|
23 |
|
rg_test_create_repo($db, $rg_ui, $repo); |
|
|
21 |
|
rg_test_create_user($db, $u1); |
|
22 |
|
rg_test_create_user($db, $u2); |
|
23 |
|
rg_test_create_repo($db, $u1, $repo); |
24 |
24 |
|
|
25 |
|
$r = test_login($test_url, $rg_ui, $good_sid); |
|
|
25 |
|
$r = test_login($test_url, $u1, $good_sid); |
26 |
26 |
if ($r === FALSE) |
if ($r === FALSE) |
27 |
27 |
exit(1); |
exit(1); |
28 |
28 |
|
|
29 |
29 |
|
|
30 |
30 |
rg_log("Loading bug form..."); |
rg_log("Loading bug form..."); |
31 |
|
$url = "/user/" . $rg_ui['username'] . "/" . $repo['name'] . "/bug/add"; |
|
|
31 |
|
$url = "/user/" . $u1['username'] . "/" . $repo['name'] . "/bug/add"; |
32 |
32 |
$headers = array("Cookie: sid=" . $good_sid); |
$headers = array("Cookie: sid=" . $good_sid); |
33 |
33 |
$data = array(); |
$data = array(); |
34 |
34 |
$r = do_req($test_url . $url, $data, $headers); |
$r = do_req($test_url . $url, $data, $headers); |
|
... |
... |
$data = array('doit' => 1, 'edit' => 1, 'token' => $token, |
49 |
49 |
'title' => 'Title1 space<xss>', |
'title' => 'Title1 space<xss>', |
50 |
50 |
'body' => 'aasasasassa<xss>', |
'body' => 'aasasasassa<xss>', |
51 |
51 |
'state' => 1, |
'state' => 1, |
52 |
|
'assigned_to' => $rg_ui2['username'], |
|
53 |
|
'labels' => implode(' ', $labels)); |
|
|
52 |
|
'assigned_to' => $u2['username'], |
|
53 |
|
'labels' => implode(' ', $labels), |
|
54 |
|
'_test' => 'add bug'); |
54 |
55 |
$r = do_req($test_url . $url, $data, $headers); |
$r = do_req($test_url . $url, $data, $headers); |
55 |
56 |
if ($r === FALSE) { |
if ($r === FALSE) { |
56 |
57 |
rg_log('Cannot post bug request.'); |
rg_log('Cannot post bug request.'); |
|
... |
... |
if ($row['bug_id'] != 1) { |
64 |
65 |
rg_log("Seems the bugs do not start at 1, but " . $row['bug_id']); |
rg_log("Seems the bugs do not start at 1, but " . $row['bug_id']); |
65 |
66 |
exit(1); |
exit(1); |
66 |
67 |
} |
} |
67 |
|
if ($row['assigned_uid'] != $rg_ui2['uid']) { |
|
68 |
|
rg_log('assigned_uid is not ' . $rg_ui2['uid'] |
|
|
68 |
|
if ($row['assigned_uid'] != $u2['uid']) { |
|
69 |
|
rg_log('assigned_uid is not ' . $u2['uid'] |
69 |
70 |
. ', but ' . $row['assigned_uid'] . '!'); |
. ', but ' . $row['assigned_uid'] . '!'); |
70 |
71 |
exit(1); |
exit(1); |
71 |
72 |
} |
} |
|
... |
... |
if (strcmp($p1, $p2) != 0) { |
93 |
94 |
rg_log("Testing adding a note"); |
rg_log("Testing adding a note"); |
94 |
95 |
|
|
95 |
96 |
rg_log("Loading bug/note form..."); |
rg_log("Loading bug/note form..."); |
96 |
|
$url = "/user/" . $rg_ui['username'] . "/" . $repo['name'] . "/bug/1"; |
|
97 |
|
$data = array(); |
|
|
97 |
|
$url = "/user/" . $u1['username'] . "/" . $repo['name'] . "/bug/1"; |
|
98 |
|
$data = array('_test' => 'adding a note'); |
98 |
99 |
$r = do_req($test_url . $url, $data, $headers); |
$r = do_req($test_url . $url, $data, $headers); |
99 |
100 |
if ($r === FALSE) { |
if ($r === FALSE) { |
100 |
101 |
rg_log("Cannot load bug page."); |
rg_log("Cannot load bug page."); |
|
... |
... |
$token = $r['token']; |
105 |
106 |
rg_log("Posting note add form (token=$token)..."); |
rg_log("Posting note add form (token=$token)..."); |
106 |
107 |
$note = 'This is a note<xss>'; |
$note = 'This is a note<xss>'; |
107 |
108 |
$data = array('note_add_doit' => 1, 'token' => $token, |
$data = array('note_add_doit' => 1, 'token' => $token, |
108 |
|
'note' => $note); |
|
|
109 |
|
'note' => $note, |
|
110 |
|
'_test' => 'adding a note'); |
109 |
111 |
$r = do_req($test_url . $url, $data, $headers); |
$r = do_req($test_url . $url, $data, $headers); |
110 |
112 |
if ($r === FALSE) { |
if ($r === FALSE) { |
111 |
113 |
rg_log('Cannot post bug request.'); |
rg_log('Cannot post bug request.'); |
|
... |
... |
if ($row['note'] != $note) { |
120 |
122 |
rg_log('Note is not ok [' . $note . '] != [' . $row['note'] . ']!'); |
rg_log('Note is not ok [' . $note . '] != [' . $row['note'] . ']!'); |
121 |
123 |
exit(1); |
exit(1); |
122 |
124 |
} |
} |
123 |
|
if ($row['uid'] != $rg_ui['uid']) { |
|
124 |
|
rg_log('uid is not ok [' . $row['uid'] . '] != [' . $rg_ui['uid'] . ']!'); |
|
|
125 |
|
if ($row['uid'] != $u1['uid']) { |
|
126 |
|
rg_log('uid is not ok [' . $row['uid'] . '] != [' . $u1['uid'] . ']!'); |
125 |
127 |
exit(1); |
exit(1); |
126 |
128 |
} |
} |
127 |
129 |
|
|
|
... |
... |
$token = $r['token']; |
131 |
133 |
rg_log("Posting close bug form..."); |
rg_log("Posting close bug form..."); |
132 |
134 |
$data = array('token' => $token, |
$data = array('token' => $token, |
133 |
135 |
'close_reopen' => 1, |
'close_reopen' => 1, |
134 |
|
'state' => 2); |
|
|
136 |
|
'state' => 2, |
|
137 |
|
'_test' => 'closing a bug'); |
135 |
138 |
$r = do_req($test_url . $url, $data, $headers); |
$r = do_req($test_url . $url, $data, $headers); |
136 |
139 |
if ($r === FALSE) { |
if ($r === FALSE) { |
137 |
140 |
rg_log('Cannot post bug request.'); |
rg_log('Cannot post bug request.'); |
|
... |
... |
$token = $r['token']; |
153 |
156 |
rg_log("Posting re-open bug form..."); |
rg_log("Posting re-open bug form..."); |
154 |
157 |
$data = array('token' => $token, |
$data = array('token' => $token, |
155 |
158 |
'close_reopen' => 1, |
'close_reopen' => 1, |
156 |
|
'state'=> 1); |
|
|
159 |
|
'state'=> 1, |
|
160 |
|
'_test' => 're-opn bug'); |
157 |
161 |
$r = do_req($test_url . $url, $data, $headers); |
$r = do_req($test_url . $url, $data, $headers); |
158 |
162 |
if ($r === FALSE) { |
if ($r === FALSE) { |
159 |
163 |
rg_log('Cannot post bug request.'); |
rg_log('Cannot post bug request.'); |
|
... |
... |
for ($i = 0; $i <= 1; $i++) { |
176 |
180 |
$token = $r['token']; |
$token = $r['token']; |
177 |
181 |
rg_log("Posting delete bug form..."); |
rg_log("Posting delete bug form..."); |
178 |
182 |
$data = array('token' => $token, |
$data = array('token' => $token, |
179 |
|
'del_undel' => $i + 1); |
|
|
183 |
|
'del_undel' => $i + 1, |
|
184 |
|
'_test' => 'deleting a bug'); |
180 |
185 |
$r = do_req($test_url . $url, $data, $headers); |
$r = do_req($test_url . $url, $data, $headers); |
181 |
186 |
if ($r === FALSE) { |
if ($r === FALSE) { |
182 |
187 |
rg_log('Cannot post bug request.'); |
rg_log('Cannot post bug request.'); |
|
... |
... |
for ($i = 0; $i <= 1; $i++) { |
196 |
201 |
. ' deleted= [' . $row['deleted'] . ']!'); |
. ' deleted= [' . $row['deleted'] . ']!'); |
197 |
202 |
exit(1); |
exit(1); |
198 |
203 |
} |
} |
199 |
|
if ($row['deleted_who'] != $rg_ui['uid']) { |
|
|
204 |
|
if ($row['deleted_who'] != $u1['uid']) { |
200 |
205 |
rg_log('i=' . $i . ': Seems the deleted_who was not updated;' |
rg_log('i=' . $i . ': Seems the deleted_who was not updated;' |
201 |
206 |
. ' deleted_who= [' . $row['deleted_who'] . ']!'); |
. ' deleted_who= [' . $row['deleted_who'] . ']!'); |
202 |
207 |
exit(1); |
exit(1); |
|
... |
... |
for ($i = 0; $i <= 1; $i++) { |
205 |
210 |
|
|
206 |
211 |
|
|
207 |
212 |
// Test watching a bug - we need to login as a different user |
// Test watching a bug - we need to login as a different user |
208 |
|
$r = test_login($test_url, $rg_ui2, $good_sid); |
|
|
213 |
|
$r = test_login($test_url, $u2, $good_sid); |
209 |
214 |
if ($r === FALSE) |
if ($r === FALSE) |
210 |
215 |
exit(1); |
exit(1); |
211 |
216 |
$headers = array("Cookie: sid=" . $good_sid); |
$headers = array("Cookie: sid=" . $good_sid); |
|
... |
... |
$headers = array("Cookie: sid=" . $good_sid); |
213 |
218 |
// We are already in the watch list because the asignee is automatically added |
// We are already in the watch list because the asignee is automatically added |
214 |
219 |
for ($i = 0; $i <= 1; $i++) { |
for ($i = 0; $i <= 1; $i++) { |
215 |
220 |
rg_log("Loading bug form (i=$i)..."); |
rg_log("Loading bug form (i=$i)..."); |
216 |
|
$data = array(); |
|
|
221 |
|
$data = array('_test' => 'load-form-watch-' . $i); |
217 |
222 |
$r = do_req($test_url . $url, $data, $headers); |
$r = do_req($test_url . $url, $data, $headers); |
218 |
223 |
if ($r === FALSE) { |
if ($r === FALSE) { |
219 |
224 |
rg_log('Cannot load bug form.'); |
rg_log('Cannot load bug form.'); |
|
... |
... |
for ($i = 0; $i <= 1; $i++) { |
222 |
227 |
$token = $r['token']; |
$token = $r['token']; |
223 |
228 |
|
|
224 |
229 |
rg_log("Posting (un)watch bug form..."); |
rg_log("Posting (un)watch bug form..."); |
225 |
|
$data = array('token' => $token, 'watch' => $i, 'unwatch' => 1 - $i); |
|
|
230 |
|
$data = array('token' => $token, 'watch' => $i, 'unwatch' => 1 - $i, |
|
231 |
|
'_test' => 'post-watch-' . $i); |
226 |
232 |
$r = do_req($test_url . $url, $data, $headers); |
$r = do_req($test_url . $url, $data, $headers); |
227 |
233 |
if ($r === FALSE) { |
if ($r === FALSE) { |
228 |
234 |
rg_log('Cannot post watch bug request.'); |
rg_log('Cannot post watch bug request.'); |
|
... |
... |
for ($i = 0; $i <= 1; $i++) { |
238 |
244 |
rg_sql_free_result($res); |
rg_sql_free_result($res); |
239 |
245 |
|
|
240 |
246 |
if ($i == 0) { // unwatch - only rg_ui[uid] should be present |
if ($i == 0) { // unwatch - only rg_ui[uid] should be present |
241 |
|
if (($rows != 1) || ($row[0]['uid'] != $rg_ui['uid'])) { |
|
|
247 |
|
if (($rows != 1) || ($row[0]['uid'] != $u1['uid'])) { |
242 |
248 |
rg_log_ml('Seems we could not watch the bug; row:' |
rg_log_ml('Seems we could not watch the bug; row:' |
243 |
249 |
. print_r($row, TRUE)); |
. print_r($row, TRUE)); |
244 |
250 |
exit(1); |
exit(1); |
245 |
251 |
} |
} |
246 |
252 |
} else { |
} else { |
247 |
|
$_l = array($rg_ui['uid'], $rg_ui2['uid']); |
|
|
253 |
|
$_l = array($u1['uid'], $u2['uid']); |
248 |
254 |
for ($j = 0; $j <= 1; $j++) { |
for ($j = 0; $j <= 1; $j++) { |
249 |
255 |
if (!in_array($row[$j]['uid'], $_l)) { |
if (!in_array($row[$j]['uid'], $_l)) { |
250 |
256 |
rg_log('Seems I cannot unwatch a bug' |
rg_log('Seems I cannot unwatch a bug' |