From a431326e8fab8153905fbde036dd3c9fb4cc8eaa Mon Sep 17 00:00:00 2001 From: Jason A. Donenfeld Date: Thu, 16 Jan 2014 23:21:54 +0100 Subject: auth: have cgit calculate login address This way we're sure to use virtual root, or any other strangeness encountered. Signed-off-by: Jason A. Donenfeld --- ui-shared.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ui-shared.c') diff --git a/ui-shared.c b/ui-shared.c index 4f47c50..0838e18 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -73,6 +73,14 @@ const char *cgit_rooturl() return ctx.cfg.script_name; } +const char *cgit_loginurl() +{ + static const char *login_url = 0; + if (!login_url) + login_url = fmtalloc("%s?p=login", cgit_rooturl()); + return login_url; +} + char *cgit_repourl(const char *reponame) { if (ctx.cfg.virtual_root) -- cgit v1.2.3-70-g09d2