-sub _export_delete {
- my( $self, $svc_acct ) = (shift, shift);
- $self->sqlradius_queue( $svc_acct->svcnum, 'delete',
- $svc_acct->username );
-}
-
-sub sqlradius_queue {
- my( $self, $svcnum, $method ) = (shift, shift, shift);
- my $queue = new FS::queue {
- 'svcnum' => $svcnum,
- 'job' => "FS::part_export::sqlradius::sqlradius_$method",
- };
- $queue->insert(
- $self->option('datasrc'),
- $self->option('username'),
- $self->option('password'),
- @_,
- );
-}
-
-sub sqlradius_insert { #subroutine, not method
- my $dbh = sqlradius_connect(shift, shift, shift);
- my( $replycheck, $username, %attributes ) = @_;
-
- foreach my $attribute ( keys %attributes ) {
- my $u_sth = $dbh->prepare(
- "UPDATE rad$replycheck SET Value = ? WHERE UserName = ? AND Attribute = ?" ) or die $dbh->errstr;
- my $i_sth = $dbh->prepare(
- "INSERT INTO rad$replycheck ( id, UserName, Attribute, Value ) ".
- "VALUES ( ?, ?, ?, ? )" )
- or die $dbh->errstr;
- $u_sth->execute($attributes{$attribute}, $username, $attribute) > 0
- or $i_sth->execute( '', $username, $attribute, $attributes{$attribute} )
- or die "can't insert into rad$replycheck table: ". $i_sth->errstr;
- }
- $dbh->disconnect;
-}
+%exports = (
+ 'svc_acct' => {
+ 'sysvshell' => {
+ 'desc' =>
+ 'Batch export of /etc/passwd and /etc/shadow files (Linux/SysV)',
+ 'options' => {},
+ },
+ 'bsdshell' => {
+ 'desc' =>
+ 'Batch export of /etc/passwd and /etc/master.passwd files (BSD)',
+ 'options' => {},
+ },
+# 'nis' => {
+# 'desc' =>
+# 'Batch export of /etc/global/passwd and /etc/global/shadow for NIS ',
+# 'options' => {},
+# },
+ 'bsdshell' => {
+ 'desc' =>
+ 'Batch export of /etc/passwd and /etc/master.passwd files (BSD)',
+ 'options' => {},
+ },
+ 'textradius' => {
+ 'desc' => 'Batch export of a text /etc/raddb/users file (Livingston, Cistron)',
+ },
+ 'sqlradius' => {
+ 'desc' => 'Real-time export to SQL-backed RADIUS (ICRADIUS, FreeRADIUS)',
+ 'options' => {
+ 'datasrc' => { label=>'DBI data source' },
+ 'username' => { label=>'Database username' },
+ 'password' => { label=>'Database password' },
+ },
+ 'nodomain' => 'Y',
+ 'notes' => 'Real-time export of radcheck, radreply and usergroup tables to any SQL database for <a href="http://www.freeradius.org/">FreeRADIUS</a> or <a href="http://radius.innercite.com/">ICRADIUS</a>. Use <a href="../docs/man/bin/freeside-sqlradius-reset">freeside-sqlradius-reset</a> to delete and repopulate the tables from the Freeside database.',
+ },
+ 'cyrus' => {
+ 'desc' => 'Real-time export to Cyrus IMAP server',
+ },
+ 'cp' => {
+ 'desc' => 'Real-time export to Critical Path Account Provisioning Protocol',
+ 'options' => {
+ 'host' => { label=>'Hostname' },
+ 'port' => { label=>'Port number' },
+ 'username' => { label=>'Username' },
+ 'password' => { label=>'Password' },
+ 'domain' => { label=>'Domain' },
+ 'workgroup' => { label=>'Default Workgroup' },
+ },
+ 'notes' => 'Real-time export to <a href="http://www.cp.net/">Critial Path Account Provisioning Protocol</a>. Requires installation of <a href="http://search.cpan.org/search?dist=Net-APP">Net::APP</a> from CPAN.',
+ },
+ 'infostreet' => {
+ 'desc' => 'Real-time export to InfoStreet streetSmartAPI',
+ 'options' => {
+ 'url' => { label=>'XML-RPC Access URL', },
+ 'login' => { label=>'InfoStreet login', },
+ 'password' => { label=>'InfoStreet password', },
+ 'groupID' => { label=>'InfoStreet groupID', },
+ },
+ 'nodomain' => 'Y',
+ 'notes' => 'Real-time export to <a href="http://www.infostreet.com/">InfoStreet</a> streetSmartAPI. Requires installation of <a href="http://search.cpan.org/search?dist=Frontier-Client">Frontier::Client</a> from CPAN.',
+ }
+ },