List of commits:
Subject Hash Author Date (UTC)
Update last_seen only at login/logout, not on every access f50c94843c00656a453979591585c3d9d073469c Catalin(ux) M. BOIE 2015-03-20 04:42:10
Fix slave tables creation (year was incorrect 4c9eaa994fa1e2370812e49fe85742f00f51ee7b Catalin(ux) M. BOIE 2015-03-19 20:50:05
When repo is created, update cache df91965df1900e161ae9641e03217671135cb97b Catalin(ux) M. BOIE 2015-03-19 20:06:51
'deleted' field for a bug is added only on 'add' operation 1832f125018048ae65dbc6ef5f5dc9a9e7fa71ff Catalin(ux) M. BOIE 2015-03-19 19:41:19
Init 'deleted' field for repos 00078770ac766c414c3235765168e36f173662ae Catalin(ux) M. BOIE 2015-03-19 19:40:46
Added a spell check script. 38beca5c78de25eb8f836772d5305b1bbb0b01d7 Catalin(ux) M. BOIE 2015-03-19 19:12:10
Checkpoint 77566839b41679a09859afad2a246b4d1d346c5a Catalin(ux) M. BOIE 2015-03-18 18:03:53
Checkpoint, all tests pass 489486b1331c835ea253aa267f0ae38025206c49 Catalin(ux) M. BOIE 2015-03-08 23:22:28
Checkpoint: apply xss protection only on output 553d3374edc1c93cb5af6d5807ead7d862fc5b61 Catalin(ux) M. BOIE 2015-03-05 22:14:42
Improved diff output (copy/rename/etc.) 823f8f1ff43c8db148d2b642da87ac10dc67543e Catalin(ux) M. BOIE 2015-02-14 22:38:14
Bump version to 0.20 f794575c600cb52f12a406bf1945966b573c6209 Catalin(ux) M. BOIE 2015-01-27 23:12:33
Small fixes after beta deploy 10774b229bcb8eebf30781c602e300a2618b60c0 Catalin(ux) M. BOIE 2015-01-27 23:11:50
Checkpoint before non-storing tokens 14b76a10a18045ae9d6b71614772ca2ba0653034 Catalin(ux) M. BOIE 2014-12-20 09:03:38
Checkpoint a87a60265dd93710118fc92b13121b7d7296823b Catalin(ux) M. BOIE 2014-12-16 21:19:16
Checkpoint c99a539501f24a82fb890a7ef59e2d97517246c5 Catalin(ux) M. BOIE 2014-12-10 21:25:25
Checkpoint 408ea6e114460b413daca5e96d1551ef04080a04 Catalin(ux) M. BOIE 2014-12-09 17:18:17
Checkpoint 70b59e41caa4a49a3f6580e104da0c8e6cec8658 Catalin(ux) M. BOIE 2014-11-20 04:42:44
Checkpoint 954ee41b76dcfe6920ebd36bd81453bc26276890 Catalin(ux) M. BOIE 2014-11-14 22:37:07
Checkpoint 91a81af5a65c575fa1d61ac9cc5eb759b746a9ed Catalin(ux) M. BOIE 2014-10-29 04:19:22
Checkpoint 8aa274777cd39834ea3467399ec8b072a136e525 Catalin(ux) M. BOIE 2014-10-24 20:41:00
Commit f50c94843c00656a453979591585c3d9d073469c - Update last_seen only at login/logout, not on every access
Author: Catalin(ux) M. BOIE
Author date (UTC): 2015-03-20 04:42
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2015-03-20 04:42
Parent(s): 4c9eaa994fa1e2370812e49fe85742f00f51ee7b
Signing key:
Tree: 5c760a67ef9eede3b8ca6a02606a81bbf432722f
File Lines added Lines deleted
TODO 3 5
inc/dispatch/dispatch.php 2 0
inc/repo.inc.php 4 1
inc/user.inc.php 36 38
inc/user/repo-page.php 1 0
File TODO changed (mode: 100644) (index 72ffd6e..a123594)
12 12 proiectului, e nevoie. Dar intr-un form, in textarea, nu e nevoie. proiectului, e nevoie. Dar intr-un form, in textarea, nu e nevoie.
13 13 Apoi as putea elimina description_nice. Apoi as putea elimina description_nice.
14 14 [ ] Security: Link-uri + xss (Ionut) [ ] Security: Link-uri + xss (Ionut)
15 [ ] "UPDATE users SET last_seen" must be done only on logout?
16 What if the session expires?!
17 Bun, no way at every page accessed.
18 Maybe only at login/logout?
19 [ ] Spell check html files?
20 15 [ ] [ ]
21 16
22 17 == BEFORE NEXT RELEASE == == BEFORE NEXT RELEASE ==
18 [ ] Make the blob show nicer and remove rg_template_list (replace
19 it with rg_template*).
20 [ ] If there are a lot of tags/branches, remove oldest ones.
23 21 [ ] Add a "Stats" menu per repo: at least disk size. [ ] Add a "Stats" menu per repo: at least disk size.
24 22 [ ] Seems we are stuck processing events in events.php daemon because we are [ ] Seems we are stuck processing events in events.php daemon because we are
25 23 stuck in 'accept'. We should keep processing the events queue. stuck in 'accept'. We should keep processing the events queue.
File inc/dispatch/dispatch.php changed (mode: 100644) (index 67e71cf..fafacb2)
... ... case 'logout':
16 16 if (!rg_token_valid($db, $rg, TRUE)) if (!rg_token_valid($db, $rg, TRUE))
17 17 break; break;
18 18
19 rg_user_set_last_seen($db, $rg['login_ui']['uid']);
20
19 21 if (rg_sess_destroy($db, $rg['sid'], $rg['login_ui'])) { if (rg_sess_destroy($db, $rg['sid'], $rg['login_ui'])) {
20 22 $body .= rg_template("user/logout.html", $rg); $body .= rg_template("user/logout.html", $rg);
21 23 } else { } else {
File inc/repo.inc.php changed (mode: 100644) (index 45347f1..5078366)
... ... function rg_repo_history_load($db, $repo_id, $category, $number, $max_seconds)
521 521 while (($row = rg_sql_fetch_array($res))) { while (($row = rg_sql_fetch_array($res))) {
522 522 $row['username'] = 'n/a'; $row['username'] = 'n/a';
523 523 if ($row['uid'] > 0) { if ($row['uid'] > 0) {
524 $ui = rg_user_info($db, '', $row['uid'], '');
524 $ui = rg_user_info($db, $row['uid'], '', '');
525 525 if ($ui['exists'] == 1) if ($ui['exists'] == 1)
526 526 $row['username'] = $ui['username']; $row['username'] = $ui['username'];
527 527 } }
 
... ... function rg_repo_edit($db, $login_ui, &$new)
909 909
910 910 if ($new['repo_id'] == 0) { if ($new['repo_id'] == 0) {
911 911 $new['deleted'] = 0; $new['deleted'] = 0;
912 $new['disk_used_mb'] = 0;
913 $new['git_dir_done'] = 0;
914
912 915 $sql = "INSERT INTO repos (uid, master, name" $sql = "INSERT INTO repos (uid, master, name"
913 916 . ", itime, max_commit_size, description" . ", itime, max_commit_size, description"
914 917 . ", git_dir_done, public)" . ", git_dir_done, public)"
File inc/user.inc.php changed (mode: 100644) (index cd3fcc2..b001456)
... ... function rg_user_info($db, $uid, $user, $email)
646 646 return $ret; return $ret;
647 647 } }
648 648
649 /*
650 * Update last_seen field
651 */
652 function rg_user_set_last_seen($db, $uid)
653 {
654 rg_log_enter("user_set_last_seen: uid=$uid");
655
656 $ret = FALSE;
657 while (1) {
658 $now = time();
659
660 $IP = $_SERVER['REMOTE_ADDR'];
661
662 $params = array("last_seen" => $now,
663 "last_ip" => $IP,
664 "uid" => $uid);
665 $sql = "UPDATE users SET last_seen = @@last_seen@@"
666 . ", last_ip = @@last_ip@@"
667 . " WHERE uid = @@uid@@";
668 $res = rg_sql_query_params($db, $sql, $params);
669 if ($res === FALSE) {
670 rg_user_set_error("cannot update last seen (" . rg_sql_error() . ")");
671 break;
672 }
673 rg_sql_free_result($res);
674
675 rg_cache_merge("user::" . $uid, $params);
676
677 $ret = TRUE;
678 break;
679 }
680
681 rg_log_exit();
682 return $ret;
683 }
684
649 685 /* /*
650 686 * Loads ui based on sid, if possible * Loads ui based on sid, if possible
651 687 */ */
 
... ... function rg_user_login_by_sid($db, &$rg)
686 722
687 723 rg_sess_update($db, $sess); rg_sess_update($db, $sess);
688 724
689 rg_user_set_last_seen($db, $rg['login_ui']['uid']);
690
691 725 $ret = TRUE; $ret = TRUE;
692 726 break; break;
693 727 } }
 
... ... function rg_user_make_admin($db, $rg, $uid, $op)
920 954 return $ret; return $ret;
921 955 } }
922 956
923 /*
924 * Update last_seen field
925 */
926 function rg_user_set_last_seen($db, $uid)
927 {
928 rg_log_enter("user_set_last_seen: uid=$uid");
929
930 $ret = FALSE;
931 while (1) {
932 $now = time();
933
934 $IP = $_SERVER['REMOTE_ADDR'];
935
936 $params = array("last_seen" => $now,
937 "last_ip" => $IP,
938 "uid" => $uid);
939 $sql = "UPDATE users SET last_seen = @@last_seen@@"
940 . ", last_ip = @@last_ip@@"
941 . " WHERE uid = @@uid@@";
942 $res = rg_sql_query_params($db, $sql, $params);
943 if ($res === FALSE) {
944 rg_user_set_error("cannot update last seen (" . rg_sql_error() . ")");
945 break;
946 }
947 rg_sql_free_result($res);
948
949 rg_cache_merge("user::" . $uid, $params);
950
951 $ret = TRUE;
952 break;
953 }
954
955 rg_log_exit();
956 return $ret;
957 }
958
959 957 /* /*
960 958 * List users * List users
961 959 * TODO: switch to templates. * TODO: switch to templates.
File inc/user/repo-page.php changed (mode: 100644) (index 712a31e..7248de2)
... ... if (strcmp($_subop, "history") == 0) {
117 117 $blob = $_tree[0]; $blob = $_tree[0];
118 118 $_hash = $_tree[0]['ref']; $_hash = $_tree[0]['ref'];
119 119 $c = rg_git_content($_hash); $c = rg_git_content($_hash);
120 // TODO: error code check
120 121 $_content = array( $_content = array(
121 122 "hash" => $_hash, "hash" => $_hash,
122 123 "HTML:content" => rg_template_list($c) "HTML:content" => rg_template_list($c)
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