<?php
rg_log("FILE: /inc/dispatch/dispatch");
$rg['menu'][$_op] = 1;
switch ($_op) {
case 'login':
include($INC . "/login/login.php");
$body .= $_login;
break;
case 'logout':
if (!rg_valid_referer())
rg_log("Invalid referer");
if (!rg_token_valid($db, $rg, 'logout', TRUE))
break;
rg_user_set_last_seen($db, $rg['login_ui']['uid'], time(), $rg['ip']);
if (rg_sess_destroy($db, $rg['sid'], $rg['login_ui'])) {
$body .= rg_template("user/logout.html", $rg, TRUE /* xss */);
} else {
$body .= rg_template("user/logout_err.html", $rg, TRUE /* xss */);
}
break;
case 'repo':
include($INC . "/repo/repo.php");
$body .= $_repo;
break;
case 'repopage':
include($INC . "/repo/repo_page.php");
$body .= $_repo;
break;
case 'admin':
include($INC . "/admin/admin.php");
$body .= $_admin;
break;
case 'forgot_link': // forgot pass link
include($INC . "/user/forgot.php");
$body .= $_forgot;
break;
case 'forgot_send': // forgot pass - send mail
include($INC . "/user/forgot_send.php");
$body .= $_forgot;
break;
case 'create_account':
$rg['ask_for_pass'] = 1;
$rg['no_tos'] = 0;
$body .= rg_user_edit_high_level($db, $rg);
break;
case 'confirm':
include($INC . "/user/confirm.php");
$body .= $_confirm;
break;
case 'suggestion':
include($INC . "/feedback/suggestion.php");
$body .= $_suggestion;
break;
case 'settings':
include($INC . "/user/settings.php");
$body .= $_settings;
break;
case 'tos':
$body .= rg_template('tos.html', $rg, TRUE /* xss */);
break;
case 'download':
$_sub = empty($paras) ? "" : array_shift($paras);
if (strcmp($_sub, 'vm') == 0)
$body .= rg_template('download-vm.html', $rg, TRUE /* xss */);
else
$body .= rg_template('download.html', $rg, TRUE /* xss */);
break;
case 'features':
$_sub = empty($paras) ? '' : array_shift($paras);
if (strcmp($_sub, 'anonpush') == 0)
$body .= rg_template('features/anonpush.html', $rg, TRUE /*xss*/);
else
$body .= rg_template('features.html', $rg, TRUE /*xss*/);
break;
case 'pricing':
$body .= rg_template('pricing.html', $rg, TRUE /* xss */);
break;
case 'donate':
$body .= rg_template('donate.html', $rg, TRUE /* xss */);
break;
case 'discover':
$_op = empty($paras) ? "" : array_shift($paras);
$_ui = array('uid' => 0, 'admin' => 0);
$body .= rg_repo_discover($db, $_op, $rg, $_ui);
break;
default: // can be the main page or user page or repo page
rg_log("DEBUG:paras=" . rg_array2string($paras));
$type = empty($paras) ? "" : $paras[0];
rg_log("DEBUG: type=[$type]");
if (strcmp($type, "user") == 0) {
array_shift($paras);
$user = empty($paras) ? "" : array_shift($paras);
$repo = empty($paras) ? "" : array_shift($paras);
} else if (empty($type)) {
$body .= rg_template("main.html", $rg, TRUE /* xss */);
} else {
// organization
$organization = 1;
$user = empty($paras) ? "" : array_shift($paras);
$repo = empty($paras) ? "" : array_shift($paras);
}
if (!empty($user)) {
rg_log("DEBUG: user=[$user] repo=[$repo]");
if (empty($repo)) {
include($INC . "/user/home-page.php");
$body .= $_home;
} else {
// TODO: destroy repo-page
// TODO: repo-page: use $paras
include($INC . "/user/repo-page.php");
$body .= $_repo_page;
}
}
break;
}
?>
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