merged branch with changes from trunk:


			
			
				1.2@3605
			
			
				1.2.1@1800
			
		
Daniel Tiefnig 17 years ago
parent 889b451e00
commit cd193cad65

@ -16,7 +16,7 @@ use XML::Simple;
use Catalyst::Log::Log4perl;
use Catalyst qw/-Debug ConfigLoader Static::Simple
use Catalyst qw/-Debug ConfigLoader Static::Simple Unicode
Authentication Authentication::Store::Minimal Authentication::Credential::Password
Session Session::Store::FastMmap Session::State::Cookie
/;

@ -490,7 +490,8 @@ sub set_fees : Local {
last;
}
@keyval{@elements} = @values;
$keyval{destination} = $self->_normalize_destination($c, $keyval{destination});
$keyval{destination} = $self->_normalize_destination($c, $keyval{destination}) || $keyval{destination}
if length $keyval{destination};
unless(defined $keyval{destination}) {
$messages{feeerr} = 'Web.Fees.InvalidDestination';
$c->session->{feeerr}{line} = $line;
@ -534,8 +535,8 @@ sub edit_fee : Local {
my $destination = $c->stash->{destination} = $c->request->params->{destination};
$c->stash->{offset} = $c->request->params->{offset} || 0;
$destination = $self->_normalize_destination($c, $destination)
if defined $destination;
$destination = $self->_normalize_destination($c, $destination) || $destination
if length $destination;
if(ref $c->session->{restore_fee_input} eq 'HASH') {
$c->stash->{fee} = $c->session->{restore_fee_input};
@ -580,10 +581,12 @@ sub do_edit_fee : Local {
my $bilprof = $c->request->params->{bilprof};
my $offset = $c->request->params->{offset};
$settings{destination} = $c->request->params->{destination};
$settings{destination} = $self->_normalize_destination($c, $settings{destination})
if defined $settings{destination};
$settings{destination} = $self->_normalize_destination($c, $settings{destination}) || $settings{destination}
if length $settings{destination};
if(defined $c->request->params->{new_destination}) {
$settings{destination} = $self->_normalize_destination($c, $c->request->params->{new_destination});
$settings{destination} = $self->_normalize_destination($c, $c->request->params->{new_destination})
|| $c->request->params->{new_destination}
if length $c->request->params->{new_destination};
unless(defined $settings{destination}) {
$messages{destination} = 'Web.Fees.InvalidDestination';
}
@ -638,7 +641,7 @@ sub do_delete_fee : Local {
my $destination = $c->request->params->{destination};
my $offset = $c->request->params->{offset};
$destination = $self->_normalize_destination($c, $destination);
$destination = $self->_normalize_destination($c, $destination) || $destination;
if($c->model('Provisioning')->call_prov( $c, 'billing', 'set_billing_profile_fees',
{ handle => $bilprof,
@ -860,15 +863,18 @@ sub _normalize_destination : Private {
my ($self, $c, $destination) = @_;
if($destination =~ /^\d+$/) {
# E.164 number
$destination = '^' . $destination . '.*$';
} elsif($destination =~ /^(?:[a-z0-9]+(?:-[a-z0-9]+)*\.)+[a-z]+$/i
or $destination =~ /^[\d.]+$/)
or $destination =~ /^[012]?[0-9]?[0-9](?:\.[012]?[0-9]?[0-9]){3}$/)
{
# domain or IP address
$destination =~ s/\./\\./g;
$destination = '^.*@'. $destination .'$';
} elsif($destination =~ /^.+\@(?:[a-z0-9]+(?:-[a-z0-9]+)*\.)+[a-z]+$/i
or $destination =~ /^.+\@[\d.]+$/)
or $destination =~ /^.+\@[012]?[0-9]?[0-9](?:\.[012]?[0-9]?[0-9]){3}$/)
{
# SIP URI
$destination =~ s/\./\\./g;
$destination = '^'. $destination .'$';
} else {
@ -881,13 +887,18 @@ sub _normalize_destination : Private {
sub _denormalize_destination : Private {
my ($self, $c, $destination) = @_;
my $backup = $destination;
$destination =~ s/\\\././g;
$destination =~ s/\$$//;
$destination =~ s/^\^//;
$destination =~ s/\.\*$//;
$destination =~ s/^\.\*\@//;
return $destination;
if(defined $self->_normalize_destination($c, $destination)) {
return $destination;
} else {
return $backup;
}
}

@ -63,6 +63,8 @@ sub do_edit_domain : Local {
my $domain = $c->request->params->{domain};
$settings{local} = $c->request->params->{local} ? 1 : 0;
$settings{cc} = $c->request->params->{cc};
$messages{ecc} = 'Client.Voip.MalformedCc'
unless $settings{cc} =~ /^\d+$/;
@ -108,6 +110,8 @@ sub do_create_domain : Local {
my $domain = $c->request->params->{domain};
$settings{local} = $c->request->params->{local} ? 1 : 0;
$settings{cc} = $c->request->params->{cc};
$messages{acc} = 'Client.Voip.MalformedCc'
unless $settings{cc} =~ /^\d+$/;

@ -55,6 +55,7 @@ sub search : Local {
$exact{$sf} = 1 if $c->request->params->{'exact_'.$sf};
}
}
$filter{terminated} = 1 if $c->request->params->{terminated};
$c->session->{search_filter} = { %filter };
$c->session->{exact_filter} = { %exact };
}
@ -74,6 +75,7 @@ sub search : Local {
$filter{$sf} =~ s/\%*$/\%/;
}
}
$c->stash->{terminated} = $filter{terminated};
my $offset = $c->request->params->{offset} || 0;
$offset = 0 if $offset !~ /^\d+$/;
@ -355,7 +357,12 @@ sub update_subscriber : Local {
$messages{number_sn} = 'Client.Voip.MalformedSn'
unless $sn =~ /^[1-9][0-9]+$/;
}
} else {
$settings{cc} = undef;
$settings{ac} = undef;
$settings{sn} = undef;
}
my $timezone = $c->request->params->{timezone};
if(length $timezone) {
$settings{timezone} = $timezone;

@ -35,6 +35,7 @@ __PACKAGE__->config(
},
},
},
ENCODING => 'utf-8',
);
=head1 BUGS AND LIMITATIONS

@ -252,11 +252,21 @@ h3 {
width: 95px;
}
/* decrease input text fields for cc/ac */
/* decrease input text fields */
.imedium {
width: 140px;
}
/* decrease input text fields for ac */
.ishort {
width: 50px;
}
/* decrease input text fields for cc */
.irealshort {
width: 30px;
}
/* increase spacing between password and show/hide href */
#contentplace .apass {
vertical-align: middle;
@ -312,7 +322,8 @@ h3 {
#contentplace .order_payments,
#contentplace .registered_contacts,
#contentplace .billing_fees,
#contentplace .billing_peaktimes
#contentplace .billing_peaktimes,
#contentplace .domains
{
width: 100%;
border-spacing: 0px;
@ -356,3 +367,7 @@ h3 {
#contentplace .padding6 {
padding: 6px;
}
.topbottomspace {
margin: 5px 0;
}

@ -1,6 +1,7 @@
<!-- BEGIN layout/footer -->
<div id="footer">
Copyright 2007 Sipwise, Austria.<br />
<a href="http://sipwise.com/">http://sipwise.com</a>
NGCP www_admin version [% Catalyst.VERSION %] -
Copyright 2007-2009 Sipwise GmbH, Austria.<br />
<a href="http://sipwise.com/">www.sipwise.com</a>
</div>
<!-- END layout/footer -->

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

@ -60,10 +60,10 @@
<label for="exact_zone">exact match</label><br />
<label class="search_label" for="search_by_detail">Zone detail:</label>
<input type="text" id="search_by_detail" name="search_detail" title="SQL wildcards allowed"
value="[% search_detail %]" />
<input type="checkbox" id="exact_detail" name="exact_detail" [% IF exact_detail %]checked="checked"[% END %] />
<label for="exact_detail">exact match</label><br />
<input type="text" id="search_by_detail" name="search_zone_detail" title="SQL wildcards allowed"
value="[% search_zone_detail %]" />
<input type="checkbox" id="exact_zone_detail" name="exact_zone_detail" [% IF exact_zone_detail %]checked="checked"[% END %] />
<label for="exact_zone_detail">exact match</label><br />
<input type="submit" value="Search &#187;" class="but" />
</form>

@ -4,13 +4,14 @@
[% IF messages.edommsg %]<div class="goodmsg">[% messages.edommsg %]</div>[% END %]
[% IF messages.edomerr %]<div class="errormsg">[% messages.edomerr %]</div>[% END %]
<table>
<table class="domains">
<tr class="table_header">
<td>domain</td>
<td>country code</td>
<td>timezone</td>
<td />
<td />
<td class="tdcenter" style="width:40px;" >local</td>
<td class="tdcenter" style="width:40px;" >cc</td>
<td style="width:150px;" >timezone</td>
<td style="width:40px;" />
<td style="width:60px;" />
</tr>
[% id = 0 %]
[% FOREACH domain = domains %]
@ -19,8 +20,16 @@
[% IF domain.domain == edit_domain %]
<form action="/domain/do_edit_domain" method="post">
<input type="hidden" name="domain" value="[% domain.domain %]" />
<td class="tdcenter"><input class="ishort" name="cc" value="[% domain.cc %]" /></td>
<td><input name="timezone" value="[% domain.timezone %]" /></td>
<td class="tdcenter">
<input type="checkbox" class="checkbox" title="check if domain contains local users"
name="local" [% IF domain.local %]checked="checked"[% END %] />
</td>
<td class="tdcenter"><input class="irealshort" title="integer, country code"
name="cc" value="[% domain.cc %]" /></td>
<td>
<input type="text" class="imedium" title="string, timezone in continent/capital format"
name="timezone" value="[% domain.timezone %]" />
</td>
<td>
<div class="postlink">
<label for="domsave[% id %]">save</label>
@ -30,6 +39,10 @@
</form>
<td><a href="/domain" class="aaction">cancel</a></td>
[% ELSE %]
<td class="tdcenter">
<input type="checkbox" class="checkbox" name="local"
[% IF domain.local %]checked="checked"[% END %] disabled="disabled" />
</td>
<td class="tdcenter">[% domain.cc %]</td>
<td>[% domain.timezone %]</td>
<td>
@ -52,7 +65,7 @@
</tr>
[% IF domain.domain == edit_domain %]
[% IF messages.ecc || messages.etimezone %]
<tr><td colspan="5">
<tr><td colspan="6">
<div class="errormsg">
[% messages.ecc %]
[% IF messages.ecc && messages.etimezone %]<br />[% END %]
@ -73,26 +86,40 @@
[% IF messages.cdommsg %]<div class="goodmsg">[% messages.cdommsg %]</div>[% END %]
[% IF messages.cdomerr %]<div class="errormsg">[% messages.cdomerr %]</div>[% END %]
<table>
<table class="domains">
<tr class="table_header">
<td>domain</td>
<td>country code</td>
<td>timezone</td>
<td />
<td />
<td class="tdcenter" style="width:40px;" >local</td>
<td class="tdcenter" style="width:40px;" >cc</td>
<td style="width:150px;" >timezone</td>
<td style="width:40px;" />
<td style="width:60px;" />
</tr>
<form action="/domain/do_create_domain" method="post">
<tr>
<td><input type="text" size="20" name="domain" id="domainaddtxt" value="[% arefill.domain %]" /></td>
<td class="tdcenter"><input class="ishort" name="cc" value="[% arefill.cc %]" /></td>
<td><input name="timezone" value="[% arefill.timezone %]" /></td>
<td>
<input type="text" size="20" name="domain" title="string, SIP domain"
id="domainaddtxt" value="[% arefill.domain %]" />
</td>
<td class="tdcenter">
<input type="checkbox" class="checkbox" title="check if domain contains local users"
name="local" [% IF arefill.local %]checked="checked"[% END %] />
</td>
<td class="tdcenter">
<input type="text" class="irealshort" title="integer, country code"
name="cc" value="[% arefill.cc %]" />
</td>
<td>
<input type="text" class="imedium" title="string, timezone in continent/capital format"
name="timezone" value="[% arefill.timezone %]" />
</td>
<td />
<td>
<div class="postlink">
<label for="domainadd">Add</label>
<label for="domainadd">add</label>
<input type="image" class="hidden" src="/static/images/dot_trans.gif" alt="" id="domainadd" />
</div>
</td>
<td />
</tr>
[% IF messages.acc || messages.atimezone %]
<tr><td colspan="5">

@ -19,9 +19,14 @@
<label class="search_label" for="search_by_uuid">UUID:</label>
<input type="text" id="search_by_uuid" name="search_uuid" value="[% search_uuid %]" />
<input type="checkbox" id="exact_uuid" name="exact_uuid" [% IF exact_uuid %]checked="checked"[% END %]/>
<input type="checkbox" id="exact_uuid" name="exact_uuid" [% IF exact_uuid %]checked="checked"[% END %] />
<label for="exact_uuid">exact match</label><br />
<div class="topbottomspace">
<input type="checkbox" id="include_terminated" name="terminated" [% IF terminated %]checked="checked"[% END %] />
<label for="include_terminated">include terminated subscribers</label><br />
</div>
<input type="submit" value="Search &#187;" class="but" />
</form>
</div>
@ -32,7 +37,7 @@
<div class="p1">
<table>
<tr><td>SIP URI</td><td class="tdcenter">Account ID</td></tr>
<tr class="table_header"><td>SIP URI</td><td class="tdcenter">Account ID</td></tr>
[% FOREACH subscriber = subscriber_list %]

Loading…
Cancel
Save