NAME

FS::svc_www - Object methods for svc_www records


SYNOPSIS

  use FS::svc_www;
  $record = new FS::svc_www \%hash;
  $record = new FS::svc_www { '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;


DESCRIPTION

An FS::svc_www object represents an web virtual host. FS::svc_www inherits from FS::svc_Common. The following fields are currently supported:

svcnum - primary key
recnum - DNS `A' record corresponding to this web virtual host. (see the FS::domain_record manpage)
usersvc - account (see the FS::svc_acct manpage) corresponding to this web virtual host.


METHODS

new HASHREF
Creates a new web virtual host. To add the record to the database, see insert.

Note that this stores the hash reference, not a distinct copy of the hash it points to. You can ask the object for a copy with the hash method.

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

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 values (see the FS::Conf manpage) apachemachine, and apacheroot exist, the command:

  mkdir $apacheroot/$zone;
  chown $username $apacheroot/$zone;
  ln -s $apacheroot/$zone $homedir/$zone

$zone is the DNS A record pointed to by recnum $username is the username pointed to by usersvc $homedir is that user's home directory

is executed on apachemachine via ssh. This behaviour can be surpressed by setting $FS::svc_www::nossh_hack true.

delete
Delete this record from the database.

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

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

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

cancel
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 example. If there is an error, returns the error, otherwise returns false. Called by the insert and repalce methods.


VERSION

$Id: svc_www.html,v 1.3 2002-01-29 17:42:46 ivan Exp $


BUGS


SEE ALSO

the FS::svc_Common manpage, the FS::Record manpage, the FS::domain_record manpage, the FS::cust_svc manpage, the FS::part_svc manpage, the FS::cust_pkg manpage, schema.html from the base documentation.