Make spectrum optional

tags/0.2.13
Daniel Berteaud 11 years ago
parent 45bd7fca68
commit f26d208fcd
  1. 17
      root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/ejabberd.pm

@ -220,12 +220,14 @@ sub change_settings {
$rec = $db->get('spectrum');
foreach my $proto (@transports){
if (grep ($proto, @gateways)){
$rec->set_prop("$proto",'enabled');
}
else{
$rec->set_prop("$proto",'disabled');
if ($rec){
foreach my $proto (@transports){
if (grep ($proto, @gateways)){
$rec->set_prop("$proto",'enabled');
}
else{
$rec->set_prop("$proto",'disabled');
}
}
}
@ -266,6 +268,8 @@ sub print_gateways
my ($self) = @_;
my $q = $self->{cgi};
my $spectrum = $db->get('spectrum') || return undef;
print "<tr><td class=\"sme-noborders-label\">",
$self->localise('LABEL_GATEWAYS'),
"</td><td>\n";
@ -275,7 +279,6 @@ sub print_gateways
esmith::cgi::genSmallCell($q, $self->localise('PROTOCOL'),"header"),
esmith::cgi::genSmallCell($q, $self->localise('STATUS'),"header"),
);
my $spectrum = $db->get('spectrum');
foreach my $proto (@transports){
my $status = $spectrum->prop($proto) || 'disabled';

Loading…
Cancel
Save