diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2014-01-17 07:21:54 (JST) |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2014-01-17 07:21:54 (JST) |
commit | a431326e8fab8153905fbde036dd3c9fb4cc8eaa (patch) | |
tree | eaff3c6984a1c518c0180d5437853243ca6346a4 /ui-shared.c | |
parent | df00ab1096868b3cffe563c48de5572f78b50392 (diff) | |
download | cgit-a431326e8fab8153905fbde036dd3c9fb4cc8eaa.zip cgit-a431326e8fab8153905fbde036dd3c9fb4cc8eaa.tar.gz |
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 <Jason@zx2c4.com>
Diffstat (limited to 'ui-shared.c')
-rw-r--r-- | ui-shared.c | 8 |
1 files changed, 8 insertions, 0 deletions
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() | |||
73 | return ctx.cfg.script_name; | 73 | return ctx.cfg.script_name; |
74 | } | 74 | } |
75 | 75 | ||
76 | const char *cgit_loginurl() | ||
77 | { | ||
78 | static const char *login_url = 0; | ||
79 | if (!login_url) | ||
80 | login_url = fmtalloc("%s?p=login", cgit_rooturl()); | ||
81 | return login_url; | ||
82 | } | ||
83 | |||
76 | char *cgit_repourl(const char *reponame) | 84 | char *cgit_repourl(const char *reponame) |
77 | { | 85 | { |
78 | if (ctx.cfg.virtual_root) | 86 | if (ctx.cfg.virtual_root) |