merged r2579:2614 from trunk:


			
			
				2.0@3605
			
			
				2.0.0@2615
			
		
Daniel Tiefnig 17 years ago
parent e59b6813dc
commit 16d9b21ac5

8
debian/changelog vendored

@ -1,4 +1,4 @@
sipwise-www-admin (2.0.0) UNRELEASED; urgency=low
sipwise-www-admin (2.0.0) unstable; urgency=low
* speed dial
* LNP database handling
@ -11,9 +11,11 @@ sipwise-www-admin (2.0.0) UNRELEASED; urgency=low
* fax number configuration
* reminder call configuration
* new user preferences
* minor interface bugfixes
* many minor interface bugfixes
* lots of interface-quick-help title strings
* default configuration files
-- Daniel Tiefnig <dtiefnig@sipwise.com> Mon, 01 Feb 2010 02:08:50 +0100
-- Daniel Tiefnig <dtiefnig@sipwise.com> Wed, 10 Mar 2010 15:15:41 +0100
sipwise-www-admin (1.2.1) unstable; urgency=low

2
debian/rules vendored

@ -39,6 +39,8 @@ install: build
cp -a lib debian/sipwise-www-admin/usr/local/admin/
cp -a root debian/sipwise-www-admin/usr/local/admin/
install -m 644 admin.yml debian/sipwise-www-admin/usr/local/admin/
install -m 644 etc/admin.conf debian/sipwise-www-admin/usr/local/etc/
install -m 644 etc/apache.site debian/sipwise-www-admin/usr/share/doc/sipwise-www-admin/
# we don't need admin_create.pl and admin_test.pl:
install -m 755 script/admin_cgi.pl debian/sipwise-www-admin/usr/local/admin/script/
install -m 755 script/admin_fastcgi.pl debian/sipwise-www-admin/usr/local/admin/script/

@ -164,6 +164,17 @@ sub detail : Local {
or ref $c->session->{voip_account}{subscribers} ne 'ARRAY'
or $#{$c->session->{voip_account}{subscribers}} == -1;
foreach my $vas (eval { @{$c->session->{voip_account}{subscribers}} }) {
my $regcon;
return unless $c->model('Provisioning')->call_prov( $c, 'voip', 'get_registered_contacts',
{ username => $$vas{username},
domain => $$vas{domain},
},
\$regcon
);
$$vas{registered_contacts} = join ", ", map { $$_{user_agent} } @$regcon if eval { @$regcon };
}
$c->stash->{account} = $c->session->{voip_account};
$c->stash->{account}{is_locked} = 1 if $c->session->{voip_account}{status} eq 'locked';

@ -530,7 +530,6 @@ sub preferences : Local {
if(ref $c->session->{voip_preferences} eq 'ARRAY') {
my $cftarget;
my @stashprefs;
foreach my $pref (@{$c->session->{voip_preferences}}) {
@ -558,19 +557,8 @@ sub preferences : Local {
$$preferences{$$pref{attribute}} = 'voicebox';
} elsif($$preferences{$$pref{attribute}} =~ /\@fax2mail\.local$/) {
$$preferences{$$pref{attribute}} = 'fax2mail';
} else {
$$preferences{$$pref{attribute}} =~ s/^sip://i;
if($$preferences{$$pref{attribute}} =~ /^\+?\d+$/) {
my $scc = $c->session->{subscriber}{cc};
$$preferences{$$pref{attribute}} =~ s/^\+*/+/;
$$preferences{$$pref{attribute}} =~ s/^\+$scc/0/;
}
}
}
} elsif($$pref{attribute} eq 'cli') {
if(defined $$preferences{$$pref{attribute}} and length $$preferences{$$pref{attribute}}) {
$$preferences{$$pref{attribute}} =~ s/^sip://i;
}
} elsif(!$c->stash->{ncos_levels} and ($$pref{attribute} eq 'ncos' or $$pref{attribute} eq 'adm_ncos')) {
my $ncoslvl;
return unless $c->model('Provisioning')->call_prov( $c, 'billing', 'get_ncos_levels',
@ -578,6 +566,8 @@ sub preferences : Local {
\$ncoslvl
);
$c->stash->{ncos_levels} = $ncoslvl if eval { @$ncoslvl };
} elsif($$pref{attribute} eq 'block_in_list' or $$pref{attribute} eq 'block_out_list') {
eval { @{$$preferences{$$pref{attribute}}} = map { s/^([1-9])/+$1/; $_ } @{$$preferences{$$pref{attribute}}} };
}
push @stashprefs,
@ -600,12 +590,6 @@ sub preferences : Local {
my @used_default_speed_dial_slots = ();
if (eval { @$speed_dial_slots }) {
foreach my $sdentry (sort {$a->{id} <=> $b->{id}} @$speed_dial_slots) {
$$sdentry{destination} =~ s/^sip://i;
if($$sdentry{destination} =~ /^\+?\d+$/) {
my $scc = $c->session->{subscriber}{cc};
$$sdentry{destination} =~ s/^\+*/+/;
$$sdentry{destination} =~ s/^\+$scc/0/;
}
push @{$c->stash->{speed_dial_slots}}, { id => $$sdentry{id},
number => $i++,
label => 'Slot ' . $$sdentry{slot} . ': ' . $$sdentry{destination}
@ -624,18 +608,6 @@ sub preferences : Local {
}
}
if(ref $c->session->{subscriber}{fax_preferences} eq 'HASH' and
ref $c->session->{subscriber}{fax_preferences}{destinations} eq 'ARRAY')
{
for(@{$c->session->{subscriber}{fax_preferences}{destinations}}) {
if($$_{destination} =~ /^\+?\d+$/) {
my $scc = $c->session->{subscriber}{cc};
$$_{destination} =~ s/^\+*/+/;
$$_{destination} =~ s/^\+$scc/0/;
}
}
}
$c->stash->{show_faxpass} = $c->request->params->{show_faxpass};
$c->stash->{edit_preferences} = $c->request->params->{edit_preferences};
$c->stash->{edit_voicebox} = $c->request->params->{edit_voicebox};
@ -1231,13 +1203,6 @@ sub edit_speed_dial_slots : Local {
$c->session->{messages}{updateerr})
: undef;
#delete $c->session->{updateerrmsg};
} else {
$$sdentry{destination} =~ s/^sip://i;
if($$sdentry{destination} =~ /^\+?\d+$/) {
my $scc = $c->session->{subscriber}{cc};
$$sdentry{destination} =~ s/^\+*/+/;
$$sdentry{destination} =~ s/^\+$scc/0/;
}
}
push @{$c->stash->{speed_dial_slots}}, { id => $$sdentry{id},
number => $i++,
@ -1502,11 +1467,6 @@ sub edit_destlist : Local {
my $bg = '';
my $i = 1;
foreach my $entry (sort { $$a{destination} cmp $$b{destination} } @$destlist) {
if($$entry{destination} =~ /^\+?\d+$/) {
my $scc = $c->session->{subscriber}{cc};
$$entry{destination} =~ s/^\+*/+/;
$$entry{destination} =~ s/^\+$scc/0/;
}
push @{$c->stash->{list_data}}, { %$entry,
background => $bg ? '' : 'tr_alt',
id => $i++,

@ -91,10 +91,11 @@ ul#topsubmenu {
}
#topsubmenu a:hover {
color: #D60808;
color: #D60808 !important;
text-decoration: none;
}
#topsubmenu a:after {
margin-left: 0px !important;
content: "" !important;
}
@ -185,6 +186,7 @@ ul#topsubmenu {
text-decoration: underline;
}
#contentplace .postlink label:after {
margin-left: 1px;
content: "\bb";
font-weight: bold;
}
@ -255,11 +257,13 @@ ul#topsubmenu {
/* print ">>" after hyper refs */
#contentplace a:after {
margin-left: 1px;
content: "\bb";
font-weight: bold;
}
/* no ">>" in heading */
#contentplace h3 a:after {
margin-left: 0px;
content: "";
}
#contentplace a.force_arrows:after {
@ -279,6 +283,9 @@ ul#topsubmenu {
margin: 0 8px 0 0;
font-weight: bold;
}
#contentplace .actions a#lock:after {
content: "\ab";
}
/* colors for disabled input fields */
#contentplace .disabled {
@ -394,6 +401,7 @@ ul#topsubmenu {
}
/* no ">>" in pagination next / previous */
#contentplace .pagination li.nextpage a:after {
margin-left: 0px;
content: "";
}

@ -56,7 +56,8 @@
<td class="tdkey">CustomerID:</td>
<td>
[% IF edit_account %]
<input type="text" name="customer_id" value="[% account.customer_id %]" />
<input type="text" name="customer_id" value="[% account.customer_id %]"
title="unique ID of the customer the account belongs to, integer, optional" />
[% ELSE %]
[% IF account.customer_id %]
<a href="/customer/detail?customer_id=[% account.customer_id %]">[% account.customer_id %]</a>
@ -135,7 +136,11 @@
<td class="nowrap">&euro; [% account.balance.cash_balance %]</td>
<td>
[% IF edit_balance %]
<div class="account_add">add <input type="text" name="add_cash" value="[% balanceadd.cash %]" /> Euro</div>
<div class="account_add">
add
<input type="text" name="add_cash" value="[% balanceadd.cash %]"
title="amount of money to add, float" />
Euro</div>
[% END %]
</td>
</tr>
@ -145,7 +150,12 @@
<td class="nowrap">[% account.balance.free_time_balance %] s</td>
<td>
[% IF edit_balance %]
<div class="account_add">add <input type="text" name="add_time" value="[% balanceadd.free_time %]" /> seconds</div>
<div class="account_add">
add
<input type="text" name="add_time" value="[% balanceadd.free_time %]"
title="amount of free time in seconds to add, integer" />
seconds
</div>
[% END %]
</td>
</tr>
@ -176,6 +186,11 @@
<div class="p1">
[% IF account.subscribers %]
<table>
<tr class="table_header">
<td>SIP URI</td>
<td>Primary Number</td>
<td>Registered Devices</td>
</tr>
[% FOREACH subscriber = account.subscribers %]
<tr>
<td>
@ -187,7 +202,7 @@
[% END %]
</td>
<td>[% IF subscriber.sn %]+[% subscriber.cc %] [% subscriber.ac %] [% subscriber.sn %][% END %]</td>
<td>[% subscriber.uuid %]</td>
<td>[% subscriber.registered_contacts %]</td>
</tr>
[% END %]
</table>

@ -20,28 +20,33 @@
<tr>
<td>[% admin.login %]</td>
[% IF admin.login == edit_admin %]
<form action="/admin/do_edit_admin" method="post">
<form autocomplete="off" action="/admin/do_edit_admin" method="post">
<input type="hidden" name="admin" value="[% admin.login %]" />
<td><input type="password" name="password" value="" /></td>
<td><input type="password" name="password" value=""
title="if set, the new login password for the account, string" /></td>
<td class="tdcenter">
<input type="checkbox" class="checkbox" name="is_master"
[% IF admin.login == Catalyst.session.admin.login %]disabled="disabled"[% END %]
[% IF erefill.is_master or !erefill && admin.is_master %]checked="checked" [% END %] />
[% IF erefill.is_master or !erefill && admin.is_master %]checked="checked" [% END %]
title="if checked, the administrator can create and edit other administrator accounts" />
</td>
<td class="tdcenter">
<input type="checkbox" class="checkbox" name="is_active"
[% IF admin.login == Catalyst.session.admin.login %]disabled="disabled"[% END %]
[% IF erefill.is_active or !erefill && admin.is_active %]checked="checked" [% END %] />
[% IF erefill.is_active or !erefill && admin.is_active %]checked="checked" [% END %]
title="if checked, the administrator account is active and may be used" />
</td>
<td class="tdcenter">
<input type="checkbox" class="checkbox" name="read_only"
[% IF admin.login == Catalyst.session.admin.login %]disabled="disabled"[% END %]
[% IF erefill.read_only or !erefill && admin.read_only %]checked="checked" [% END %] />
[% IF erefill.read_only or !erefill && admin.read_only %]checked="checked" [% END %]
title="if checked, the administrator may not change any data" />
</td>
<td class="tdcenter">
<input type="checkbox" class="checkbox" name="show_passwords"
[% IF admin.login == Catalyst.session.admin.login %]disabled="disabled"[% END %]
[% IF erefill.show_passwords or !erefill && admin.show_passwords %]checked="checked" [% END %] />
[% IF erefill.show_passwords or !erefill && admin.show_passwords %]checked="checked" [% END %]
title="if checked, the new administrator may view subscriber passwords" />
</td>
<td>
<div class="postlink">
@ -55,19 +60,23 @@
<td>********</td>
<td class="tdcenter">
<input type="checkbox" class="checkbox" disabled="disabled"
[% IF admin.is_master %]checked="checked"[% END %] />
[% IF admin.is_master %]checked="checked"[% END %]
title="if checked, the administrator can create and edit other administrator accounts" />
</td>
<td class="tdcenter">
<input type="checkbox" class="checkbox" disabled="disabled"
[% IF admin.is_active %] checked="checked"[% END %] />
[% IF admin.is_active %] checked="checked"[% END %]
title="if checked, the administrator account is active and may be used" />
</td>
<td class="tdcenter">
<input type="checkbox" class="checkbox" disabled="disabled"
[% IF admin.read_only %] checked="checked"[% END %] />
[% IF admin.read_only %] checked="checked"[% END %]
title="if checked, the administrator may not change any data" />
</td>
<td class="tdcenter">
<input type="checkbox" class="checkbox" disabled="disabled"
[% IF admin.show_passwords %] checked="checked"[% END %] />
[% IF admin.show_passwords %] checked="checked"[% END %]
title="if checked, the new administrator may view subscriber passwords" />
</td>
<td>
[% UNLESS Catalyst.session.admin.read_only && admin.login != Catalyst.session.admin.login %]
@ -111,41 +120,49 @@
[% IF messages.cadmerr %]<div class="errormsg">[% messages.cadmerr %]</div>[% END %]
<table>
<form action="/admin/do_create_admin" method="post">
<form autocomplete="off" action="/admin/do_create_admin" method="post">
<tr>
<td>login:</td>
<td><input type="text" size="20" name="admin" id="adminaddtxt" value="[% arefill.admin %]" /></td>
<td><input type="text" size="20" name="admin" id="adminaddtxt" value="[% arefill.admin %]"
title="the login username for the new account, string" />
</td>
</tr>
<tr>
<td>password:</td>
<td><input type="password" name="password" value="" /></td>
<td><input type="password" name="password" value=""
title="the login password for the new account, string" />
</td>
</tr>
<tr>
<td>master:</td>
<td>
<input type="checkbox" class="checkbox" name="is_master"
[% IF arefill.is_master %]checked="checked"[% END %] />
[% IF arefill.is_master %]checked="checked"[% END %]
title="if checked, the new administrator can create and edit other administrator accounts" />
</td>
</tr>
<tr>
<td>active:</td>
<td>
<input type="checkbox" class="checkbox" name="is_active"
[% IF arefill.is_active %]checked="checked"[% END %] />
[% IF arefill.is_active %]checked="checked"[% END %]
title="if checked, the new administrator account is active and may be used" />
</td>
</tr>
<tr>
<td>readonly:</td>
<td>
<input type="checkbox" class="checkbox" name="read_only"
[% IF arefill.read_only %]checked="checked"[% END %] />
[% IF arefill.read_only %]checked="checked"[% END %]
title="if checked, the new administrator may not change any data" />
</td>
</tr>
<tr>
<td>show passwords:</td>
<td>
<input type="checkbox" class="checkbox" name="show_passwords"
[% IF arefill.show_passwords %]checked="checked"[% END %] />
[% IF arefill.show_passwords %]checked="checked"[% END %]
title="if checked, the new administrator may view subscriber passwords" />
</td>
</tr>
<tr>

@ -0,0 +1,2 @@
<h3>Welcome to the NGCP web administration frontend!</h3>
<div>Please choose one of the menu items on the left.</div>

@ -3,27 +3,36 @@
<form action="/subscriber/search" method="post" class="search_subscriber">
<label class="search_label" for="search_by_username">Username:</label>
<input type="text" id="search_by_username" name="search_username" value="[% search_username %]" />
<input type="checkbox" class="checkbox" id="exact_username" name="exact_username" [% IF exact_username %]checked="checked"[% END %] />
<input type="text" id="search_by_username" name="search_username" value="[% search_username %]"
title="search by the local part of the SIP URI, wildcards allowed" />
<input type="checkbox" class="checkbox" id="exact_username" name="exact_username" [% IF exact_username %]checked="checked"[% END %]
title="if checked, the search string will not be surrounded by wildcards" />
<label for="exact_username">exact match</label><br />
<label class="search_label" for="search_by_domain">Domain:</label>
<input type="text" id="search_by_domain" name="search_domain" value="[% search_domain %]" />
<input type="checkbox" class="checkbox" id="exact_domain" name="exact_domain" [% IF exact_domain %]checked="checked"[% END %] />
<input type="text" id="search_by_domain" name="search_domain" value="[% search_domain %]"
title="search by the domain of the SIP URI, wildcards allowed" />
<input type="checkbox" class="checkbox" id="exact_domain" name="exact_domain" [% IF exact_domain %]checked="checked"[% END %]
title="if checked, the search string will not be surrounded by wildcards" />
<label for="exact_domain">exact match</label><br />
<label class="search_label" for="search_by_number">E.164 number:</label>
<input type="text" id="search_by_number" name="search_number" value="[% search_number %]" />
<input type="checkbox" class="checkbox" id="exact_number" name="exact_number" [% IF exact_number %]checked="checked"[% END %] />
<input type="text" id="search_by_number" name="search_number" value="[% search_number %]"
title="search by the E.164 numbers, wildcards allowed" />
<input type="checkbox" class="checkbox" id="exact_number" name="exact_number" [% IF exact_number %]checked="checked"[% END %]
title="if checked, the search string will not be surrounded by wildcards" />
<label for="exact_number">exact match</label><br />
<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" class="checkbox" id="exact_uuid" name="exact_uuid" [% IF exact_uuid %]checked="checked"[% END %] />
<input type="text" id="search_by_uuid" name="search_uuid" value="[% search_uuid %]"
title="search by the UUID, wildcards allowed" />
<input type="checkbox" class="checkbox" id="exact_uuid" name="exact_uuid" [% IF exact_uuid %]checked="checked"[% END %]
title="if checked, the search string will not be surrounded by wildcards" />
<label for="exact_uuid">exact match</label><br />
<div class="topbottomspace">
<input type="checkbox" class="checkbox" id="include_terminated" name="terminated" [% IF terminated %]checked="checked"[% END %] />
<input type="checkbox" class="checkbox" id="include_terminated" name="terminated" [% IF terminated %]checked="checked"[% END %]
title="if checked, the search result will include terminated subscribers" />
<label for="include_terminated">include terminated subscribers</label><br />
</div>
@ -37,7 +46,11 @@
<div class="p1">
<table>
<tr class="table_header"><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>
<td>Primary Number</td>
</tr>
[% FOREACH subscriber = subscriber_list %]
@ -54,6 +67,11 @@
<a href="/account/detail?account_id=[% subscriber.account_id %]">
[% subscriber.account_id %]</a>
</td>
<td>
[% IF subscriber.sn %]
+[% subscriber.cc %] [% subscriber.ac %] [% subscriber.sn %]
[% END %]
</td>
</tr>
[% END %]

@ -42,7 +42,7 @@
[% END %]
[% ELSE %]
<script language="JavaScript" src="/js/openclose.js" type="text/javascript"></script>
<a href="javascript:;" class="aaction" onclick="javascript:openclose();" onkeypress="javascript:openclose();">lock</a>
<a id="lock" href="javascript:;" class="aaction" onclick="javascript:openclose();" onkeypress="javascript:openclose();">lock</a>
<span id="lock_menu" class="floating" onmouseout="javascript:openclose();">
<a href="lock?subscriber_id=[% subscriber.subscriber_id %]&amp;lock=none" class="aaction">unlock</a><br />
<a href="lock?subscriber_id=[% subscriber.subscriber_id %]&amp;lock=foreign" class="aaction">foreign</a><br />
@ -79,9 +79,11 @@
<td class="tdkey">web password:</td>
<td>
[% IF edit_subscriber %]
<input type="text" name="webpassword" id="edit_webpass" value="[% subscriber.edit_webpass %]" />
<input type="text" name="webpassword" id="edit_webpass" value="[% subscriber.edit_webpass %]"
title="the password used for login at the SOAP and CSC interfaces, string" />
[% ELSE %]
<input type="text" id="edit_webpass" class="disabled" disabled="disabled"
title="the password used for login at the SOAP and CSC interfaces, string"
[% IF show_webpass && Catalyst.session.admin.show_passwords %]
value="[% subscriber.webpassword %]" /> <a href="?subscriber_id=[% subscriber.subscriber_id %]" class="apass">Hide</a>
[% ELSE %]
@ -102,9 +104,12 @@
<td class="tdkey">E.164 number:</td>
<td>
[% IF edit_subscriber %]
<input type="text" name="cc" class="ishort" value="[% subscriber.cc %]" />
<input type="text" name="ac" class="ishort" value="[% subscriber.ac %]" />
<input type="text" name="sn" value="[% subscriber.sn %]" />
<input type="text" name="cc" class="ishort" value="[% subscriber.cc %]"
title="the country code of the E.164 number, integer" />
<input type="text" name="ac" class="ishort" value="[% subscriber.ac %]"
title="the area code of the E.164 number, integer" />
<input type="text" name="sn" value="[% subscriber.sn %]"
title="the subscriber part of the E.164 number, numeric string" />
[% ELSE %]
<input type="text" class="disabled" disabled="disabled"
[% IF subscriber.sn %]
@ -126,7 +131,8 @@
<tr>
<td class="tdkey">SIP URI:</td>
<td>
<input type="text" name="username" value="[% subscriber.username %]" />
<input type="text" name="username" value="[% subscriber.username %]"
title="the local part of the SIP URI, string" />
@
<select size="1" name="domain">
[% FOREACH sdom = domains %]
@ -140,9 +146,11 @@
<td class="tdkey">SIP password:</td>
<td>
[% IF edit_subscriber %]
<input type="text" name="password" id="edit_pass" value="[% subscriber.edit_pass %]" />
<input type="text" name="password" id="edit_pass" value="[% subscriber.edit_pass %]"
title="the password used for SIP authentication, string" />
[% ELSE %]
<input type="text" id="edit_pass" class="disabled" disabled="disabled"
title="the password used for SIP authentication, string"
[% IF show_pass && Catalyst.session.admin.show_passwords %]
value="[% subscriber.password %]" /> <a href="?subscriber_id=[% subscriber.subscriber_id %]" class="apass">Hide</a>
[% ELSE %]
@ -163,6 +171,7 @@
<td class="tdkey">administrative:</td>
<td>
<input type="checkbox" name="admin" class="checkbox" [% IF ! edit_subscriber %]disabled="disabled"[% END %]
title="if checked, the subscriber may create and edit other subscribers in the same VoIP account"
[% IF subscriber.admin %]checked="checked"[% END %] />
</td>
</tr>
@ -170,6 +179,7 @@
<td class="tdkey">timezone:</td>
<td>
<input type="text" name="timezone" [% IF ! edit_subscriber %]class="disabled" disabled="disabled"[% END %]
title="timezone in the form of 'continent/capital', optional"
value="[% subscriber.timezone %]" />
</td>
</tr>

Loading…
Cancel
Save