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 53e96aea10cb7559c84ca47b53c20b503031b2f1

Add support for accepting ToS.
Author: Catalin(ux) M. BOIE
Author date (UTC): 2015-07-13 15:45
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2015-07-13 15:45
Parent(s): d6b54bd62c35ca1e58b4b7e45bb5d3e48844712b
Signing key:
Tree: 9bc44d7cf0511a4624e692041c06b328c9ed18e0
File Lines added Lines deleted
inc/admin/users/users.php 2 0
inc/dispatch/dispatch.php 1 0
inc/user.inc.php 10 0
inc/user/settings.php 1 0
File inc/admin/users/users.php changed (mode: 100644) (index 8a473d6..576500d)
... ... switch ($_op) {
13 13 case 'add': // add case 'add': // add
14 14 case 'edit': // edit case 'edit': // edit
15 15 $rg['ask_for_pass'] = 1; $rg['ask_for_pass'] = 1;
16 // if admin creates the user, s/he already accepted tos (or not needed)
17 $rg['no_tos'] = 1;
16 18 $_admin_users .= rg_user_edit_high_level($db, $rg); $_admin_users .= rg_user_edit_high_level($db, $rg);
17 19 $_show_list = 0; $_show_list = 0;
18 20 break; break;
File inc/dispatch/dispatch.php changed (mode: 100644) (index eebcc18..6fe5607)
... ... case 'forgot_send': // forgot pass - send mail
52 52
53 53 case 'create_account': case 'create_account':
54 54 $rg['ask_for_pass'] = 1; $rg['ask_for_pass'] = 1;
55 $rg['no_tos'] = 0;
55 56 $body .= rg_user_edit_high_level($db, $rg); $body .= rg_user_edit_high_level($db, $rg);
56 57 break; break;
57 58
File inc/user.inc.php changed (mode: 100644) (index cd8bf1e..0525fa3)
... ... function rg_user_edit_high_level($db, &$rg)
1447 1447 $ui['rights'] = rg_rights_checkboxes("user", "rights", "C"); // TODO $ui['rights'] = rg_rights_checkboxes("user", "rights", "C"); // TODO
1448 1448 $ui['plan_id'] = 0; $ui['plan_id'] = 0;
1449 1449 $ui['session_time'] = $rg_session_time; $ui['session_time'] = $rg_session_time;
1450 $ui['tos'] = 1;
1450 1451 } }
1451 1452 } }
1452 1453
 
... ... function rg_user_edit_high_level($db, &$rg)
1468 1469 $ui['plan_id'] = rg_var_uint("plan_id"); $ui['plan_id'] = rg_var_uint("plan_id");
1469 1470 $ui['session_time'] = rg_var_uint("session_time"); $ui['session_time'] = rg_var_uint("session_time");
1470 1471 $ui['confirm_token'] = rg_id(20); $ui['confirm_token'] = rg_id(20);
1472 if ($rg['no_tos'] == 1)
1473 $ui['tos'] = 1;
1474 else
1475 $ui['tos'] = rg_var_uint('tos');
1476
1477 if ($ui['tos'] != 1) {
1478 $errmsg[] = rg_template('user/tos_deny.html', $rg, FALSE /*xss*/);
1479 break;
1480 }
1471 1481
1472 1482 if (!rg_valid_referer()) { if (!rg_valid_referer()) {
1473 1483 $errmsg[] = "invalid referer; try again"; $errmsg[] = "invalid referer; try again";
File inc/user/settings.php changed (mode: 100644) (index a376fe8..ded67c6)
... ... $_subop = empty($paras) ? "edit_info" : array_shift($paras);
16 16 switch ($_subop) { switch ($_subop) {
17 17 case 'edit_info': case 'edit_info':
18 18 $rg['ask_for_pass'] = 0; $rg['ask_for_pass'] = 0;
19 $rg['no_tos'] = 1; // we ask for only for account creation
19 20 $_settings .= rg_user_edit_high_level($db, $rg); $_settings .= rg_user_edit_high_level($db, $rg);
20 21 break; break;
21 22
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