start of auth plugin work
authorIvan Kohler <ivan@freeside.biz>
Wed, 27 Mar 2013 09:56:33 +0000 (02:56 -0700)
committerIvan Kohler <ivan@freeside.biz>
Wed, 27 Mar 2013 09:56:33 +0000 (02:56 -0700)
FS/FS/Conf.pm
FS/FS/access_user/internal.pm [new file with mode: 0644]
FS/FS/access_user/legacy.pm [new file with mode: 0644]
eg/access_user-external_auth.pm [new file with mode: 0644]

index e8b3333..869ce1e 100644 (file)
@@ -5423,6 +5423,14 @@ and customer address. Include units.',
     'type'        => 'checkbox',
   },
 
+  {
+    'key'         => 'authentication_module',
+    'section'     => 'UI',
+    'description' => '"Internal" is the default , which authenticates against the internal database.  "Legacy" is similar, but matches passwords against a legacy htpasswd file.',
+    'type'        => 'select',
+    'select_enum' => [qw( Internal Legacy )],
+  },
+
   { key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
   { key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
   { key => "apachemachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
diff --git a/FS/FS/access_user/internal.pm b/FS/FS/access_user/internal.pm
new file mode 100644 (file)
index 0000000..94f932d
--- /dev/null
@@ -0,0 +1,15 @@
+package FS::access_user::internal;
+use base qw( FS::access_user );
+
+use strict;
+
+sub authenticate {
+  my( $username, $check_password ) = @_;
+
+
+}
+
+sub change_password {
+}
+
+1;
diff --git a/FS/FS/access_user/legacy.pm b/FS/FS/access_user/legacy.pm
new file mode 100644 (file)
index 0000000..f8dcdc0
--- /dev/null
@@ -0,0 +1,15 @@
+package FS::access_user::legacy;
+use base qw( FS::access_user ); #::internal ?
+
+use strict;
+
+sub authenticate {
+  my( $username, $check_password ) = @_;
+
+
+}
+
+sub change_password {
+}
+
+1;
diff --git a/eg/access_user-external_auth.pm b/eg/access_user-external_auth.pm
new file mode 100644 (file)
index 0000000..2cea1d3
--- /dev/null
@@ -0,0 +1,27 @@
+package FS::access_user::external_auth;
+use base qw( FS::access_user );
+
+use strict;
+
+sub authenticate {
+  my( $username, $check_password ) = @_;
+
+  #magic happens here
+
+  if ( $auth_good ) { #verbose for clarity
+    return 1;
+  } else {
+    return 0;
+  }
+
+}
+
+#omitting these subroutines will eliminate 
+
+#sub create_user {
+#
+
+#sub change_password {
+#}
+
+1;