List of commits:
Subject Hash Author Date (UTC)
Checkpoint d27058ed0323fbe336584a1155c4c02489ee641d Catalin(ux) M. BOIE 2014-10-08 18:52:24
WIP c393b624a4544dd58b7c3a6c9e09bf5d94fba6c1 Catalin(ux) M. BOIE 2014-09-23 03:01:33
Checkpoint: added path rights and fixed mail sending 24aa6660e6ee2530739545da09869b116c77df3b Catalin(ux) M. BOIE 2014-09-07 07:12:43
Checkpoint c769943b7cd003725a18731a1723616010582d50 Catalin(ux) M. BOIE 2014-09-06 05:43:17
Checkpoint after a lot of pause 53c17f78a3d70e22165de311ff56b094cb3b1096 Catalin(ux) M. BOIE 2014-04-14 18:23:27
Checkpoint - mostly fixes for tests and switch to sql_params 28830fcf28cf8f3ae0f59bf1205281820df1307a Catalin(ux) M. BOIE 2013-07-16 19:42:15
Bulk changes all over the place. 69bd7667ac66a02ae3734ddb2f1eb8eec526e3bf Catalin(ux) M. BOIE 2013-04-21 06:40:27
Fixed repo search: ui['admin'] may not be defined 48794821cb9a4ea8fa793144256ac916b1554bf2 Catalin(ux) M. BOIE 2013-02-18 19:37:31
Several changes. Bump version to 0.18 57269df7b88cd6cbb0c2569c6e14d94887c6ca40 Catalin(ux) M. BOIE 2013-02-17 10:10:48
Bump the version 753abba3b1f6caac8f96d801e5a5d1786023aa2f Catalin(ux) M. BOIE 2013-02-05 19:40:38
Checkpoint 16a893cae9b7754a3e9ff9a0f380c00ccc52a907 Catalin(ux) M. BOIE 2013-02-05 19:35:48
Bulk fixes 30f559c9d7701b0a06344f286f113e154a39805b Catalin(ux) M. BOIE 2013-01-06 00:24:33
Removed some debug stuff. d17e0d454e7e1cad1b350139e0770e7450ee9331 Catalin(ux) M. BOIE 2012-12-02 21:00:30
Apply conditionals before replacing variables! 3d5b7d5fcc11734f9623a3d6ff0aaa8a332b6bdb Catalin(ux) M. BOIE 2012-12-02 20:58:43
More fixes for 'fixes' infrastructure 831af837ca9e7fcf56bef81d1831c3150afa7de8 Catalin(ux) M. BOIE 2012-12-01 21:58:30
Fixes infrastructure; bug fixing c282b19dcb975b1e90a4eaacfe4c126364f6e054 Catalin(ux) M. BOIE 2012-12-01 21:01:23
First round of notifications 561943c9bfd37fcf2b3c53724af2c8145d76d664 Catalin(ux) M. BOIE 2012-11-18 12:03:28
Repo history added 888934152ff5c2f2dafae9e598cf93ab6f377dba Catalin(ux) M. BOIE 2012-11-09 22:39:08
git clone fixes and other stuff dbe6ddaddfc735c8a6fef126ba90cdb2a98fe631 Catalin(ux) M. BOIE 2012-11-07 19:19:38
Allow duplicate repo names. Allow same key (db pov). 146d1de07369f1e3270a6cdca1f1bead2d076f30 Catalin(ux) M. BOIE 2012-11-05 19:47:06
Commit d27058ed0323fbe336584a1155c4c02489ee641d - Checkpoint
Author: Catalin(ux) M. BOIE
Author date (UTC): 2014-10-08 18:52
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2014-10-08 18:52
Parent(s): c393b624a4544dd58b7c3a6c9e09bf5d94fba6c1
Signing key:
Tree: 15bde89f299f4e6146a759f20cb1131e877a59e1
File Lines added Lines deleted
TODO-plans 38 0
inc/user/repo/admin/edit/edit.php 0 93
inc/user/repo/admin/rights/repo/repo.php 0 144
inc/user/repo/bug/add/add.php 0 38
inc/user/repo/bug/show/edit.php 0 41
root/themes/default/hints/repo/bug/add.html 1 0
root/themes/default/repo/bug/deleted.html 3 0
root/themes/default/repo/bug/deny_close.html 3 0
root/themes/default/repo/bug/deny_delete.html 3 0
root/themes/default/repo/bug/deny_edit.html 3 0
root/themes/default/repo/bug/deny_reopen.html 3 0
root/themes/default/user/pass_changed.html 0 0
root/themes/default/user/repo/delete/deny.html 0 0
root/themes/default/user/repo/deny.html 3 0
root/themes/default/user/repo/deny_edit.html 3 0
root/themes/default/user/repo/rights/deny.html 3 0
File TODO-plans added (mode: 100644) (index 0000000..36bd2a4)
1 == Another plan ==
2 Create repo: no right, only Public/Private. Public means at least 'Fetch',
3 and will be available for search, browse source etc.
4 Then, we have the rights tab, where we can give rights.
5 So, we:
6 - drop repos.default_rights.
7 - add repos.public, boolean, default private
8
9 == Plans for repo redesign ==
10 Because we can have a project without a repository, for example only with
11 bugtracker, we need to redesign the interface.
12
13 We need to have projects, where you can attach: a repo, a bugtracker
14 and/or a mailing list.
15
16 We need rights to admin/create/delete/grant_rights against repo/bugtracker/mailing list.
17 Pay attention. A project has an owner. Without "admin" rights, you cannot
18 deal with the rest of
19 A project is public/private.
20 A repository/bt/ml link with a project.
21
22 We begin with an admin user. We have no projects, so no repo/bt/ml.
23 Admin user will create a user for a team-leader.
24 Two cases:
25 1. Allow user to create project
26 So, we need "CREATE PROJECTS" right.
27 2. Create project for him
28 So, what rights should we give to him? "ADMIN PROJECT"?
29 We should split"ADMIN" in finer rights: "DELETE PROJECT",
30 "CREATE/DELETE/LOCK REPO",
31 "CREATE/DELETE/LOCK BT",
32 "CREATE/DELETE/LOCK ML".
33 "LOCK" means that it will become read-only.
34
35 Now, team-leader has a project.
36 Two cases:
37 1. Give "CREATE REPO" rights to a team member.
38 2. Creates the repo and give rights to user.
File inc/user/repo/admin/edit/edit.php deleted (index 29e53bd..0000000)
1 <?php
2 rg_log("/inc/user/repo/admin/edit/edit");
3
4 $_op = empty($paras) ? "" : array_shift($paras);
5
6 $_edit = "";
7 $repo_edit_more = $repo_admin_more;
8 $_url_admin_edit = $_url_admin . "/edit";
9
10 $errmsg = array();
11
12 $_show_form = 1;
13 if (strcmp($_op, "rename_done") == 0) {
14 $_edit .= rg_ok("The repository was updated with success!");
15 $_show_form = 0;
16 } else if ($doit == 1) {
17 $repo_id = rg_var_uint("repo_id");
18 $master_repo_id = 0;
19 $name = rg_var_str("name");
20 $rights = rg_rights_a2s(rg_var_str("rights"));
21 $max_commit_size = rg_var_uint("max_commit_size");
22 $description = rg_var_str("description");
23
24 do {
25 if (!rg_token_valid($db, $sid, $token)) {
26 $errmsg[] = "Invalid token. Try again.";
27 break;
28 }
29
30 // lookup user
31 $_ui = rg_user_info($db, 0, $user, "");
32 if ($_ui['ok'] != 1) {
33 $errmsg[] = "internal error";
34 break;
35 } else if ($_ui['exists'] != 1) {
36 $errmsg[] = "user [$user] does not exists";
37 break;
38 }
39
40 $ri['name'] = $name; // TODO: filter name!
41 $ri['max_commit_size'] = $max_commit_size;
42 $ri['description'] = $description; // TODO: filter
43 $ri['default_rights'] = $rights; // TODO: filter
44 $_r = rg_repo_update($db, $_ui, $ri);
45 if ($_r === FALSE) {
46 $errmsg[] = rg_repo_error();
47 break;
48 }
49
50 $_edit .= rg_ok("The repository was updated with success!");
51 $_show_form = 0;
52
53 if ($_r['renamed'] == 1) {
54 $_url = rg_re_repopage($login_ui, $name)
55 . "/admin/edit/rename_done";
56 rg_redirect($_url);
57 }
58 } while (0);
59 } else {
60 // load variables
61 $repo_id = $ri['repo_id'];
62 $master_repo_id = 0;
63 $name = $ri['name'];
64 $rights = $ri['default_rights'];
65 $max_commit_size = $ri['max_commit_size'];
66 $description = $ri['description'];
67 }
68
69 if ($_show_form == 1) {
70 if ($master_repo_id > 0) {
71 $master_name = $master_repo_id;
72 $_mi = repo_info($db, $master_repo_id, "");
73 if ($_mi['exists'] == 1)
74 $master_name = $_mi['name'];
75 $repo_edit_more['master_name'] = $master_name;
76 } else {
77 $repo_edit_more['master_name'] = "";
78 }
79
80 $repo_edit_more['title'] = "Edit repository";
81 $repo_edit_more['button'] = "Update";
82 $repo_edit_more['name'] = $name;
83 $repo_edit_more['max_commit_size'] = $max_commit_size;
84 $repo_edit_more['description'] = $description;
85 $repo_edit_more['master_repo_id'] = $master_repo_id;
86 $repo_edit_more['HTML:rights'] = rg_rights_checkboxes("repo", $rights);
87 $repo_edit_more['repo_id'] = $repo_id;
88 $repo_edit_more['HTML:errmsg'] = rg_template_errmsg($errmsg);
89 $repo_edit_more['rg_form_token'] = rg_token_get($db, $sid);
90 $_edit .= rg_template("repo/add_edit.html", $repo_edit_more);
91 }
92
93 ?>
File inc/user/repo/admin/rights/repo/repo.php deleted (index 464321f..0000000)
1 <?php
2 rg_log("/inc/user/repo/admin/rights/rights");
3
4 $repo_rights_more = $repo_admin_more;
5 $_rights = "";
6
7 $target_user = rg_var_str("target_user");
8 $rights = rg_rights_a2s(rg_var_str("rights"));
9 $refs_rights = rg_rights_a2s(rg_var_str("refs_rights"));
10 $delete = rg_var_uint("delete");
11 $edit_uid = rg_var_uint("edit_uid");
12 $grant = rg_var_uint("grant");
13 $rights_delete_ids = rg_var_str("rights_delete_ids");
14 $ref = rg_var_str("ref");
15 $path = rg_var_str("path");
16
17 // we need it in forms
18 $repo_id = $ri['repo_id'];
19
20 $errmsg = array();
21 $del_errmsg = array();
22
23 $repo_rights_more['target_user'] = $target_user;
24 $repo_rights_more['rights'] = $rights;
25 $repo_rights_more['refs_rights'] = $refs_rights;
26 $repo_rights_more['ref'] = $ref;
27 $repo_rights_more['path'] = $path;
28
29 $load_defaults = 1;
30
31 do {
32 if ($delete != 1)
33 break;
34
35 $load_defaults = 0;
36
37 if (!rg_token_valid($db, $sid, $token)) {
38 $del_errmsg[] = "invalid token; try again";
39 break;
40 }
41
42 if (empty($rights_delete_ids)) {
43 $del_errmsg[] = "No user(s) selected.";
44 break;
45 }
46
47 foreach ($rights_delete_ids as $remove_uid => $junk) {
48 $e = rg_repo_rights_set($db, $ri, $remove_uid, "", "");
49 if ($e !== TRUE) {
50 $del_errmsg[] = rg_repo_error();
51 break;
52 }
53 }
54 } while (0);
55
56 do {
57 if ($edit_uid == 0)
58 break;
59
60 $load_defaults = 0;
61
62 $r = rg_repo_rights_get($db, $ri, $edit_uid, 0);
63 if ($r['ok'] != 1) {
64 $errmsg[] = "User does not exists";
65 rg_log("User does not exists (" . rg_repo_error() . ")!");
66 break;
67 }
68
69 // Find user name
70 $target_ui = rg_user_info($db, $edit_uid, "", "");
71 if ($target_ui['exists'] != 1) {
72 $errmsg[] = "user does not exists anymore";
73 break;
74 }
75
76 $repo_rights_more['target_user'] = $target_ui['username'];
77 $repo_rights_more['rights'] = $r['rights'];
78 $repo_rights_more['refs_rights'] = $r['refs_rights'];
79 } while (0);
80
81 // Adding
82 do {
83 if ($grant != 1)
84 break;
85
86 $load_defaults = 0;
87
88 if (!rg_token_valid($db, $sid, $token)) {
89 $errmsg[] = "invalid token; try again";
90 break;
91 }
92
93 // lookup user
94 $_ui = rg_user_info($db, 0, $target_user, "");
95 if ($_ui['exists'] != 1) {
96 $errmsg[] = "user [$target_user] does not exists";
97 rg_log("User $target_user does not exists (" . rg_repo_error() . ")!");
98 break;
99 }
100
101 $misc = array();
102 $misc['ref'] = $ref;
103 $misc['path'] = $path;
104 $e = rg_repo_rights_set($db, $ri, $_ui['uid'], $rights, $misc);
105 if ($e === FALSE) {
106 $errmsg[] = rg_repo_error();
107 break;
108 }
109
110 // no need to pre-fill user because was just added
111 $repo_rights_more['target_user'] = "";
112 $repo_rights_more['rights'] = "";
113 $repo_rights_more['refs_rights'] = "";
114 } while (0);
115
116 if ($load_defaults == 1) {
117 $ref = "";
118 $path = "";
119 $rights = $rg_repo_rights_default;
120 $refs_rights = $rg_repo_refs_rights_default;
121 }
122
123 $repo_rights_more['rg_form_token'] = rg_token_get($db, $sid);
124 $repo_rights_more['HTML:errmsg'] = rg_template_errmsg($errmsg);
125 $repo_rights_more['HTML:del_errmsg'] = rg_template_errmsg($del_errmsg);
126 $repo_rights_more['HTML:rights_checkboxes'] = rg_rights_checkboxes("repo", $rights);
127 $repo_rights_more['HTML:refs_rights_checkboxes'] = rg_rights_checkboxes("repo_refs", $rights);
128
129 // list rights
130 $rights_list = rg_repo_rights_load($db, $ri);
131 if ($rights_list === FALSE)
132 $_rights .= rg_warning("Cannot load rights. Try later.");
133 else
134 $_rights .= rg_template_table("user/repo/rights/list", $rights_list, $repo_rights_more);
135
136 $_rights .= "<br />\n";
137
138 $_rights .= rg_template("user/repo/rights/form.html", $repo_rights_more);
139
140 // hints
141 $hints = array();
142 $hints[]['HTML:hint'] = rg_template("hints/repo/edit_rights.html", $repo_rights_more);
143 $_rights .= rg_template_table("hints/list", $hints, $repo_rights_more);
144 ?>
File inc/user/repo/bug/add/add.php deleted (index edef71e..0000000)
1 <?php
2 rg_log("/inc/user/repo/bug/add/add");
3
4 $bug_add_more = $repo_bug_more;
5 $_bug_add = "";
6 $bug_errmsg = array();
7
8 if ($doit == 0) {
9 // defaults
10 $_x = rg_bug_vars_defaults();
11 } else {
12 $_x = rg_bug_vars();
13
14 do {
15 if (!rg_token_valid($db, $sid, $token)) {
16 $bug_errmsg[] = "Invalid token. Try again.";
17 break;
18 }
19
20 $bug_id = rg_bug_edit($db, $ri, $login_ui, $_x);
21 if ($bug_id === FALSE) {
22 $bug_errmsg[] = "Cannot add bug (" . rg_bug_error() . ").";
23 break;
24 }
25
26 // redirect to bug home
27 $url = rg_re_bugpage($page_ui, $ri['name'], $bug_id);
28 rg_redirect($url);
29 } while (0);
30 }
31
32 $bug_add_more = array_merge($bug_add_more, $_x);
33 $bug_add_more['HTML:bug_errmsg'] = rg_template_errmsg($bug_errmsg);
34 $bug_add_more['rg_form_token'] = rg_token_get($db, $sid);
35 $_exclude = array(0); // exclude "Any"
36 $bug_add_more['HTML:state_select'] = rg_bug_state_select($_x['state'], $_exclude);
37 $_bug_add .= rg_template("repo/bug/bug_add_edit.html", $bug_add_more);
38 ?>
File inc/user/repo/bug/show/edit.php deleted (index 7b5c5f8..0000000)
1 <?php
2 rg_log("/inc/user/repo/bug/show/edit");
3
4 // TODO: check rights
5
6 $repo_bug_edit_more = $repo_bug_show_more;
7 $_bug_edit = "";
8
9 $bug_errmsg = array();
10
11 $_x = $ibug;
12 do {
13 if ($doit != 1)
14 break;
15
16 $_x = rg_bug_vars();
17
18 if (!rg_token_valid($db, $sid, $token)) {
19 $bug_errmsg[] = "Invalid token. Try again.";
20 break;
21 }
22
23 $ret = rg_bug_edit($db, $ri, $login_ui, $_x);
24 if ($ret === FALSE) {
25 $bug_errmsg[] = "Cannot edit bug (" . rg_bug_error() . ")";
26 break;
27 }
28
29 // redirect to bug home
30 // TODO: Should we redirect, so user can press reload to refresh the bug?
31 //$url = rg_re_bugpage($page_ui, $ri['name'], $bug_id);
32 //rg_redirect($url);
33 } while (0);
34
35 // add note form
36 $repo_bug_edit_more = array_merge($repo_bug_edit_more, $_x);
37 $repo_bug_edit_more['HTML:bug_errmsg'] = rg_template_errmsg($bug_errmsg);
38 $_exclude = array(0); // exclude "Any"
39 $repo_bug_edit_more['HTML:state_select'] = rg_bug_state_select($_x['state'], $_exclude);
40 $_bug_edit .= rg_template("repo/bug/bug_add_edit.html", $repo_bug_edit_more);
41 ?>
File root/themes/default/hints/repo/bug/add.html added (mode: 100644) (index 0000000..f3e5be8)
1 TODO: Document here the use of labels.
File root/themes/default/repo/bug/deleted.html added (mode: 100644) (index 0000000..6284a8c)
1 <div class="error">
2 You are not allowed to edit this bug.
3 </div>
File root/themes/default/repo/bug/deny_close.html added (mode: 100644) (index 0000000..82c7199)
1 <div class="error">
2 You are not allowed to edit this repo.
3 </div>
File root/themes/default/repo/bug/deny_delete.html added (mode: 100644) (index 0000000..1db3cde)
1 <div class="error">
2 You are not allowed to reopen bugs.
3 </div>
File root/themes/default/repo/bug/deny_edit.html added (mode: 100644) (index 0000000..82c7199)
1 <div class="error">
2 You are not allowed to edit this repo.
3 </div>
File root/themes/default/repo/bug/deny_reopen.html added (mode: 100644) (index 0000000..030b690)
1 <div class="error">
2 You are not allowed to close bugs.
3 </div>
File root/themes/default/user/pass_changed.html copied from file root/themes/default/user/edit_ok.html (similarity 100%)
File root/themes/default/user/repo/delete/deny.html copied from file docs/rights.txt (similarity 100%)
File root/themes/default/user/repo/deny.html added (mode: 100644) (index 0000000..82c7199)
1 <div class="error">
2 You are not allowed to edit this repo.
3 </div>
File root/themes/default/user/repo/deny_edit.html added (mode: 100644) (index 0000000..3bc641a)
1 <div class="error">
2 You are not allowed to delete this repo.
3 </div>
File root/themes/default/user/repo/rights/deny.html added (mode: 100644) (index 0000000..3bc641a)
1 <div class="error">
2 You are not allowed to delete this repo.
3 </div>
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://rocketgit.com/user/catalinux/rocketgit

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/catalinux/rocketgit

Clone this repository using git:
git clone git://git.rocketgit.com/user/catalinux/rocketgit

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