]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/pppsetup.cgi
Add modem status page.
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / pppsetup.cgi
index ca6892bf151b0ce18482da67b014207641d115bc..563d0eb58c8b0b7d1949d850b75d27de34887e6e 100644 (file)
@@ -73,6 +73,9 @@ elsif ($pppsettings{'ACTION'} eq $Lang::tr{'save'})
         if ($pppsettings{'TYPE'} =~ /^(modem|serial|isdn)$/ && $pppsettings{'COMPORT'} !~ /^(ttyS0|ttyS1|ttyS2|ttyS3|ttyS4|ttyACM0|ttyACM1|ttyACM2|ttyACM3|ttyUSB0|ttyUSB1|ttyUSB2|ttyUSB3|rfcomm0|rfcomm1|isdn1|isdn2)$/) {
                 $errormessage = $Lang::tr{'invalid input'};
                 goto ERROR; }
+        if ($pppsettings{'TYPE'} =~ /^(modem|serial|isdn)$/ && $pppsettings{'MONPORT'} !~ /^(ttyUSB0|ttyUSB1|ttyUSB2|ttyUSB3)$/) {
+                $errormessage = $Lang::tr{'invalid input'};
+                goto ERROR; }
         if ($pppsettings{'TYPE'} =~ /^(modem|serial)$/ && $pppsettings{'DTERATE'} !~ /^(9600|19200|38400|57600|115200|230400|460800|921600)$/) {
                 $errormessage = $Lang::tr{'invalid input'};
                 goto ERROR; }
@@ -335,6 +338,13 @@ $selected{'COMPORT'}{'rfcomm0'} = '';
 $selected{'COMPORT'}{'rfcomm1'} = '';
 $selected{'COMPORT'}{$pppsettings{'COMPORT'}} = "selected='selected'";
 
+$selected{'MONPORT'}{''} = '';
+$selected{'MONPORT'}{'ttyUSB0'} = '';
+$selected{'MONPORT'}{'ttyUSB1'} = '';
+$selected{'MONPORT'}{'ttyUSB2'} = '';
+$selected{'MONPORT'}{'ttyUSB3'} = '';
+$selected{'MONPORT'}{$pppsettings{'MONPORT'}} = "selected='selected'";
+
 $selected{'DTERATE'}{'9600'} = '';
 $selected{'DTERATE'}{'19200'} = '';
 $selected{'DTERATE'}{'38400'} = '';
@@ -432,8 +442,8 @@ if ($pppsettings{'IPTV_VLAN'} eq '') { $pppsettings{'IPTV_VLAN'}='8'; }
 if ($netsettings{'RED_TYPE'} ne 'PPPOE') {
        $errormessage = $Lang::tr{'dialup red not ppp'};
        &Header::openbox('100%', 'center', $Lang::tr{'error messages'});
-        print "<CLASS name='base'>$errormessage\n";
-        print "&nbsp;</CLASS>\n";
+        print "<class name='base'>$errormessage\n";
+        print "&nbsp;</class>\n";
         &Header::closebox();
        &Header::closebigbox();
 
@@ -443,8 +453,8 @@ if ($netsettings{'RED_TYPE'} ne 'PPPOE') {
 
 if ($errormessage) {
         &Header::openbox('100%', 'center', $Lang::tr{'error messages'});
-        print "<CLASS name='base'>$errormessage\n";
-        print "&nbsp;</CLASS>\n";
+        print "<class name='base'>$errormessage\n";
+        print "&nbsp;</class>\n";
         &Header::closebox();
 }
 
@@ -530,7 +540,7 @@ END
 ;
         if ($pppsettings{'TYPE'} =~ /^(modem)$/) {
         print <<END
-            <td colspan='1' width='25%'><A HREF=modem.cgi>$Lang::tr{'modem configuration'}</A></td>
+            <td colspan='1' width='25%'><a href='modem.cgi'>$Lang::tr{'modem configuration'}</a></td>
 END
 ;
 }
@@ -583,6 +593,24 @@ END
 ;
                 }
     print "</select></td>       "}
+
+       if ($pppsettings{'TYPE'} =~ /^(modem|serial)$/) {
+               print <<END;
+                       <tr>
+                               <td colspan='3' width='75%'>$Lang::tr{'monitor interface'}:</td>
+                               <td width='25%'>
+                                       <select name="MONPORT" style="width: 165px;">
+                                               <option value="" $selected{'MONPORT'}{''}>---</option>
+                                               <option value="ttyUSB0" $selected{'MONPORT'}{'ttyUSB0'}>ttyUSB0</option>
+                                               <option value="ttyUSB1" $selected{'MONPORT'}{'ttyUSB1'}>ttyUSB1</option>
+                                               <option value="ttyUSB2" $selected{'MONPORT'}{'ttyUSB2'}>ttyUSB2</option>
+                                               <option value="ttyUSB3" $selected{'MONPORT'}{'ttyUSB3'}>ttyUSB3</option>
+                                       </select>
+                               </td>
+                       </tr>
+END
+       }
+
                 if ($pppsettings{'TYPE'} =~ /^(modem|serial)$/ ) {
                         print <<END
   <tr>
@@ -926,6 +954,7 @@ sub initprofile
 {
         $pppsettings{'PROFILENAME'} = $Lang::tr{'unnamed'};
         $pppsettings{'COMPORT'} = 'ttyS0';
+        $pppsettings{'MONPORT'} = '';
         $pppsettings{'DTERATE'} = 115200;
         $pppsettings{'SPEAKER'} = 'off';
         $pppsettings{'RECONNECTION'} = 'persistent';