summaryrefslogtreecommitdiffstats
path: root/web/lib/routing.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'web/lib/routing.inc.php')
-rw-r--r--web/lib/routing.inc.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/web/lib/routing.inc.php b/web/lib/routing.inc.php
index 4ca1150f..dfd6942c 100644
--- a/web/lib/routing.inc.php
+++ b/web/lib/routing.inc.php
@@ -18,6 +18,7 @@ $ROUTES = array(
);
$PKG_PATH = '/packages';
+$USER_PATH = '/account';
function get_route($path) {
global $ROUTES;
@@ -56,3 +57,19 @@ function get_pkg_uri($pkgname) {
return get_route($PKG_PATH) . '?N=' . urlencode($pkgname);
}
}
+
+function get_user_route() {
+ global $USER_PATH;
+ return $USER_PATH;
+}
+
+function get_user_uri($username) {
+ global $USE_VIRTUAL_URLS;
+ global $USER_PATH;
+
+ if ($USE_VIRTUAL_URLS) {
+ return $USER_PATH . '/' . urlencode($username) . '/';
+ } else {
+ return get_route($USER_PATH) . '?U=' . urlencode($username);
+ }
+}