package FS::svc_acct;
use strict;
-use base qw( FS::svc_Domain_Mixin FS::svc_Common );
+use base qw( FS::svc_Domain_Mixin FS::svc_CGP_Mixin FS::svc_CGPRule_Mixin
+ FS::svc_Common );
use vars qw( $DEBUG $me $conf $skip_fuzzyfiles
$dir_prefix @shells $usernamemin
$usernamemax $passwordmin $passwordmax
disable_select => 1,
},
'cgp_emptytrash' => {
- label => 'Communigate on logout remove trash',
- type => 'text',
+ label => 'Communigate on logout remove trash',
+ type => 'select',
+ select_list => __PACKAGE__->cgp_emptytrash_values,
disable_inventory => 1,
disable_select => 1,
},
disable_select => 1,
},
'cgp_timezone' => {
- label => 'Communigate time zone',
- type => 'select',
- select_list => [ '',
- 'HostOS',
- '(+0100) Algeria/Congo',
- '(+0200) Egypt/South Africa',
- '(+0300) Saudi Arabia',
- '(+0400) Oman',
- '(+0500) Pakistan',
- '(+0600) Bangladesh',
- '(+0700) Thailand/Vietnam',
- '(+0800) China/Malaysia',
- '(+0900) Japan/Korea',
- '(+1000) Queensland',
- '(+1100) Micronesia',
- '(+1200) Fiji',
- '(+1300) Tonga/Kiribati',
- '(+1400) Christmas Islands',
- '(-0100) Azores/Cape Verde',
- '(-0200) Fernando de Noronha',
- '(-0300) Argentina/Uruguay',
- '(-0400) Venezuela/Guyana',
- '(-0500) Haiti/Peru',
- '(-0600) Central America',
- '(-0700) Arisona',
- '(-0800) Adamstown',
- '(-0900) Marquesas Islands',
- '(-1000) Hawaii/Tahiti',
- '(-1100) Samoa',
- 'Asia/Afghanistan',
- 'Asia/India',
- 'Asia/Iran',
- 'Asia/Iraq',
- 'Asia/Israel',
- 'Asia/Jordan',
- 'Asia/Lebanon',
- 'Asia/Syria',
- 'Australia/Adelaide',
- 'Australia/East',
- 'Australia/NorthernTerritory',
- 'Europe/Central',
- 'Europe/Eastern',
- 'Europe/Moscow',
- 'Europe/Western',
- 'GMT (+0000)',
- 'Newfoundland',
- 'NewZealand/Auckland',
- 'NorthAmerica/Alaska',
- 'NorthAmerica/Atlantic',
- 'NorthAmerica/Central',
- 'NorthAmerica/Eastern',
- 'NorthAmerica/Mountain',
- 'NorthAmerica/Pacific',
- 'Russia/Ekaterinburg',
- 'Russia/Irkutsk',
- 'Russia/Kamchatka',
- 'Russia/Krasnoyarsk',
- 'Russia/Magadan',
- 'Russia/Novosibirsk',
- 'Russia/Vladivostok',
- 'Russia/Yakutsk',
- 'SouthAmerica/Brasil',
- 'SouthAmerica/Chile',
- 'SouthAmerica/Paraguay',
- ],
+ label => 'Communigate time zone',
+ type => 'select',
+ select_list => __PACKAGE__->cgp_timezone_values,
disable_inventory => 1,
disable_select => 1,
},
disable_inventory => 1,
disable_select => 1,
},
- #XXX pronto style?
+ 'cgp_prontoskinname' => {
+ label => 'Communigate Pronto style',
+ type => 'select',
+ select_list => [ '', 'Pronto', 'Pronto-darkflame', 'Pronto-steel', 'Pronto-twilight', ],
+ disable_inventory => 1,
+ disable_select => 1,
+ },
'cgp_sendmdnmode' => {
label => 'Communigate send read receipts',
type => 'select',
|| $self->ut_snumbern('upbytes')
|| $self->ut_snumbern('downbytes')
|| $self->ut_snumbern('totalbytes')
+ || $self->ut_snumbern('seconds_threshold')
+ || $self->ut_snumbern('upbytes_threshold')
+ || $self->ut_snumbern('downbytes_threshold')
+ || $self->ut_snumbern('totalbytes_threshold')
|| $self->ut_enum('_password_encoding', ['',qw(plain crypt ldap)])
|| $self->ut_enum('password_selfchange', [ '', 'Y' ])
|| $self->ut_enum('password_recover', [ '', 'Y' ])
|| $self->ut_enum('cgp_addmailtrailer', [ '', 'Y' ])
#preferences
|| $self->ut_alphasn('cgp_deletemode')
- || $self->ut_alphan('cgp_emptytrash')
+ || $self->ut_enum('cgp_emptytrash', $self->cgp_emptytrash_values)
|| $self->ut_alphan('cgp_language')
|| $self->ut_textn('cgp_timezone')
|| $self->ut_textn('cgp_skinname')
- #XXX pronto style?
+ || $self->ut_textn('cgp_prontoskinname')
|| $self->ut_alphan('cgp_sendmdnmode')
#XXX vacation message, redirect all mail, mail rules
#XXX RPOP settings
my $reset = 0;
my %handyhash = ();
if ( $options{null} ) {
- %handyhash = ( map { ( $_ => 'NULL', $_."_threshold" => 'NULL' ) }
+ %handyhash = ( map { ( $_ => undef, $_."_threshold" => undef ) }
qw( seconds upbytes downbytes totalbytes )
);
}
#die $error if $error; #services not explicity changed via the UI
my $sql = "UPDATE svc_acct SET " .
- join (',', map { "$_ = $handyhash{$_}" } (keys %handyhash) ).
+ join (',', map { "$_ = ?" } (keys %handyhash) ).
" WHERE svcnum = ". $self->svcnum;
warn "$me $sql\n"
if (scalar(keys %handyhash)) {
my $sth = $dbh->prepare( $sql )
or die "Error preparing $sql: ". $dbh->errstr;
- my $rv = $sth->execute();
+ my $rv = $sth->execute(values %handyhash);
die "Error executing $sql: ". $sth->errstr
unless defined($rv);
die "Can't update usage for svcnum ". $self->svcnum