Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git] / eg / Auth-my_external_auth.pm
1 package FS::Auth::my_external_auth;
2 use base qw( FS::Auth::external ); #need to inherit from ::external
3
4 use strict;
5
6 sub authenticate {
7   my($self, $username, $check_password, $info ) = @_;
8
9   #your magic happens here
10
11   if ( $auth_good ) {
12
13     #optionally return a real name
14     #$info->{'first'} = "Jean";
15     #$info->{'last'}  = "D'eau";
16
17     #optionally return a template username to copy access groups from that user
18     #$info->{'template_user'} = 'username';
19
20     return 1;
21
22   } else {
23     return 0;
24   }
25
26 }
27
28 1;