X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=htdocs%2Fdocs%2Fman%2FFS%2Fsvc_acct.html;h=524fe33243b068e1b89a4a273d095465153f2922;hp=0f8e5b47c8381fc1b2c8281b29d1807f0e3407e8;hb=f3235d39d083518d47f21cd5585e5f9a13070763;hpb=ece31063b782031e21ba1f57476afab555af5363 diff --git a/htdocs/docs/man/FS/svc_acct.html b/htdocs/docs/man/FS/svc_acct.html index 0f8e5b47c..524fe3324 100644 --- a/htdocs/docs/man/FS/svc_acct.html +++ b/htdocs/docs/man/FS/svc_acct.html @@ -1,209 +1,218 @@ FS::svc_acct - Object methods for svc_acct records - + +

-

NAME

-

-FS::svc_acct - Object methods for svc_acct records - +

NAME

+

FS::svc_acct - Object methods for svc_acct records


-

SYNOPSIS

-

-

  use FS::svc_acct;
-
-

-

  $record = new FS::svc_acct \%hash;
-  $record = new FS::svc_acct { 'column' => 'value' };
-
-

-

  $error = $record->insert;
-
-

-

  $error = $new_record->replace($old_record);
-
-

-

  $error = $record->delete;
-
-

-

  $error = $record->check;
-
-

-

  $error = $record->suspend;
-
-

-

  $error = $record->unsuspend;
-
-

-

  $error = $record->cancel;
-
+

SYNOPSIS

+
+  use FS::svc_acct;
+
+  $record = new FS::svc_acct \%hash;
+  $record = new FS::svc_acct { 'column' => 'value' };
+
+  $error = $record->insert;
+
+  $error = $new_record->replace($old_record);
+
+  $error = $record->delete;
+
+  $error = $record->check;
+
+  $error = $record->suspend;
+
+  $error = $record->unsuspend;
+
+  $error = $record->cancel;
+
+  %hash = $record->radius;


-

DESCRIPTION

-

-An FS::svc_acct object represents an account. FS::svc_acct inherits from -FS::svc_Common. The following fields are currently supported: - +

DESCRIPTION

+

An FS::svc_acct object represents an account. FS::svc_acct inherits from +FS::svc_Common. The following fields are currently supported:

-
svcnum - primary key (assigned automatcially for new accounts)
-
username
-
_password - generated if blank
-
popnum - Point of presence (see FS::svc_acct_pop)
-
uid
-
gid
-
finger - GECOS
-
dir - set automatically if blank (and uid is not)
-
shell
-
quota - (unimplementd)
-
slipip - IP address
-
radius_Radius_Attribute - Radius-Attribute
+
svcnum - primary key (assigned automatcially for new accounts)
+
+
username
+
+
_password - generated if blank
+
+
popnum - Point of presence (see the FS::svc_acct_pop manpage)
+
+
uid
+
+
gid
+
+
finger - GECOS
+
+
dir - set automatically if blank (and uid is not)
+
+
shell
+
+
quota - (unimplementd)
+
+
slipip - IP address
+
+
radius_Radius_Attribute - Radius-Attribute
+


-

METHODS

+

METHODS

-
new HASHREF
-

-Creates a new account. To add the account to the database, see insert. - -

insert
-

-Adds this account to the database. If there is an error, returns the error, +

new HASHREF
+
+Creates a new account. To add the account to the database, see insert. +

+
insert
+
+Adds this account to the database. If there is an error, returns the error, otherwise returns false. - -

-The additional fields pkgnum and svcpart (see FS::cust_svc) should be defined. An FS::cust_svc record will be created and inserted. - -

-If the configuration value (see FS::Conf) shellmachine exists, and the username, uid, and dir fields are defined, -the command - -

-

  useradd -d $dir -m -s $shell -u $uid $username
-
-

-is executed on shellmachine via ssh. This behaviour can be surpressed by -setting $FS::svc_acct::nossh_hack true. - -

delete
-

-Deletes this account from the database. If there is an error, returns the +

The additional fields pkgnum and svcpart (see the FS::cust_svc manpage) should be +defined. An FS::cust_svc record will be created and inserted.

+

If the configuration value (see the FS::Conf manpage) shellmachine exists, and the +username, uid, and dir fields are defined, the command(s) specified in +the shellmachine-useradd configuration are exectued on shellmachine via ssh. +This behaviour can be surpressed by setting $FS::svc_acct::nossh_hack true. +If the shellmachine-useradd configuration file does not exist,

+
+  useradd -d $dir -m -s $shell -u $uid $username
+

is the default. If the shellmachine-useradd configuration file exists but +it empty,

+
+  cp -pr /etc/skel $dir; chown -R $uid.$gid $dir
+

is the default instead. Otherwise the contents of the file are treated as +a double-quoted perl string, with the following variables available: +$username, $uid, $gid, $dir, and $shell.

+

+
delete
+
+Deletes this account from the database. If there is an error, returns the error, otherwise returns false. - -

-The corresponding FS::cust_svc record will be deleted as well. - -

-If the configuration value (see FS::Conf) shellmachine exists, the command: - -

-

  userdel $username
-
-

-is executed on shellmachine via ssh. This behaviour can be surpressed by -setting $FS::svc_acct::nossh_hack true. - -

replace OLD_RECORD
-

-Replaces OLD_RECORD with this one in the database. If there is an error, +

The corresponding FS::cust_svc record will be deleted as well.

+

If the configuration value (see the FS::Conf manpage) shellmachine exists, the +command(s) specified in the shellmachine-userdel configuration file are +executed on shellmachine via ssh. This behavior can be surpressed by setting +$FS::svc_acct::nossh_hack true. If the shellmachine-userdel configuration +file does not exist,

+
+  userdel $username
+

is the default. If the shellmachine-userdel configuration file exists but +is empty,

+
+  rm -rf $dir
+

is the default instead. Otherwise the contents of the file are treated as a +double-quoted perl string, with the following variables available: +$username and $dir.

+

+
replace OLD_RECORD
+
+Replaces OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false. - -

-If the configuration value (see FS::Conf) shellmachine exists, and the dir field has changed, the command: - -

-

  [ -d $old_dir ] && (
+

If the configuration value (see the FS::Conf manpage) shellmachine exists, and the +dir field has changed, the command(s) specified in the shellmachine-usermod +configuraiton file are executed on shellmachine via ssh. This behavior can +be surpressed by setting $FS::svc-acct::nossh_hack true. If the +shellmachine-userdel configuration file does not exist or is empty, :

+
+  [ -d $old_dir ] && mv $old_dir $new_dir || (
     chmod u+t $old_dir;
-    umask 022;
     mkdir $new_dir;
     cd $old_dir;
     find . -depth -print | cpio -pdm $new_dir;
     chmod u-t $new_dir;
     chown -R $uid.$gid $new_dir;
     rm -rf $old_dir
-  )
-
-

-is executed on shellmachine via ssh. This behaviour can be surpressed by -setting $FS::svc_acct::nossh_hack true. - -

suspend
-

-Suspends this account by prefixing *SUSPENDED* to the password. If there is + )

+

is executed on shellmachine via ssh. This behaviour can be surpressed by +setting $FS::svc_acct::nossh_hack true.

+

+
suspend
+
+Suspends this account by prefixing *SUSPENDED* to the password. If there is an +error, returns the error, otherwise returns false. +

Called by the suspend method of FS::cust_pkg (see the FS::cust_pkg manpage).

+

+
unsuspend
+
+Unsuspends this account by removing *SUSPENDED* from the password. If there is an error, returns the error, otherwise returns false. - -

-Called by the suspend method of FS::cust_pkg (see FS::cust_pkg). - -

unsuspend
-

-Unsuspends this account by removing *SUSPENDED* from the password. If there -is an error, returns the error, otherwise returns false. - -

-Called by the unsuspend method of FS::cust_pkg (see FS::cust_pkg). - -

cancel
-

+

Called by the unsuspend method of FS::cust_pkg (see the FS::cust_pkg manpage).

+

+
cancel
+
Just returns false (no error) for now. - -

-Called by the cancel method of FS::cust_pkg (see FS::cust_pkg). - -

check
-

-Checks all fields to make sure this is a valid service. If there is an -error, returns the error, otherwise returns false. Called by the insert and -replace methods. - -

-Sets any fixed values; see FS::part_svc. - -

+

Called by the cancel method of FS::cust_pkg (see the FS::cust_pkg manpage).

+

+
check
+
+Checks all fields to make sure this is a valid service. If there is an error, +returns the error, otherwise returns false. Called by the insert and replace +methods. +

Sets any fixed values; see the FS::part_svc manpage.

+

+
radius
+
+Depriciated, use radius_reply instead. +

+
radius_reply
+
+Returns key/value pairs, suitable for assigning to a hash, for any RADIUS +reply attributes of this record. +

Note that this is now the preferred method for reading RADIUS attributes - +accessing the columns directly is discouraged, as the column names are +expected to change in the future.

+

+
radius_check
+
+Returns key/value pairs, suitable for assigning to a hash, for any RADIUS +check attributes of this record. +

Accessing RADIUS attributes directly is not supported and will break in the +future.

+


-

VERSION

-

-$Id: svc_acct.html,v 1.2 2000-03-03 18:22:43 ivan Exp $ - +

VERSION

+

$Id: svc_acct.html,v 1.3 2001-04-23 12:40:31 ivan Exp $


-

BUGS

-

-The remote commands should be configurable. - -

-The bits which ssh should fork before doing so. - -

-The $recref stuff in sub check should be cleaned up. - +

BUGS

+

The bits which ssh should fork before doing so (or maybe queue jobs for a +daemon).

+

The $recref stuff in sub check should be cleaned up.

+

The suspend, unsuspend and cancel methods update the database, but not the +current object. This is probably a bug as it's unexpected and +counterintuitive.


-

SEE ALSO

-

-FS::svc_Common, FS::Record, FS::Conf, FS::cust_svc, -FS::part_svc, FS::cust_pkg, FS::SSH, ssh, FS::svc_acct_pop, schema.html from the base documentation. +

SEE ALSO

+

the FS::svc_Common manpage, the FS::Record manpage, the FS::Conf manpage, the FS::cust_svc manpage, +the FS::part_svc manpage, the FS::cust_pkg manpage, the Net::SSH manpage, ssh, the FS::svc_acct_pop manpage, +schema.html from the base documentation.