X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=eg%2FAuth-my_external_auth.pm;h=8eda462f8b27eefd6177032b8477f78d4791ece3;hp=38f9d5bfba6fad420cf2fda3eef875edd1d47928;hb=88e9a56677d343392416c262f976f069157b06cb;hpb=92a3df0360d3df6b6ace99fee3d4cc443e6154d0 diff --git a/eg/Auth-my_external_auth.pm b/eg/Auth-my_external_auth.pm index 38f9d5bfb..8eda462f8 100644 --- a/eg/Auth-my_external_auth.pm +++ b/eg/Auth-my_external_auth.pm @@ -4,24 +4,25 @@ use base qw( FS::Auth::external ); #need to inherit from ::external use strict; sub authenticate { - my($self, $username, $check_password ) = @_; + my($self, $username, $check_password, $info ) = @_; - #magic happens here + #your magic happens here + + if ( $auth_good ) { + + #optionally return a real name + #$info->{'first'} = "Jean"; + #$info->{'last'} = "D'eau"; + + #optionally return a template username to copy access groups from that user + #$info->{'template_user'} = 'username'; - if ( $auth_good ) { #verbose for clarity return 1; + } else { return 0; } } -#omitting these subroutines will eliminate those options from the UI - -#sub create_user { -# - -#sub change_password { -#} - 1;