aboutsummaryrefslogtreecommitdiff
path: root/www/common.pl
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2014-05-04 18:35:10 +0200
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2014-05-04 18:35:10 +0200
commitd8907f11f5c255727b8a814746a0114e5c62e30a (patch)
tree96b1b1e2531a3043e9ab31e66abdd72507136b1d /www/common.pl
parent36fafa2ae962d6844b6e20ffbbac92ecf36a059d (diff)
Support Google Apps authentication.
Diffstat (limited to 'www/common.pl')
-rw-r--r--www/common.pl13
1 files changed, 13 insertions, 0 deletions
diff --git a/www/common.pl b/www/common.pl
index aa86e47..3f3a5b0 100644
--- a/www/common.pl
+++ b/www/common.pl
@@ -6,6 +6,7 @@ use common::sense;
use Modern::Perl;
use Mail::ExpandAliases;
+use URI;
sub load_config() {
$::MULKONF = { };
@@ -13,6 +14,8 @@ sub load_config() {
}
sub email_users($) {
+ return @_
+ if $::MULKONF->{auth_type} eq 'google';
my ($email) = @_;
my $alias;
if ($email =~ /^(.*?)@/) { $alias = $1; }
@@ -25,3 +28,13 @@ sub email_users($) {
return ($alias);
}
}
+
+sub reluri($$) {
+ my ($cgi, $x) = @_;
+ my $uri = URI->new($cgi->url(-full=>1));
+ my @path = $uri->path_segments;
+ pop @path;
+ push @path, $x;
+ $uri->path_segments(@path);
+ return "$uri";
+}