]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/pppsetup.cgi
Merge remote-tracking branch 'pmueller/temp-cleanup-orphaned-items' into next
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / pppsetup.cgi
index 33f521e7569adcb7bf640ce44e0b81c59be280ab..7597bfbc79f34f9392d3df84fcaef51d2696ddd1 100644 (file)
@@ -44,7 +44,7 @@ my $kernel=`/bin/uname -r | /usr/bin/tr -d '\012'`;
 my %color = ();
 my %mainsettings = ();
 &General::readhash("${General::swroot}/main/settings", \%mainsettings);
-&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
+&General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color);
 
 &Header::showhttpheaders();
 
@@ -103,10 +103,7 @@ elsif ($pppsettings{'ACTION'} eq $Lang::tr{'save'})
                 if ($pppsettings{'USERNAME'} eq '') {
                         $errormessage = $Lang::tr{'username not set'};
                         goto ERROR; }
-                if ($pppsettings{'PASSWORD'} eq '') {
-                        $errormessage = $Lang::tr{'password not set'};
-                        goto ERROR; }
-        }
+               }
 
         if ($pppsettings{'TIMEOUT'} eq '') {
                 $errormessage = $Lang::tr{'idle timeout not set'};
@@ -119,19 +116,6 @@ elsif ($pppsettings{'ACTION'} eq $Lang::tr{'save'})
                 $errormessage = $Lang::tr{'bad characters in script field'};
                 goto ERROR; }
 
-        if ($pppsettings{'DNS1'})
-        {
-                if (!(&General::validip($pppsettings{'DNS1'}))) {
-                        $errormessage = $Lang::tr{'invalid primary dns'};
-                        goto ERROR;  }
-        }
-        if ($pppsettings{'DNS2'})
-        {
-                if (!(&General::validip($pppsettings{'DNS2'}))) {
-                        $errormessage = $Lang::tr{'invalid secondary dns'};
-                        goto ERROR; }
-        }
-
         if ($pppsettings{'MAXRETRIES'} eq '') {
                 $errormessage = $Lang::tr{'max retries not set'};
                 goto ERROR; }
@@ -185,8 +169,6 @@ elsif ($pppsettings{'ACTION'} eq $Lang::tr{'save'})
                         if (! &General::validip($pppsettings{'BROADCAST'})) {
                                  $errormessage = $errormessage.' '.$Lang::tr{'broadcast'}.' '.$Lang::tr{'invalid broadcast ip'}; }
                 }
-                if( $pppsettings{'DNS'} eq 'Automatic') {
-                        $errormessage = $Lang::tr{'invalid input'}; }
                 if ($errormessage ne '') {goto ERROR; }
         }
 
@@ -458,10 +440,6 @@ $selected{'AUTH'}{'demon-login-script'} = '';
 $selected{'AUTH'}{'other-login-script'} = '';
 $selected{'AUTH'}{$pppsettings{'AUTH'}} = "selected='selected'";
 
-$checked{'DNS'}{'Automatic'} = '';
-$checked{'DNS'}{'Manual'} = '';
-$checked{'DNS'}{$pppsettings{'DNS'}} = "checked='checked'";
-
 $checked{'IPTV'}{'enable'} = '';
 $checked{'IPTV'}{'disable'} = '';
 $checked{'IPTV'}{$pppsettings{'IPTV'}} = "checked='checked'";
@@ -693,7 +671,7 @@ END
 ;
                 }
                 if ($pppsettings{'TYPE'} =~ /^(modem)$/ ) {
-                        print "<tr><td colspan='3' width='75%'>$Lang::tr{'number'}</td>\n";
+                        print "<tr><td colspan='3' width='75%'>$Lang::tr{'number'}&nbsp;<img src='/blob.gif' alt='*' /></td>\n";
                         print "<td width='25%'><input type='text' name='TELEPHONE' value='$pppsettings{'TELEPHONE'}'></td><tr>\n";
                         if ($pppsettings{'TYPE'} eq 'modem' ) {
                                 print "<tr><td colspan='3' width='75%'>$Lang::tr{'modem speaker on'}</td>\n";
@@ -711,15 +689,15 @@ END
         </select></td>
 </tr>
 <tr>
-        <td colspan='3' width='75%'>$Lang::tr{'optional at cmd'}&nbsp;1&nbsp;<img src='/blob.gif' alt='*' /></td>
+        <td colspan='3' width='75%'>$Lang::tr{'optional at cmd'}&nbsp;1</td>
         <td width='25%'><input type='text' name='ADD_AT1' value='$pppsettings{'ADD_AT1'}'></td>
 </tr>
 <tr>
-        <td colspan='3' width='75%'>$Lang::tr{'optional at cmd'}&nbsp;2&nbsp;<img src='/blob.gif' alt='*' /></td>
+        <td colspan='3' width='75%'>$Lang::tr{'optional at cmd'}&nbsp;2</td>
         <td width='25%'><input type='text' name='ADD_AT2' value='$pppsettings{'ADD_AT2'}'></td>
 </tr>
 <tr>
-        <td colspan='3' width='75%'>$Lang::tr{'optional at cmd'}&nbsp;3&nbsp;<img src='/blob.gif' alt='*' /></td>
+        <td colspan='3' width='75%'>$Lang::tr{'optional at cmd'}&nbsp;3</td>
         <td width='25%'><input type='text' name='ADD_AT3' value='$pppsettings{'ADD_AT3'}'></td>
 </tr>
 <tr>
@@ -732,7 +710,7 @@ END
 
 print <<END
 <tr>
-        <td colspan='3' width='75%'>$Lang::tr{'idle timeout'}</td>
+        <td colspan='3' width='75%'>$Lang::tr{'idle timeout'}&nbsp;<img src='/blob.gif' alt='*' /></td>
         <td width='25%'><input type='text' name='TIMEOUT' value='$pppsettings{'TIMEOUT'}' /></td>
 </tr>
  <tr>
@@ -774,11 +752,11 @@ print <<END
   <td width='25%'><input type='checkbox' name='DIALONDEMANDDNS' $checked{'DIALONDEMANDDNS'}{'on'} /></td>
 </tr>
 <tr>
-        <td colspan='3' width='75%'>$Lang::tr{'holdoff'}:</td>
+        <td colspan='3' width='75%'>$Lang::tr{'holdoff'}:&nbsp;<img src='/blob.gif' alt='*' /></td>
         <td width='25%'><input type='text' name='HOLDOFF' value='$pppsettings{'HOLDOFF'}' /></td>
 </tr>
 <tr>
-        <td colspan='3' width='75%'>$Lang::tr{'maximum retries'}</td>
+        <td colspan='3' width='75%'>$Lang::tr{'maximum retries'}&nbsp;<img src='/blob.gif' alt='*' /></td>
         <td width='25%'><input type='text' name='MAXRETRIES' value='$pppsettings{'MAXRETRIES'}' /></td>
 </tr>
 END
@@ -793,15 +771,15 @@ print <<END
         <td colspan='4' width='100%' bgcolor='$color{'color20'}'><b>$Lang::tr{'pptp settings'}</b></td>
 </tr>
 <tr>
-        <td width='25%'>Peer</td>
+        <td width='25%'>$Lang::tr{'pptp peer'}:&nbsp;<img src='/blob.gif' alt='*' /></td>
         <td colspan='3'><input size=50 type='text' name='PPTP_PEER' value='$pppsettings{'PPTP_PEER'}' /></td>
 </tr>
 <tr>
-        <td width='25%'>My Netconfig</td>
+        <td width='25%'>$Lang::tr{'pptp netconfig'}:&nbsp;<img src='/blob.gif' alt='*' /></td>
         <td colspan='3'><input size=50 type='text' name='PPTP_NICCFG' value='$pppsettings{'PPTP_NICCFG'}' /></td>
 </tr>
 <tr>
-        <td width='25%'>PPTP Route&nbsp;<img src='/blob.gif' alt='*' /></td>
+        <td width='25%'>$Lang::tr{'pptp route'}:</td>
         <td colspan='3'><input size=50 type='text' name='PPTP_ROUTE' value='$pppsettings{'PPTP_ROUTE'}' /></td>
 </tr>
 
@@ -889,12 +867,12 @@ print <<END
         <td colspan='4' width='100%' bgcolor='$color{'color20'}'><b>$Lang::tr{'pppoe settings'}</b></td>
 </tr>
 <tr>
-        <td width='25%'>$Lang::tr{'service name'}&nbsp;<img src='/blob.gif' alt='*' /></td>
+        <td width='25%'>$Lang::tr{'service name'}</td>
         <td colspan='2' width='50%'></td>
         <td width='25%'><input type='text' name='SERVICENAME' value='$pppsettings{'SERVICENAME'}' /></td>
 </tr>
 <tr>
-        <td width='25%'>$Lang::tr{'concentrator name'}&nbsp;<img src='/blob.gif' alt='*' /></td>
+        <td width='25%'>$Lang::tr{'concentrator name'}</td>
         <td colspan='2' width='50%'></td>
         <td width='25%'><input type='text' name='CONCENTRATORNAME' value='$pppsettings{'CONCENTRATORNAME'}' /></td>
 </tr>
@@ -909,11 +887,11 @@ print <<END
 </tr>
 <tr>
 <tr>
-        <td width='25%'>MTU&nbsp;<img src='/blob.gif' alt='*' /></td>
+        <td width='25%'>MTU:</td>
         <td width='25%'><input type='text' name='MTU' value='$pppsettings{'MTU'}' /></td>
 </tr>
 <tr>
-        <td width='25%'>MRU&nbsp;<img src='/blob.gif' alt='*' /></td>
+        <td width='25%'>MRU:</td>
         <td width='25%'><input type='text' name='MRU' value='$pppsettings{'MRU'}' /></td>
 </tr>
 END
@@ -925,9 +903,9 @@ print <<END
         <td bgcolor='$color{'color20'}' colspan='4' width='100%'><b>$Lang::tr{'authentication'}</b></td>
 </tr>
 <tr>
-        <td width='25%'>$Lang::tr{'username'}</td>
+        <td width='25%'>$Lang::tr{'username'}&nbsp;<img src='/blob.gif' alt='*' /></td>
         <td width='25%'><input type='text' name='USERNAME' value='$pppsettings{'USERNAME'}' /></td>
-        <td width='25%'>$Lang::tr{'password'}</td>
+        <td width='25%'>$Lang::tr{'password'}&nbsp;</td>
         <td width='25%'><input type='password' name='PASSWORD' value='$pppsettings{'PASSWORD'}' /></td>
 </tr>
 <tr>
@@ -948,28 +926,12 @@ END
 }
 print <<END
         </select></td>
-        <td width='25%'>$Lang::tr{'script name'}&nbsp;<img src='/blob.gif' alt='*' /></td>
+        <td width='25%'>$Lang::tr{'script name'}</td>
         <td width='25%'><input type='text' name='LOGINSCRIPT' value='$pppsettings{'LOGINSCRIPT'}' /></td>
 </tr>
-<tr><td colspan='4' width='100%'><br></br></td></tr>
-<tr>
-        <td bgcolor='$color{'color20'}' colspan='4' width='100%'><b>DNS:</b></td>
-</tr>
-<tr>
-        <td colspan='4' width='100%'><input type='radio' name='DNS' value='Automatic' $checked{'DNS'}{'Automatic'} />$Lang::tr{'automatic'}</td>
-</tr>
-<tr>
-        <td colspan='4' width='100%'><input type='radio' name='DNS' value='Manual' $checked{'DNS'}{'Manual'} />$Lang::tr{'manual'}</td>
-</tr>
-<tr>
-        <td width='25%'>$Lang::tr{'primary dns'}</td>
-        <td width='25%'><input type='text' name='DNS1' value='$pppsettings{'DNS1'}'></td>
-        <td width='25%'>$Lang::tr{'secondary dns'}</td>
-        <td width='25%'><input type='text' name='DNS2' value='$pppsettings{'DNS2'}'></td>
-</tr>
 <tr><td colspan='4' width='100%'><br></br><hr></hr><br></br></td></tr>
 <tr>
-        <td width='25%'>$Lang::tr{'profile name'}</td>
+        <td width='25%'>$Lang::tr{'profile name'}&nbsp;<img src='/blob.gif' alt='*' /></td>
         <td width='25%'><input type='text' name='PROFILENAME' value='$pppsettings{'PROFILENAME'}'>
         <td colspan='2' width='50%'></td>
 </tr>
@@ -978,14 +940,16 @@ print <<END
 </tr>
 <tr>
         <td colspan='2' width='50%'>$Lang::tr{'legend'}:</td>
-        <td colspan='2' width='50%'><img src='/blob.gif' alt='*' />&nbsp;$Lang::tr{'this field may be blank'}</td>
+        <td colspan='2' width='50%'><img src='/blob.gif' alt='*' />&nbsp;$Lang::tr{'required field'}</td>
 </tr>
-</table>
 END
 ;
-&Header::closebox();
 }
 
+print "</table>";
+
+&Header::closebox();
+
 print "</form>\n";
 
 &Header::closebigbox();
@@ -1044,7 +1008,6 @@ sub initprofile
         $pppsettings{'TIMEOUT'} = 15;
         $pppsettings{'MODULATION'} = 'AUTO';
         $pppsettings{'AUTH'} = 'pap-or-chap';
-        $pppsettings{'DNS'} = 'Automatic';
         $pppsettings{'DEBUG'} = 'off';
         $pppsettings{'BACKUPPROFILE'} = $pppsettings{'PROFILE'};
         $pppsettings{'IPTVSERVERS'} = '192.168.2.51/32';