planet telecom rate import, RT#83146
[freeside.git] / eg / Auth-my_external_auth.pm
index 38f9d5b..8eda462 100644 (file)
@@ -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;