summaryrefslogtreecommitdiff
path: root/FS/FS/Auth.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-12-26 12:39:36 -0800
committerIvan Kohler <ivan@freeside.biz>2013-12-26 12:39:36 -0800
commit7b42fc3d69f111b2e79f2a43263c129fd3505938 (patch)
treed0c5b25d551cc7859da7d500db87b43b78177b9d /FS/FS/Auth.pm
parentd3c4d0df775c4dc2f8346ac29b7075753216bcb5 (diff)
backport some unused new-style auth stuff from master for development purposes, should be harmless, RT#21563, RT#26097
Diffstat (limited to 'FS/FS/Auth.pm')
-rw-r--r--FS/FS/Auth.pm25
1 files changed, 25 insertions, 0 deletions
diff --git a/FS/FS/Auth.pm b/FS/FS/Auth.pm
new file mode 100644
index 000000000..543978e8b
--- /dev/null
+++ b/FS/FS/Auth.pm
@@ -0,0 +1,25 @@
+package FS::Auth;
+
+use strict;
+use FS::Conf;
+
+sub authenticate {
+ my $class = shift;
+
+ $class->auth_class->authenticate(@_);
+}
+
+sub auth_class {
+ #my($class) = @_;
+
+ my $conf = new FS::Conf;
+ my $module = lc($conf->config('authentication_module')) || 'internal';
+
+ my $auth_class = 'FS::Auth::'.$module;
+ eval "use $auth_class;";
+ die $@ if $@;
+
+ $auth_class;
+}
+
+1;