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 645d3deb19e399c05a8b14dd88c5151520482b6a

Bulk changes.
Author: Catalin(ux) M. BOIE
Author date (UTC): 2011-08-25 20:39
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2011-08-25 20:41
Parent(s): 3867eb5deadf9827450b40a53efe6c83f518a07b
Signing key:
Tree: 72f526f13ab110812c0f5343ac2be89388f0cc64
File Lines added Lines deleted
TODO 5 0
admin/update.php 2 2
duilder 5 12
inc/admin/users/user.form.php 23 25
inc/dispatch/dispatch.php 2 6
inc/feedback/suggestion.form.php 7 10
inc/feedback/suggestion.php 1 1
inc/keys/add.form.php 6 7
inc/keys/keys.php 12 6
inc/login/login.form.php 10 9
inc/login/login.php 2 1
inc/personal/pass.form.php 11 12
inc/personal/personal.php 15 11
inc/repo/repo.form.php 8 9
inc/repo/repo.php 16 7
inc/repo/rights.form.php 8 9
inc/repo/search.form.php 7 8
inc/user/confirm.php 3 2
inc/user/forgot.form.php 8 9
inc/user/forgot.php 3 2
inc/user/forgot_send.form.php 6 6
inc/user/forgot_send.php 3 0
inc/util.inc.php 47 0
root/index.php 11 20
root/themes/default/index.php 4 0
root/themes/default/main.css 9 1
File TODO changed (mode: 100644) (index 2a6640d..2711216)
15 15 [ ] [ ]
16 16
17 17 == Normal priority == == Normal priority ==
18 [ ] "Lock" button to temporary block access to repository.
19 Only owner will have access.
20 We may add also a text that will be output to clients.
21 [ ] List chages introduced by a merge: git diff-tree --always [--cc] -m -p f7d5b5770f4c6b5a124dad6358bed310d56bf909
22 [ ] ACL per IP (only for private repos).
18 23 [ ] Check pack-protocol.txt! [ ] Check pack-protocol.txt!
19 24 [ ] When push is executed with success, show a nice message from RocketGit. [ ] When push is executed with success, show a nice message from RocketGit.
20 25 [ ] Move is_private member in repo array, not test for empty on default rights [ ] Move is_private member in repo array, not test for empty on default rights
File admin/update.php changed (mode: 100644) (index 8eb5a09..acb1a81)
1 1 <?php <?php
2 // This is executed at every update
2 // This must be executed at every update
3 3 error_reporting(E_ALL); error_reporting(E_ALL);
4 4 ini_set("track_errors", "On"); ini_set("track_errors", "On");
5 5
 
... ... if (rg_state_set("schema_version", $rg_sql_schema_version) !== TRUE) {
45 45 } }
46 46
47 47 if (rg_sql_commit($db) !== TRUE) { if (rg_sql_commit($db) !== TRUE) {
48 echo "RocketGit: Cannot start transaction (" . rg_sql_error() . ")!\n";
48 echo "RocketGit: Cannot commit transaction (" . rg_sql_error() . ")!\n";
49 49 exit(1); exit(1);
50 50 } }
51 51
File duilder changed (mode: 100755) (index f8ee87e..081d1c2)
... ... function duilder_git()
95 95 echo -n > Changelog echo -n > Changelog
96 96
97 97 # get the list of tags # get the list of tags
98 i=0
99 98 number_of_tags=0 number_of_tags=0
100 for tag in `git tag -l`; do
101 if [ "${tag:0:1}" != "v" ]; then
102 # skip other kind of tags beside versions
103 continue
104 fi
105
106 tags[${i}]=${tag}
107 tags_commit[${i}]=`git show-ref ${tag} | cut -d' ' -f1`
99 while read sha1 full_tag; do
100 tag=`echo ${full_tag} | sed -e 's#refs/tags/##' | cut -d'^' -f1`
101 tags[${number_of_tags}]=${tag}
102 tags_commit[${number_of_tags}]=${sha1}
108 103 number_of_tags=$[${number_of_tags}+1] number_of_tags=$[${number_of_tags}+1]
109
110 i=$[${i}+1]
111 done
104 done < <(git show-ref --tags -d | grep refs/tags/v)
112 105
113 106 # get the list of commits, test if is a tag and do the diff # get the list of commits, test if is a tag and do the diff
114 107 prev="" prev=""
File inc/admin/users/user.form.php changed (mode: 100644) (index 2c24d86..243ea91)
1 1 <?php <?php
2 $_form = "";
2 $_form = '<div class="formarea">';
3 3
4 4 if ($admin_mode == 1) { if ($admin_mode == 1) {
5 5 $sel_is_admin = array(0 => "", 1 => ""); $sel_is_admin = array(0 => "", 1 => "");
6 6 $sel_is_admin[$is_admin] = " selected=\"selected\""; $sel_is_admin[$is_admin] = " selected=\"selected\"";
7 7 } }
8 8
9 $_form .= '<div class="formarea">';
10
11 9 if (count($errmsg) > 0) if (count($errmsg) > 0)
12 $_form .= '<span class="error">' . implode("<br />\n", $error) . '</span><br /><br />' . "\n";
10 $_form .= '<span class="error">' . implode("<br />\n", $errmsg) . '</span><br /><br />' . "\n";
13 11
14 12 $_form .= ' $_form .= '
15 13 <form method="post" action="' . $_SERVER['PHP_SELF'] . '"> <form method="post" action="' . $_SERVER['PHP_SELF'] . '">
16 <input type="hidden" name="op" value="' . $op . '">
17 <input type="hidden" name="subop" value="' . $subop . '">
18 <input type="hidden" name="subsubop" value="' . $subsubop . '">
19 <input type="hidden" name="doit" value="1">
20 <input type="hidden" name="token" value="' . rg_token_get($db, $sid) . '">
21 <input type="hidden" name="uid" value="' . $uid . '">
14 <input type="hidden" name="op" value="' . $op . '" />
15 <input type="hidden" name="subop" value="' . $subop . '" />
16 <input type="hidden" name="subsubop" value="' . $subsubop . '" />
17 <input type="hidden" name="doit" value="1" />
18 <input type="hidden" name="token" value="' . rg_token_get($db, $sid) . '" />
19 <input type="hidden" name="uid" value="' . $uid . '" />
22 20
23 21 <label for="xuser"> <label for="xuser">
24 User name<br />
25 <input type="text" name="xuser" value="' . $xuser . '"/>
22 <span class="form_item_title">User name</span><br />
23 <input type="text" name="xuser" value="' . $xuser . '" />
26 24 </label> </label>
27 25 <br /> <br />
28 26 <br /> <br />
29 27
30 28 <label for="email"> <label for="email">
31 E-mail<br />
32 <input type="text" name="email" value="' . $email . '"/>
29 <span class="form_item_title">E-mail</span><br />
30 <input type="text" name="email" value="' . $email . '" />
33 31 </label> </label>
34 32 <br /> <br />
35 33 <br /> <br />
 
... ... E-mail<br />
38 36 if ($pass_mode > 0) { if ($pass_mode > 0) {
39 37 $_form .= ' $_form .= '
40 38 <label for="xpass"> <label for="xpass">
41 Password<br />
42 <input type="password" name="xpass" value="' . $xpass . '"/>
39 <span class="form_item_title">Password</span><br />
40 <input type="password" name="xpass" value="' . $xpass . '" />
43 41 </label> </label>
44 42 <br /> <br />
45 43 <br /> <br />
 
... ... Password<br />
49 47 if ($pass_mode > 1) { if ($pass_mode > 1) {
50 48 $_form .= ' $_form .= '
51 49 <label for="xpass2"> <label for="xpass2">
52 Password (confirmation)<br />
53 <input type="password" name="xpass2" value="' . $xpass2 . '"/>
50 <span class="form_item_title">Password (confirmation)</span><br />
51 <input type="password" name="xpass2" value="' . $xpass2 . '" />
54 52 </label> </label>
55 53 <br /> <br />
56 54 <br /> <br />
 
... ... Password (confirmation)<br />
60 58 if ($admin_mode == 1) { if ($admin_mode == 1) {
61 59 $_form .= ' $_form .= '
62 60 <label for="is_admin"> <label for="is_admin">
63 Admin?<br />
61 <span class="form_item_title">Admin?</span><br />
64 62 <select name="is_admin"> <select name="is_admin">
65 63 <option value="0"' . $sel_is_admin[0] . '>No</option> <option value="0"' . $sel_is_admin[0] . '>No</option>
66 64 <option value="1"' . $sel_is_admin[1] . '>Yes</option> <option value="1"' . $sel_is_admin[1] . '>Yes</option>
 
... ... Admin?<br />
70 68 <br /> <br />
71 69
72 70 <label for="disk_quota_mb"> <label for="disk_quota_mb">
73 Disk quota (MiB)<br />
74 <input type="text" name="disk_quota_mb" value="' . $disk_quota_mb . '"/>
71 <span class="form_item_title">Disk quota (MiB)</span><br />
72 <input type="text" name="disk_quota_mb" value="' . $disk_quota_mb . '" />
75 73 </label> </label>
76 74 <br /> <br />
77 75 <br /> <br />
78 76
79 77 <label for="rights"> <label for="rights">
80 Rights<br />
78 <span class="form_item_title">Rights</span><br />
81 79 ' . rg_rights_checkboxes("user", $rights) . ' ' . rg_rights_checkboxes("user", $rights) . '
82 80 </label> </label>
83 81 <br /> <br />
 
... ... Rights<br />
87 85
88 86 $_form .= ' $_form .= '
89 87 <label for="session_time"> <label for="session_time">
90 Preferred session time (in seconds)<br />
91 <input type="text" name="session_time" value="' . $session_time . '"/>
88 <span class="form_item_title">Preferred session time (in seconds)</span><br />
89 <input type="text" name="session_time" value="' . $session_time . '" />
92 90 </label> </label>
93 91 <br /> <br />
94 92 <br /> <br />
95 93
96 94 <label for="button"> <label for="button">
97 <input type="submit" value="Go!"/>
95 <input type="submit" value="Go!" />
98 96 </label> </label>
99 97 </form> </form>
100 98 </div> </div>
File inc/dispatch/dispatch.php changed (mode: 100644) (index 5b9d59c..da9dcbd)
1 1 <?php <?php
2 2 rg_log("/inc/dispatch/dispatch"); rg_log("/inc/dispatch/dispatch");
3 3
4 $new_op = "";
5
6 4 switch ($op) { switch ($op) {
7 5 case 'home': case 'home':
8 6 include($INC . "/home/home.php"); include($INC . "/home/home.php");
 
... ... case 'login':
16 14
17 15 case 'logout': case 'logout':
18 16 if (rg_sess_destroy($db, $sid, $rg_ui)) { if (rg_sess_destroy($db, $sid, $rg_ui)) {
19 $new_op = "bye";
17 $redispatch = 1;
18 $op = "bye";
20 19 } else { } else {
21 20 $body .= "Not OK!"; $body .= "Not OK!";
22 21 } }
 
... ... default:
81 80 rg_log("Invalid operation!"); rg_log("Invalid operation!");
82 81 } }
83 82
84 $op = $new_op;
85 if (!empty($op))
86 rg_log("new op=$op.");
87 83 ?> ?>
File inc/feedback/suggestion.form.php changed (mode: 100644) (index b6935e0..58cbabc)
1 1 <?php <?php
2
3 $_form = "";
4
5 $_form .= '<div class="formarea">';
2 $_form = '<div class="formarea">';
6 3
7 4 if (count($errmsg) > 0) if (count($errmsg) > 0)
8 $_form .= '<span class="error">' . implode("<br />\n", $error) . '</span><br /><br />' . "\n";
5 $_form .= '<span class="error">' . implode("<br />\n", $errmsg) . '</span><br /><br />' . "\n";
9 6
10 7 $_form .= ' $_form .= '
11 8 <form method="post" action="' . rg_re_post("suggestion") . '"> <form method="post" action="' . rg_re_post("suggestion") . '">
12 <input type="hidden" name="op" value="suggestion">
13 <input type="hidden" name="doit" value="1">
14 <input type="hidden" name="token" value="' . rg_token_get($db, $sid) . '">
9 <input type="hidden" name="op" value="suggestion" />
10 <input type="hidden" name="doit" value="1" />
11 <input type="hidden" name="token" value="' . rg_token_get($db, $sid) . '" />
15 12
16 13 <label for="email"> <label for="email">
17 14 <span class="form_item_title">E-mail</span><br /> <span class="form_item_title">E-mail</span><br />
18 <input type="text" name="email" value="' . $email . '">
15 <input type="text" name="email" value="' . $email . '" />
19 16 </label> </label>
20 17 <br /> <br />
21 18 <br /> <br />
 
... ... $_form .= '
28 25 <br /> <br />
29 26
30 27 <label for="button"> <label for="button">
31 <input type="submit" value="Send">
28 <input type="submit" name="button" value="Send" />
32 29 </label> </label>
33 30
34 31 </form> </form>
File inc/feedback/suggestion.php changed (mode: 100644) (index bad041a..f00e80f)
... ... if ($doit == 1) {
12 12
13 13 while (1) { while (1) {
14 14 if (!rg_token_valid($db, $sid, $token)) { if (!rg_token_valid($db, $sid, $token)) {
15 $error[] = "Invalid token. Try again.";
15 $errmsg[] = "Invalid token. Try again.";
16 16 break; break;
17 17 } }
18 18
File inc/keys/add.form.php changed (mode: 100644) (index 744d24b..13fbc1a)
1 1 <?php <?php
2
3 2 $_form = '<div class="formarea">'; $_form = '<div class="formarea">';
4 3
5 4 if (count($errmsg) > 0) if (count($errmsg) > 0)
6 $_form .= '<span class="error">' . implode("<br />\n", $error) . '</span><br /><br />' . "\n";
5 $_form .= '<span class="error">' . implode("<br />\n", $errmsg) . '</span><br /><br />' . "\n";
7 6
8 7 $_form .= ' $_form .= '
9 8 <form method="post" action="' . $_SERVER['PHP_SELF'] . '"> <form method="post" action="' . $_SERVER['PHP_SELF'] . '">
10 <input type="hidden" name="op" value="' . $op . '">
11 <input type="hidden" name="subop" value="' . $subop . '">
12 <input type="hidden" name="doit" value="1">
13 <input type="hidden" name="token" value="' . rg_token_get($db, $sid) . '">
9 <input type="hidden" name="op" value="' . $op . '" />
10 <input type="hidden" name="subop" value="' . $subop . '" />
11 <input type="hidden" name="doit" value="1" />
12 <input type="hidden" name="token" value="' . rg_token_get($db, $sid) . '" />
14 13
15 14 <label for="key"> <label for="key">
16 15 <span class="form_item_title">Key (starts with ssh-...)</span><br /> <span class="form_item_title">Key (starts with ssh-...)</span><br />
 
... ... $_form .= '
20 19 <br /> <br />
21 20
22 21 <label for="button"> <label for="button">
23 <input type="submit" value="Add!" />
22 <input type="submit" name="button" value="Add!" />
24 23 </label> </label>
25 24
26 25 </form> </form>
File inc/keys/keys.php changed (mode: 100644) (index 7f4d89f..f78451d)
... ... $key_id = rg_var_uint("key_id");
14 14
15 15 // menu // menu
16 16 $_url = rg_re_url($op); $_url = rg_re_url($op);
17 $_menu = "";
18 $_menu .= "[<a href=\"$_url&amp;subop=1\">Add</a>]";
19 $_menu .= "&nbsp;[<a href=\"$_url&amp;subop=2\">List</a>]";
20 $_menu .= "<br />\n";
21 $_menu .= "<br />\n";
17
18 $second_menu = array(
19 "add_key" => array(
20 "text" => "Add key",
21 "url" => "&amp;subop=1"
22 ),
23 "list_keys" => array(
24 "text" => "List keys",
25 "url" => "&amp;subop=2"
26 )
27 );
22 28
23 29 $_body = ""; $_body = "";
24 30 $errmsg = array(); $errmsg = array();
 
... ... case 2: // list
48 54
49 55 } }
50 56
51 $_keys .= $_menu . $_body;
57 $_keys .= $_body;
52 58 ?> ?>
File inc/login/login.form.php changed (mode: 100644) (index 4897d66..6113e29)
2 2 $_form = '<div class="formarea">'; $_form = '<div class="formarea">';
3 3
4 4 if (count($errmsg) > 0) if (count($errmsg) > 0)
5 $_form .= '<span class="error">' . implode("<br />\n", $error) . '</span><br /><br />' . "\n";
5 $_form .= '<span class="error">' . implode("<br />\n", $errmsg) . '</span><br /><br />' . "\n";
6 6
7 7 $_form .= ' $_form .= '
8 8 <form method="post" action="' . $_SERVER['PHP_SELF'] . '"> <form method="post" action="' . $_SERVER['PHP_SELF'] . '">
9 <input type="hidden" name="op" value="' . $op . '">
10 <input type="hidden" name="subop" value="1">
11 <input type="hidden" name="doit" value="1">
9 <input type="hidden" name="op" value="' . $op . '" />
10 <input type="hidden" name="subop" value="1" />
11 <input type="hidden" name="doit" value="1" />
12 12
13 13 <label for="username"> <label for="username">
14 Username<br />
15 <input type="text" name="user" value="' . $user . '">
14 <span class="form_item_title">Username</span><br />
15 <input type="text" name="user" value="' . $user . '" />
16 16 </label> </label>
17 17 <br /> <br />
18 18 <br /> <br />
19 19
20 20 <label for="password"> <label for="password">
21 Password<br />
22 <input type="password" name="pass" value="' . $pass . '">
21 <span class="form_item_title">Password</span><br />
22 <input type="password" name="pass" value="' . $pass . '" />
23 23 </label> </label>
24 24 <br /> <br />
25 25 <br /> <br />
26 26
27 27 <label for="button"> <label for="button">
28 <input type="submit" value="Login">
28 <input type="submit" name="button" value="Login" />
29 29 </label> </label>
30 30 </form> </form>
31 31 <br /> <br />
32
32 33 <a href="' . rg_re_url("forgot_send") . '">Forgot your password?</a> <a href="' . rg_re_url("forgot_send") . '">Forgot your password?</a>
33 34 '; ';
34 35
File inc/login/login.php changed (mode: 100644) (index 31c1688..856a513)
... ... if ($doit == 1) {
15 15 $errmsg[] = rg_user_error(); $errmsg[] = rg_user_error();
16 16 } else { } else {
17 17 $show_form = 0; $show_form = 0;
18 $new_op = "home"; // redirect to home page
18 $redispatch = 1;
19 $op = "home"; // redirect to home page
19 20 } }
20 21 } }
21 22
File inc/personal/pass.form.php changed (mode: 100644) (index ad63df0..5206d86)
1 1 <?php <?php
2 $_chpass_form = '<div class="formarea">';
2 3
3 $_chpass_form = '<div class="formarea">' . "\n";
4
5 if (count($error) > 0)
6 $_chpass_form .= '<span class="error">' . implode("<br />\n", $error) . '</span><br /><br />' . "\n";
4 if (count($errmsg) > 0)
5 $_chpass_form .= '<span class="error">' . implode("<br />\n", $errmsg) . '</span><br /><br />' . "\n";
7 6
8 7 $_chpass_form .= ' $_chpass_form .= '
9 8 <form method="post" action="' . $_SERVER['PHP_SELF'] . '"> <form method="post" action="' . $_SERVER['PHP_SELF'] . '">
10 <input type="hidden" name="op" value="' . $op . '">
11 <input type="hidden" name="doit" value="1">
12 <input type="hidden" name="token" value="' . rg_token_get($db, $sid) . '">
9 <input type="hidden" name="op" value="' . $op . '" />
10 <input type="hidden" name="doit" value="1" />
11 <input type="hidden" name="token" value="' . rg_token_get($db, $sid) . '" />
13 12
14 <label for="pldpass">
13 <label for="old_pass">
15 14 <span class="form_item_title">Old password</span><br /> <span class="form_item_title">Old password</span><br />
16 <input type="password" name="old_pass" value="">
15 <input type="password" name="old_pass" value="" />
17 16 </label> </label>
18 17 <br /> <br />
19 18 <br /> <br />
20 19
21 20 <label for="pass1"> <label for="pass1">
22 21 <span class="form_item_title">New password</span><br /> <span class="form_item_title">New password</span><br />
23 <input type="password" name="pass1" value="">
22 <input type="password" name="pass1" value="" />
24 23 </label> </label>
25 24 <br /> <br />
26 25 <br /> <br />
27 26
28 27 <label for="pass2"> <label for="pass2">
29 28 <span class="form_item_title">New password (re-type)</span><br /> <span class="form_item_title">New password (re-type)</span><br />
30 <input type="password" name="pass2" value="">
29 <input type="password" name="pass2" value="" />
31 30 </label> </label>
32 31 <br /> <br />
33 32 <br /> <br />
34 33
35 34 <label for="button"> <label for="button">
36 <input type="submit" value="Change password">
35 <input type="submit" name="button" value="Change password" />
37 36 </label> </label>
38 37
39 38 </form> </form>
File inc/personal/personal.php changed (mode: 100644) (index 518b7d4..6c62b95)
... ... if ($rg_ui['uid'] == 0) {
9 9 } }
10 10
11 11 // menu // menu
12 $_url = rg_re_url($op);
13 $_menu = "";
14 $_menu .= "[<a href=\"$_url&amp;subop=1\">Edit info</a>]";
15 $_menu .= "&nbsp;[<a href=\"$_url&amp;subop=2\">Change pass</a>]";
16 $_menu .= "<br />\n";
17 $_menu .= "<br />\n";
12 $second_menu = array(
13 "edit_info" => array(
14 "text" => "Edit info",
15 "url" => "&amp;subop=1"
16 ),
17 "change_pass" => array(
18 "text" => "Change password",
19 "url" => "&amp;subop=2"
20 )
21 );
18 22
19 23 $errmsg = array(); $errmsg = array();
20 24 $_body = ""; $_body = "";
 
... ... case 2: // change password
72 76
73 77 while (1) { while (1) {
74 78 if (!rg_token_valid($db, $sid, $token)) { if (!rg_token_valid($db, $sid, $token)) {
75 $error[] = "Invalid token. Try again.";
79 $errmsg[] = "Invalid token. Try again.";
76 80 break; break;
77 81 } }
78 82
79 83 if (strcmp($pass1, $pass2) != 0) { if (strcmp($pass1, $pass2) != 0) {
80 $error[] = "Passwords does not match!";
84 $errmsg[] = "Passwords does not match!";
81 85 break; break;
82 86 } }
83 87
84 88 if (!rg_user_pass_valid($db, $rg_ui['uid'], $old_pass)) { if (!rg_user_pass_valid($db, $rg_ui['uid'], $old_pass)) {
85 $error[] = "Old password is invalid!";
89 $errmsg[] = "Old password is invalid!";
86 90 break; break;
87 91 } }
88 92
89 93 if (!rg_user_set_pass($db, $rg_ui['uid'], $pass1)) { if (!rg_user_set_pass($db, $rg_ui['uid'], $pass1)) {
90 $error[] = rg_user_error();
94 $errmsg[] = rg_user_error();
91 95 break; break;
92 96 } }
93 97
 
... ... case 2: // change password
105 109 break; break;
106 110 } }
107 111
108 $_personal .= $_menu . $_body;
112 $_personal .= $_body;
109 113 ?> ?>
File inc/repo/repo.form.php changed (mode: 100644) (index c836302..c76ed92)
1 1 <?php <?php
2
3 2 $_form = '<div class="formarea">'; $_form = '<div class="formarea">';
4 3
5 4 if (count($errmsg) > 0) if (count($errmsg) > 0)
6 $_form .= '<span class="error">' . implode("<br />\n", $error) . '</span><br /><br />' . "\n";
5 $_form .= '<span class="error">' . implode("<br />\n", $errmsg) . '</span><br /><br />' . "\n";
7 6
8 7 $_form .= ' $_form .= '
9 8 <form method="post" action="' . $_SERVER['PHP_SELF'] . '"> <form method="post" action="' . $_SERVER['PHP_SELF'] . '">
10 <input type="hidden" name="op" value="' . $op . '">
11 <input type="hidden" name="subop" value="' . $subop . '">
12 <input type="hidden" name="repo_id" value="' . $repo_id . '">
13 <input type="hidden" name="master_repo_id" value="' . $master_repo_id . '">
14 <input type="hidden" name="doit" value="1">
15 <input type="hidden" name="token" value="' . rg_token_get($db, $sid) . '">
9 <input type="hidden" name="op" value="' . $op . '" />
10 <input type="hidden" name="subop" value="' . $subop . '" />
11 <input type="hidden" name="repo_id" value="' . $repo_id . '" />
12 <input type="hidden" name="master_repo_id" value="' . $master_repo_id . '" />
13 <input type="hidden" name="doit" value="1" />
14 <input type="hidden" name="token" value="' . rg_token_get($db, $sid) . '" />
16 15
17 16 '; ';
18 17
 
... ... $_form .= '
63 62 <br /> <br />
64 63
65 64 <label for="button"> <label for="button">
66 <input type="submit" value="' . $_action . '" />
65 <input type="submit" name="button" value="' . $_action . '" />
67 66 </label> </label>
68 67
69 68 </form> </form>
File inc/repo/repo.php changed (mode: 100644) (index 4ddaa28..24671e0)
... ... $masters = rg_var_uint("masters");
21 21
22 22 // menu // menu
23 23 $_url = rg_re_url($op); $_url = rg_re_url($op);
24 $_menu = "";
25 $_menu .= "[<a href=\"$_url&amp;subop=1\">Create</a>]";
26 $_menu .= "&nbsp;[<a href=\"$_url&amp;subop=2\">List</a>]";
27 $_menu .= "&nbsp;[<a href=\"$_url&amp;subop=3\">Search</a>]";
28 $_menu .= "<br />\n";
29 $_menu .= "<br />\n";
24
25 $second_menu = array(
26 "create_repo" => array(
27 "text" => "Create",
28 "url" => "&amp;subop=1"
29 ),
30 "list_repos" => array(
31 "text" => "List",
32 "url" => "&amp;subop=2"
33 ),
34 "search_repo" => array(
35 "text" => "Search",
36 "url" => "&amp;subop=3"
37 )
38 );
30 39
31 40 $_body = ""; $_body = "";
32 41
 
... ... case 3: // search
66 75 break; break;
67 76 } }
68 77
69 $_repo .= $_menu . $_body;
78 $_repo .= $_body;
70 79 ?> ?>
File inc/repo/rights.form.php changed (mode: 100644) (index 9028216..ebc8efd)
1 1 <?php <?php
2
3 2 $_form = '<div class="formarea">'; $_form = '<div class="formarea">';
4 3
5 4 if (count($errmsg) > 0) if (count($errmsg) > 0)
6 $_form .= '<span class="error">' . implode("<br />\n", $error) . '</span><br /><br />' . "\n";
5 $_form .= '<span class="error">' . implode("<br />\n", $errmsg) . '</span><br /><br />' . "\n";
7 6
8 7 <form method="post" action="' . $_SERVER['PHP_SELF'] . '"> <form method="post" action="' . $_SERVER['PHP_SELF'] . '">
9 <input type="hidden" name="op" value="' . $op . '">
10 <input type="hidden" name="subop" value="' . $subop . '">
11 <input type="hidden" name="repo_id" value="' . $repo_id . '">
12 <input type="hidden" name="doit" value="1">
13 <input type="hidden" name="token" value="' . rg_token_get($db, $sid) . '">
8 <input type="hidden" name="op" value="' . $op . '" />
9 <input type="hidden" name="subop" value="' . $subop . '" />
10 <input type="hidden" name="repo_id" value="' . $repo_id . '" />
11 <input type="hidden" name="doit" value="1" />
12 <input type="hidden" name="token" value="' . rg_token_get($db, $sid) . '" />
14 13
15 14 <label for="user"> <label for="user">
16 <span class="form_item_title">User</span><br/>
15 <span class="form_item_title">User</span><br />
17 16 <input type="text" name="user" value="' . $user . '" /> <input type="text" name="user" value="' . $user . '" />
18 17 </label> </label>
19 18 <br /> <br />
 
... ... if (count($errmsg) > 0)
27 26 <br /> <br />
28 27
29 28 <label for="button"> <label for="button">
30 <input type="submit" value="Grant">
29 <input type="submit" name="button" value="Grant" />
31 30 </label> </label>
32 31
33 32 </form> </form>
File inc/repo/search.form.php changed (mode: 100644) (index 79d1fb8..f69148a)
1 1 <?php <?php
2
3 2 $_form = '<div class="formarea">'; $_form = '<div class="formarea">';
4 3
5 4 if (count($errmsg) > 0) if (count($errmsg) > 0)
6 $_form .= '<span class="error">' . implode("<br />\n", $error) . '</span><br /><br />' . "\n";
5 $_form .= '<span class="error">' . implode("<br />\n", $errmsg) . '</span><br /><br />' . "\n";
7 6
8 7 $_form .= ' $_form .= '
9 8 <form method="post" action="' . $_SERVER['PHP_SELF'] . '"> <form method="post" action="' . $_SERVER['PHP_SELF'] . '">
10 <input type="hidden" name="op" value="' . $op . '">
11 <input type="hidden" name="subop" value="' . $subop . '">
12 <input type="hidden" name="doit" value="1">
9 <input type="hidden" name="op" value="' . $op . '" />
10 <input type="hidden" name="subop" value="' . $subop . '" />
11 <input type="hidden" name="doit" value="1" />
13 12
14 13 <label for="q"> <label for="q">
15 14 <span class="form_item_title">Name</span><br /> <span class="form_item_title">Name</span><br />
16 <input type="text" name="q" value="">
15 <input type="text" name="q" value="" />
17 16 </label> </label>
18 17 <br /> <br />
19 18 <br /> <br />
 
... ... $_form .= '
28 27 <br /> <br />
29 28 <br /> <br />
30 29
31 <label="button">
32 <input type="submit" value="Search!">
30 <label for="button">
31 <input type="submit" name="button" value="Search!" />
33 32 </label> </label>
34 33
35 34 </form> </form>
File inc/user/confirm.php changed (mode: 100644) (index 6b03dae..a47db95)
... ... if ($uid === FALSE) {
10 10 $_confirm .= "Internal error!"; $_confirm .= "Internal error!";
11 11 } else { } else {
12 12 // auto-login // auto-login
13 $redispatch = 1;
13 14 if (rg_user_auto_login($db, $uid, $rg_ui)) if (rg_user_auto_login($db, $uid, $rg_ui))
14 $new_op = "home";
15 $op = "home";
15 16 else else
16 $new_op = "login";
17 $op = "login";
17 18 } }
18 19
19 20 ?> ?>
File inc/user/forgot.form.php changed (mode: 100644) (index 874474f..c4dbc0c)
1 1 <?php <?php
2
3 2 $_forgot_form = '<div class="formarea">'; $_forgot_form = '<div class="formarea">';
4 3
5 4 if (count($errmsg) > 0) if (count($errmsg) > 0)
6 $_forgot_form .= '<span class="error">' . implode("<br />\n", $error) . '</span><br /><br />' . "\n";
5 $_forgot_form .= '<span class="error">' . implode("<br />\n", $errmsg) . '</span><br /><br />' . "\n";
7 6
8 7 $_forgot_form .= ' $_forgot_form .= '
9 8 <form method="post" action="' . $_SERVER['PHP_SELF'] . '"> <form method="post" action="' . $_SERVER['PHP_SELF'] . '">
10 <input type="hidden" name="op" value="' . $op . '">
11 <input type="hidden" name="forgot_token" value="' . $forgot_token . '">
12 <input type="hidden" name="doit" value="1">
13 <input type="hidden" name="token" value="' . rg_token_get($db, $sid) . '">
9 <input type="hidden" name="op" value="' . $op . '" />
10 <input type="hidden" name="forgot_token" value="' . $forgot_token . '" />
11 <input type="hidden" name="doit" value="1" />
12 <input type="hidden" name="token" value="' . rg_token_get($db, $sid) . '" />
14 13
15 14 <label for="pass1"> <label for="pass1">
16 15 <span class="form_item_title">New password</span<br /> <span class="form_item_title">New password</span<br />
17 <input type="password" name="pass1" value="">
16 <input type="password" name="pass1" value="" />
18 17 </label> </label>
19 18 <br /> <br />
20 19 <br /> <br />
21 20
22 21 <label for="pass2"> <label for="pass2">
23 22 <span class="form_item_title">New password (retype)</span><br /> <span class="form_item_title">New password (retype)</span><br />
24 <input type="password" name="pass2" value="">
23 <input type="password" name="pass2" value="" />
25 24 </label> </label>
26 25 <br /> <br />
27 26 <br /> <br />
28 27
29 28 <label for="button"> <label for="button">
30 <input type="submit" value="Change password">
29 <input type="submit" name="button" value="Change password" />
31 30 </label> </label>
32 31
33 32 </form> </form>
File inc/user/forgot.php changed (mode: 100644) (index 97c3dc3..380a51f)
... ... if ($doit == 1) {
32 32
33 33 rg_user_forgot_pass_destroy($db, $r['uid']); rg_user_forgot_pass_destroy($db, $r['uid']);
34 34 // auto-login // auto-login
35 $redispatch = 1;
35 36 $_hide_form = 1; $_hide_form = 1;
36 37 if (rg_user_auto_login($db, $r['uid'], $rg_ui)) if (rg_user_auto_login($db, $r['uid'], $rg_ui))
37 $new_op = "home";
38 $op = "home";
38 39 else else
39 $new_op = "login";
40 $op = "login";
40 41 } }
41 42 } }
42 43
File inc/user/forgot_send.form.php changed (mode: 100644) (index 7fa194b..a5c9e35)
2 2 $_form = '<div class="formarea">'; $_form = '<div class="formarea">';
3 3
4 4 if (count($errmsg) > 0) if (count($errmsg) > 0)
5 $_form .= '<span class="error">' . implode("<br />\n", $error) . '</span><br /><br />' . "\n";
5 $_form .= '<span class="error">' . implode("<br />\n", $errmsg) . '</span><br /><br />' . "\n";
6 6
7 7 $_form .= ' $_form .= '
8 8 <form method="post" action="' . $_SERVER['PHP_SELF'] . '"> <form method="post" action="' . $_SERVER['PHP_SELF'] . '">
9 <input type="hidden" name="op" value="forgotsend">
10 <input type="hidden" name="subop" value="2">
11 <input type="hidden" name="doit" value="1">
9 <input type="hidden" name="op" value="forgotsend" />
10 <input type="hidden" name="subop" value="2" />
11 <input type="hidden" name="doit" value="1" />
12 12
13 13 <label for="email"> <label for="email">
14 14 <span class="form_item_title">E-mail</span><br /> <span class="form_item_title">E-mail</span><br />
15 <input type="text" name="email" value="">
15 <input type="text" name="email" value="' . $email . '" />
16 16 </label> </label>
17 17 <br /> <br />
18 18 <br /> <br />
19 19
20 20 <label for="button"> <label for="button">
21 <input type="submit" value="Recover password">
21 <input type="submit" name="button" value="Recover password" />
22 22 </label> </label>
23 23
24 24 </form> </form>
File inc/user/forgot_send.php changed (mode: 100644) (index aa9966c..6b50ef2)
... ... if ($doit == 1) {
16 16 $_forgot .= "E-mail was sent!"; $_forgot .= "E-mail was sent!";
17 17 $show_form = 0; $show_form = 0;
18 18 } }
19 } else {
20 // defaults
21 $email = "";
19 22 } }
20 23
21 24 if ($show_form == 1) { if ($show_form == 1) {
File inc/util.inc.php changed (mode: 100644) (index 5cf5450..41c1b09)
... ... function rg_fatal($msg)
181 181 exit(1); exit(1);
182 182 } }
183 183
184 /*
185 * Generates a menu
186 */
187 function rg_menu($a, $rg_ui)
188 {
189 $menu = "";
190 $menu2 = "";
191 $add = "";
192 foreach ($a as $_op => $_info) {
193 // we ignore fake menus like 'home'
194 if (!isset($_info['text']))
195 continue;
196
197 if (isset($_info['needs_admin']) && ($rg_ui['is_admin'] == 0))
198 continue;
199
200 if (isset($_info['uid0']) && ($rg_ui['uid'] > 0))
201 continue;
202
203 if (!isset($_info['uid0']) && ($rg_ui['uid'] == 0))
204 continue;
205
206 $_text = $_info['text'];
207 $_url = rg_re_url($_op);
208 $menu .= $add . "<a class=\"menu\" href=\""
209 . $_url . "\">$_text</a>\n";
210 $add = "\t";
211
212 if (!isset($_info['sub']) || (count($_info['sub']) == 0))
213 continue;
214
215 foreach ($_info['sub'] as $junk => $_info2) {
216 $_text2 = $_info2['text'];
217 $menu2 .= "\t<a class=\"menu\" href=\""
218 . $_url . $_info2['url']
219 . "\">$_text2</a>\n";
220 }
221 }
222
223 $ret = array();
224 $ret[0] = $menu;
225 if (!empty($menu2))
226 $ret[1] = $menu2;
227
228 return $ret;
229 }
230
184 231 ?> ?>
File root/index.php changed (mode: 100644) (index df569f9..4b44b8d)
... ... if ($db === FALSE)
44 44 rg_user_login_by_sid($db, $sid, $rg_ui); rg_user_login_by_sid($db, $sid, $rg_ui);
45 45 rg_log("After login_by_sid, rg_ui=" . print_r($rg_ui, TRUE)); rg_log("After login_by_sid, rg_ui=" . print_r($rg_ui, TRUE));
46 46
47
47 48 $body = ""; $body = "";
48 49 // Chain dispatching // Chain dispatching
49 50 do { do {
51 $redispatch = 0;
52
53 // Re-init second line menu
54 $second_menu = array();
55
50 56 include($INC . "/dispatch/dispatch.php"); include($INC . "/dispatch/dispatch.php");
51 } while (strcmp($op, "") != 0);
57 } while ($redispatch == 1);
52 58
53 59
54 60 // menu // menu
55 $amenu = array(
61 $first_menu = array(
56 62 "login" => array("text" => "Login", "uid0" => 1), "login" => array("text" => "Login", "uid0" => 1),
57 63 "personal" => array("text" => "Personal"), "personal" => array("text" => "Personal"),
58 64 "repo" => array("text" => "Repositories"), "repo" => array("text" => "Repositories"),
 
... ... $amenu = array(
61 67 "suggestion"=> array("text" => "Suggestion"), "suggestion"=> array("text" => "Suggestion"),
62 68 "logout" => array("text" => "Logout") "logout" => array("text" => "Logout")
63 69 ); );
64
65 $menu = "";
66 $add = "";
67 foreach ($amenu as $_op => $_info) {
68 if (isset($_info['needs_admin']) && ($rg_ui['is_admin'] == 0))
69 continue;
70
71 if (isset($_info['uid0']) && ($rg_ui['uid'] > 0))
72 continue;
73
74 if (!isset($_info['uid0']) && ($rg_ui['uid'] == 0))
75 continue;
76
77 $_text = $_info['text'];
78 $menu .= $add . "<a class=\"menu\" href=\""
79 . rg_re_url($_op) . "\">$_text</a>\n";
80 $add = "\t&nbsp;";
81 }
70 $first_menu[$op]['sub'] = $second_menu;
71 $menu = implode("\t<br />\n", rg_menu($first_menu, $rg_ui));
82 72
83 73 if ($rg_ui['uid'] > 0) if ($rg_ui['uid'] > 0)
84 74 $rg_username = $rg_ui['username']; $rg_username = $rg_ui['username'];
85 75 else else
86 76 $rg_username = "Not logged in"; $rg_username = "Not logged in";
87 77
78 $_diff = sprintf("%u", (microtime(TRUE) - $_s) * 1000);
88 79 include($THEME . "/index.php"); include($THEME . "/index.php");
89 80
90 81 $_diff = sprintf("%u", (microtime(TRUE) - $_s) * 1000); $_diff = sprintf("%u", (microtime(TRUE) - $_s) * 1000);
File root/themes/default/index.php changed (mode: 100644) (index 2e3f034..725e8d5)
25 25 <small>Copyright: <a href="http://kernel.embedromix.ro" target="_new">Catalin(ux) M. BOIE</a></small> <small>Copyright: <a href="http://kernel.embedromix.ro" target="_new">Catalin(ux) M. BOIE</a></small>
26 26 </div> </div>
27 27
28 <div class="profiling">
29 <small>Profiling: <?php echo $_diff; ?>ms.</small>
30 </div>
31
28 32 </body> </body>
29 33 </html> </html>
File root/themes/default/main.css changed (mode: 100644) (index 04591f7..e84eb41)
... ... th, td {
27 27 .menu { .menu {
28 28 font-size: 14px; font-size: 14px;
29 29 font-weight: bold; font-weight: bold;
30 float: left;
31 30 text-decoration: none; text-decoration: none;
31 line-height: 200%;
32 32 color: red; color: red;
33 33 background-color: yellow; background-color: yellow;
34 34 padding: 3px 20px; padding: 3px 20px;
 
... ... th, td {
75 75 padding: 5px 5px; padding: 5px 5px;
76 76 } }
77 77
78 .profiling {
79 width: 900px;
80 border-top: 2px solid #cccccc;
81 margin: 0 auto;
82 background-color: #ffffcc;
83 padding: 5px 5px;
84 }
85
78 86 .error { .error {
79 87 font-weight: bold; font-weight: bold;
80 88 color: red; color: red;
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