quick hack to add extra 'config lines' to svc_www and otherwise enhance svc_www
authorjeff <jeff>
Sun, 1 Apr 2007 02:45:28 +0000 (02:45 +0000)
committerjeff <jeff>
Sun, 1 Apr 2007 02:45:28 +0000 (02:45 +0000)
FS/FS/AccessRight.pm
FS/FS/Schema.pm
bin/apache.export
httemplate/edit/svc_www.cgi
httemplate/view/svc_www.cgi

index 5194bd4..f67614a 100644 (file)
@@ -116,6 +116,7 @@ assigned to users and/or groups.
 # customer service rights
 ###
   'Edit usage', #NEW
+  'Edit www config', #NEW
   'View customer services', #NEW
   'Provision customer service',
   'Recharge customer service', #NEW
index 84078fa..e0fef91 100644 (file)
@@ -940,6 +940,7 @@ sub tables_hashref {
         'svcnum',   'int',    '',  '', '', '', 
         'recnum',   'int',    '',  '', '', '', 
         'usersvc',  'int',    '',  '', '', '', 
+        'config',   'text',   'NULL',  '', '', '', 
       ],
       'primary_key' => 'svcnum',
       'unique'      => [],
index 47863a9..b39b5f1 100755 (executable)
@@ -36,9 +36,12 @@ foreach my $export ( @exports ) {
   my @svc_www = $export->svc_x;
 
   foreach my $svc_www ( @svc_www ) {
-    use vars qw($zone $username);
+    use vars qw($zone $username $dir $email $config);
     $zone = $svc_www->domain_record->zone;
     $username = $svc_www->svc_acct->username;
+    $dir = $svc_www->svc_acct->dir;
+    $email = $svc_www->svc_acct->email;
+    $config = $svc_www->config;
     print HTTPD_CONF eval(qq("$template")). "\n\n";
   }
 
index 4b27752..a9f97ff 100644 (file)
@@ -1,6 +1,6 @@
 %my $conf = new FS::Conf;
 %
-%my( $svcnum,  $pkgnum, $svcpart, $part_svc, $svc_www );
+%my( $svcnum,  $pkgnum, $svcpart, $part_svc, $svc_www, $config );
 %
 %if ( $cgi->param('error') ) {
 %
@@ -10,6 +10,7 @@
 %  $svcnum = $svc_www->svcnum;
 %  $pkgnum = $cgi->param('pkgnum');
 %  $svcpart = $cgi->param('svcpart');
+%  $config = $cgi->param('config');
 %  $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
 %  die "No part_svc entry!" unless $part_svc;
 %
@@ -42,6 +43,7 @@
 %
 %  $pkgnum=$cust_svc->pkgnum;
 %  $svcpart=$cust_svc->svcpart;
+%  $config=$svc_www->config;
 %  
 %  $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
 %  die "No part_svc entry!" unless $part_svc;
 %  print "</SELECT></TD></TR>";
 %}
 %
+%if ( $part_svc->part_svc_column('config')->columnflag ne 'F' &&
+%     $FS::CurrentUser::CurrentUser->access_right('Edit www config') ) {
+%  print '<TR><TD ALIGN="right">Config lines</TD><TD>';
+%  print qq!<TEXTAREA NAME="config" rows="15" cols="80">$config</TEXTAREA></TD></TR>!
+%}else{
+%  print qq!<INPUT TYPE="hidden" NAME="config" VALUE="$config">!;
+%}
+%
 %foreach my $field ($svc_www->virtual_fields) {
 %  if ( $part_svc->part_svc_column($field)->columnflag ne 'F' ) {
 %    # If the flag is X, it won't even show up in $svc_acct->virtual_fields.
index 0579a55..c503d18 100644 (file)
@@ -73,6 +73,8 @@
 %
 %  print '</TD></TR>';
 %}
+    <% qq!<TR><TD ALIGN="right">Config lines</TD>! %>
+    <% qq!<TD BGCOLOR="#ffffff"><pre>!.$cgi->escapeHTML(join("\n",$svc_www->config))."</pre></TD></TR>" %>
 %
 %foreach (sort { $a cmp $b } $svc_www->virtual_fields) {
 %  print $svc_www->pvf($_)->widget('HTML', 'view', $svc_www->getfield($_)),