summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
authorivan <ivan>2011-10-14 08:56:04 +0000
committerivan <ivan>2011-10-14 08:56:04 +0000
commit1ee0b1290d186a706a256ca72347dc746c6c6688 (patch)
tree7a214717d55690a26c4dfe5c6308ed106ce4c262 /httemplate/edit
parentb77871d0fb98a36a8048f90193a8092550119945 (diff)
maintain freeradius nas table, RT#14697
Diffstat (limited to 'httemplate/edit')
-rw-r--r--httemplate/edit/elements/edit.html2
-rw-r--r--httemplate/edit/nas.html41
-rw-r--r--httemplate/edit/process/nas.html7
3 files changed, 50 insertions, 0 deletions
diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html
index d9843471f..6db54fd48 100644
--- a/httemplate/edit/elements/edit.html
+++ b/httemplate/edit/elements/edit.html
@@ -287,6 +287,7 @@ Example:
%
% #any?
% 'colspan' => $f->{'colspan'},
+% 'required' => $f->{'required'},
% );
%
% $include_common{$_} = $f->{$_} foreach grep exists($f->{$_}),
@@ -755,6 +756,7 @@ my $fields = $opt{'fields'}
|| [ grep { $_ ne $pkey } fields($table) ];
#my @actualfields = map { ref($_) ? $_->{'field'} : $_ } @$fields;
+#$m->comp('/elements/handle_uri_query');
if ( $cgi->param('redirect') ) {
my $session = $cgi->param('redirect');
my $pref = $curuser->option("redirect$session");
diff --git a/httemplate/edit/nas.html b/httemplate/edit/nas.html
new file mode 100644
index 000000000..64d722e52
--- /dev/null
+++ b/httemplate/edit/nas.html
@@ -0,0 +1,41 @@
+<& elements/edit.html,
+ 'name_singular' => 'RADIUS client',
+ 'table' => 'nas',
+ 'viewall_dir' => 'browse',
+ 'labels' => { 'nasnum' => 'NAS',
+ 'nasname' => 'Hostname',
+ 'shortname' => 'Short name',
+ 'secret' => 'Shared secret',
+ 'type' => 'Type',
+ 'ports' => 'Ports',
+ 'server' => 'Server',
+ 'community' => 'Community',
+ 'description' => 'Description',
+ },
+ 'fields' => [
+ { field=> 'nasname', required=>1, size=>40, maxlength=>128 },
+ { field=>'shortname', size=>16, maxlength=>32 },
+ { field=>'secret', size=>40, maxlength=>60, required=>1 },
+ { field=>'type', type=>'select',
+ options=>[qw( cisco computone livingston max40xx multitech netserver
+ pathras patton portslave tc usrhiper other )],
+ },
+ { field=>'ports', size=>5 },
+ { field=>'server', size=>40, maxlength=>64 },
+ { field=>'community', size=>40, maxlength=>50 },
+ { field=>'description', size=>100, maxlength=>200 },
+ ],
+ 'html_bottom' => '<font color="#ff0000">*</font>&nbsp;'.
+ emt('required fields'). '<BR>',
+ 'new_hashref_callback' => sub { +{ 'type' => 'other',
+ 'secret' => 'secret',
+ 'description' => 'RADIUS Client',
+ };
+ },
+&>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+</%init>
diff --git a/httemplate/edit/process/nas.html b/httemplate/edit/process/nas.html
new file mode 100644
index 000000000..04b46a5c0
--- /dev/null
+++ b/httemplate/edit/process/nas.html
@@ -0,0 +1,7 @@
+<& elements/process.html, table=>'nas', viewall_dir=>'browse', &>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+</%init>