xaizek / rocketgit (License: AGPLv3+) (since 2018-12-09)
Light and fast Git hosting solution suitable to serve both as a hub or as a personal code storage with its tickets, pull requests, API and much more.
Commit 51f62fb8019e30adbccd52db393667368853a024

Check rights on changing state of the bug on edit
Author: xaizek
Author date (UTC): 2019-07-07 20:32
Committer name: xaizek
Committer date (UTC): 2019-07-07 20:34
Parent(s): 2e47afcc8a0ad846a724ec902d1647156a885c62
Signing key: 99DC5E4DB05F6BE2
Tree: fb1391212567b322f2d253c4d88a8fdb7e5ade0e
File Lines added Lines deleted
inc/bug.inc.php 23 0
File inc/bug.inc.php changed (mode: 100644) (index e497c16..f61e106)
... ... function rg_bug_edit_high_level($db, &$rg)
1253 1253 break; break;
1254 1254 } }
1255 1255
1256 if ($rg['bug']['bug_id'] != 0) {
1257 $old_state = $rg['bug']['state'];
1258 }
1259
1256 1260 $rg['bug'] = rg_array_merge($rg['bug'], '', rg_bug_vars()); $rg['bug'] = rg_array_merge($rg['bug'], '', rg_bug_vars());
1257 1261
1262 $new_state = $rg['bug']['state'];
1263 if ($rg['bug']['bug_id'] != 0 && $old_state != $new_state) {
1264 if ($new_state == 1) { // reopen
1265 $x['needed_rights'] = 'r';
1266 if (rg_rights_allow($db, $x) !== TRUE) {
1267 $ret .= rg_template("repo/bug/deny_reopen.html", $rg,
1268 TRUE /*xss*/);
1269 break;
1270 }
1271 } else { // close
1272 $x['needed_rights'] = 'C';
1273 if (rg_rights_allow($db, $x) !== TRUE) {
1274 $ret .= rg_template("repo/bug/deny_close.html", $rg,
1275 TRUE /*xss*/);
1276 break;
1277 }
1278 }
1279 }
1280
1258 1281 if (!rg_valid_referer()) { if (!rg_valid_referer()) {
1259 1282 $errmsg[] = "invalid referer; try again"; $errmsg[] = "invalid referer; try again";
1260 1283 break; break;
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/rocketgit

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/rocketgit

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master