home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / senms435.zip / sendsms.cgi < prev    next >
Text File  |  2000-05-16  |  22KB  |  610 lines

  1. #!/usr/bin/perl
  2.  
  3. local ($i, $form, $field, @cmd, @formField, @provider, @device, @phonebook, $chapter, $key, $value);
  4.  
  5. sub Chooser {
  6.    local ($i, $loc);
  7.  
  8.    if ($form{'file'} =~ /^(.*\/)([^\/]*)$/) { $dir = $1; $file = $2; }
  9.    else { $dir = "/"; $file = ""; }
  10.    if (!(-d $dir)) { $dir = "/"; $file = ""; }
  11.  
  12.    if ($form{'frame'} == 0) {
  13.        # base frame
  14.       &PrintHeader ();
  15.        if ($form{'type'} == 0) { print "<title>Choose File..</title>\n"; }
  16.        elsif ($form{'type'} == 1) { print "<title>Choose Directory..</title>\n";}
  17.        print "<frameset rows='*,50'>\n";
  18.        print "<frame marginwidth=5 marginheight=5 name=topframe ",
  19.          "src=\"$ENV{'SCRIPT_NAME'}/chooser?frame=1&file=$form{'file'}&type=$form{'type'}&chooser=1\">\n";
  20.        print "<frame marginwidth=0 marginheight=0 name=bottomframe ",
  21.           "src=\"$ENV{'SCRIPT_NAME'}/chooser?frame=2&file=$form{'file'}&type=$form{'type'}&chooser=1\" ",
  22.           "scrolling=no>\n";
  23.        print "</frameset>\n";
  24.    } elsif ($form{'frame'} == 1) {
  25.       # List of files in this directory
  26.       &PrintHeader ();
  27.  
  28.       print <<EOF;
  29. <script>
  30. function fileclick(f, d)
  31. {
  32. curr = top.frames[1].document.forms[0].elements[1].value;
  33. if (curr == f) {
  34.     // Double-click! Enter directory or select file
  35.     if (d) {
  36.         // Enter this directory
  37.         location = "$ENV{'SCRIPT_NAME'}/chooser?frame=1&type=$form{'type'}&chooser=1&file="+f+"/";
  38.         }
  39.     else {
  40.         // Select this file and close the window
  41.         top.ifield.value = f;
  42.         top.close();
  43.         }
  44.     }
  45. else {
  46.     top.frames[1].document.forms[0].elements[1].value = f;
  47.     }
  48. }
  49.  
  50. function parentdir(p)
  51. {
  52. top.frames[1].document.forms[0].elements[1].value = p;
  53. location = "$ENV{'SCRIPT_NAME'}/chooser?frame=1&type=$form{'type'}&chooser=1&file="+p;
  54. }
  55. </script>
  56. EOF
  57.  
  58.    print "<b>Directory of $dir</b>\n";
  59.    print "<table width=\"100%\">\n";
  60.    opendir(DIR, $dir);
  61.    foreach $f (sort { $a cmp $b } readdir(DIR)) {
  62.       $path = "$dir$f";
  63.       if ($f eq ".") { next; }
  64.       if ($f eq ".." && $dir eq "/") { next; }
  65.       if (!(-d $path) && $form{'type'} == 1) { next; }
  66.       @st = stat($path);
  67.       print "<tr>\n";
  68.       $isdir = 0;
  69.       if (-d $path) { $isdir = 1; }
  70.       if ($f eq "..") {
  71.          $dir =~ /^(.*\/)[^\/]+\/$/;
  72.          $link = "<a href=\"\" onClick='parentdir(\"$1\"); return false'>";
  73.       } else {
  74.          $link = "<a href=\"\" onClick='fileclick(\"$path\", $isdir); return false'>";
  75.       }
  76.       print "<td nowrap>$link$f</a></td>\n";
  77.       printf "<td nowrap>%s</td>\n",
  78.             $st[7] > 1000000 ? int($st[7]/1000000)." Mb" :
  79.             $st[7] > 1000 ? int($st[7]/1000)." Kb" :
  80.             $st[7];
  81.       @tm = localtime($st[9]);
  82.       printf "<td nowrap><tt>%.2d/%.2d/%.4d</tt></td>\n",
  83.             $tm[3], $tm[4]+1, $tm[5]+1900;
  84.       printf "<td nowrap><tt>%.2d:%.2d</tt></td>\n", $tm[1], $tm[2];
  85.       print "</tr>\n";
  86.    }
  87.    closedir(DIR);
  88.    print "</table>\n";
  89.    } elsif ($form{'frame'} == 2) {
  90.    # Current file and OK/cancel buttons
  91.    &PrintHeader ();
  92.    print <<EOF;
  93. <script>
  94. function filechosen()
  95. {
  96. top.ifield.value = document.forms[0].path.value;
  97. top.close();
  98. }
  99. </script>
  100. EOF
  101.  
  102.    print "<table width=\"100%\">\n";
  103.    print "<form onSubmit='filechosen(); return false'>\n";
  104.    print "<tr><td><input type=submit value=\"Ok\"></td>\n";
  105.    print "<td align=right><input name=path size=45 value=\"$dir$file\"></td></tr>\n";
  106.    print "</form>\n";
  107.    print "</table>\n";
  108.    }
  109. }
  110.  
  111. sub ChkLocalClient {
  112.    return ($ENV{'REMOTE_HOST'} eq $ENV{'SERVER_NAME'});
  113. }
  114.  
  115. sub OpenIniFile {
  116.    local $fp = $_[0];
  117.    local $rc;
  118.  
  119.    $rc = 0;
  120.    open ($fp, "<".$_[1]) or ($rc = -1);
  121.    return ($rc);
  122. }
  123.  
  124. sub CloseIniFile {
  125.    local $fp = $_[0];
  126.  
  127.    close ($fp);
  128. }
  129.  
  130. sub ReadIniFileLine {
  131.    local $fp = $_[0];
  132.    local ($zeile, $len, $rc);
  133.  
  134.    $value = "";
  135.    $len = 0;
  136.    while ((!eof ($fp)) && ($len == 0)) {
  137.       $zeile = <$fp>;
  138.       chomp ($zeile);
  139.       $zeile =~ s/;.*$//g;
  140.       $zeile =~ s/^\s+//g;
  141.       $zeile =~ s/\s+$//g;
  142.       $len = length ($zeile);
  143.    }
  144.    if ($len > 0) {
  145.       if ((substr ($zeile, 0, 1) eq '[') && (substr ($zeile, -1)  eq ']')) {
  146.          $chapter = substr ($zeile, 1, len - 1);
  147.          $key = "";
  148.          $rc = 0;
  149.       } else {
  150.          if (index ($zeile, "=") >= 0) {
  151.             ($key, $value) = split(/=/, $zeile);
  152.             $rc = 1;
  153.          } else {
  154.             $value = $zeile;
  155.             $rc = 0;
  156.          }
  157.       }
  158.       $_[1] = $chapter;
  159.       $_[2] = $key;
  160.       $_[3] = $value;
  161.    } else {
  162.       $_[1] = "";
  163.       $_[2] = "";
  164.       $_[3] = "";
  165.       $rc = -1;
  166.    }
  167.    $_[1] =~ s/^\s+//g;
  168.    $_[1] =~ s/\s+$//g;
  169.    $_[2] =~ s/^\s+//g;
  170.    $_[2] =~ s/\s+$//g;
  171.    $_[3] =~ s/^\s+//g;
  172.    $_[3] =~ s/s+.$//g;
  173.    $_[1] = lc ($_[1]);
  174.    $_[2] = lc ($_[2]);
  175.    return ($rc);
  176. }
  177.  
  178. sub PrintHeader {
  179.    print "Content-type: text/html\n\n";
  180. }
  181.  
  182. sub PrintFooter {
  183.    print "<P ALIGN=RIGHT><FONT FACE=\"Arial,Helvetica\" SIZE=\"-1\">\n";
  184.    print "© 1998, Dipl.-Inform. Wolfgang B÷cherer\n";
  185.    print "</FONT>\n";
  186.    print "<HR>\n";
  187.    print "<TABLE Border=0 WIDTH=\"100%\">\n";
  188.    print "   <TR>\n";
  189.    print "      <TD VALIGN=top ALIGN=left>\n";
  190.    print "         <ADDRESS>\n";
  191.    print "            <b>B÷cherer Angewandte Informatik</b><br>\n";
  192.    print "            Scheffelstraße 17a<br>\n";
  193.    print "            D-76135 Karlsruhe<br>\n";
  194.    print "         </ADDRESS>\n";
  195.    print "      </TD>\n";
  196.    print "      <TD  VALIGN=TOP ALIGN=right>\n";
  197.    print "            Tel: +49 (0)721 9109550<br>\n";
  198.    print "            Fax: +49 (0)721 9109555<br>\n";
  199.    print "            Email: <A HREF=\"mailto:info\@bai.de\" onMouseOver=\"status='mail us your comments'; return true;\">info\@bai.de</A><br>\n";
  200.    print "            WWW: <A HREF=\"http://www.bai.de\" onMouseOver=\"status='Homepage - B÷cherer Angewandte Informatik'; return true;\">http://www.bai.de</A>\n";
  201.    print "      </TD>\n";
  202.    print "   </TR>\n";
  203.    print "</TABLE>\n";
  204.    print "</BODY>\n";
  205.    print "</HTML>\n";
  206.    exit (0);
  207. }
  208.  
  209. sub Error {
  210.    print ("<H3>ERROR!!!</H3>".$_[0]."<P>\n");
  211.    &PrintFooter ();
  212. }
  213.  
  214. if ($ENV{'REQUEST_METHOD'} eq "POST") {
  215.    read(STDIN, $data, $ENV{'CONTENT_LENGTH'});
  216. } else {
  217.    $data = $ENV{'QUERY_STRING'};
  218. }
  219. @formField = split(/&/, $data);
  220. foreach $field (@formField) {
  221.    $field =~ s/\+/ /g;
  222.    ($name, $value) = split(/=/, $field, 2);
  223.    $name =~ s/%(..)/pack("c",hex($1))/ge;
  224.    $value =~ s/%(..)/pack("c",hex($1))/ge;
  225.    if ($name eq "sms") {
  226.       $value =~ s/[<]/</g;
  227.       $value =~ s/[>]/>/g;
  228.    }
  229.    $form{$name} = $value;
  230. }
  231. if (($ENV{'PATH_INFO'} eq "/chooser") || ($ENV{'PATH_INFO'} eq "$ENV{'SCRIPT_NAME'}/chooser") || ($form{'chooser'} ne "")) {
  232.    &Chooser ();
  233.    exit (0);
  234. }
  235. $|=1;
  236. &PrintHeader ();
  237. print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n";
  238. print "<HTML>\n";
  239. print "<HEAD>\n";
  240. print "<TITLE>SendSMS</TITLE>\n";
  241. print "</HEAD>\n";
  242. print "<BODY BGCOLOR=\"#FFFFFF\">\n";
  243. if (&OpenIniFile ('SENDSMS_INI', "sendsms.ini") >= 0) {
  244.    while (&ReadIniFileLine ('SENDSMS_INI', $chapter, $key, $value) >= 0) {
  245.       if ($value ne "") {$ini{$key} = $value;}
  246.    }
  247.    $ini{'path'} = $ini{'sendsms'};
  248.    if (($i = rindex ($ini{'path'}, "/", length ($ini{'path'}))) >= 0) {
  249.       $ini{'path'} = substr ($ini{'path'}, 0, $i + 1);
  250.    } else {
  251.       if (($i = rindex ($ini{'path'}, "\\", length ($ini{'path'}))) >= 0) {
  252.          $ini{'path'} = substr ($ini{'path'}, 0, $i + 1);
  253.       }
  254.    }
  255.    &CloseIniFile ('SENDSMS_INI');
  256. } else {
  257.    if ($ini{'language'} eq "german") {&Error ("Kein Zugriff auf Datei 'sendsms.ini'!");}
  258.    else {&Error ("can't open the file 'sendsms.ini'!");}
  259. }
  260.  
  261. if (&OpenIniFile ('SENDSMS_CFG', $ini{'config'}) >= 0) {
  262.    while (&ReadIniFileLine ('SENDSMS_CFG', $chapter, $key, $value) >= 0) {
  263.       if (($chapter eq "device") && ($key eq "name")) {push (@device, $value);}
  264.    }
  265.    &CloseIniFile ('SENDSMS_CFG');
  266. #   if (@device <= 0) {&Error ("No device configured!");}
  267. } else {
  268.    if ($ini{'language'} eq "german") {&Error ("Kein Zugriff auf Datei '".$ini{'config'}."'!");}
  269.    else {&Error ("can't open the file '".$ini{'config'}."'!");}
  270. }
  271.  
  272. if (&OpenIniFile ('SENDSMS_PRO', $ini{'provider'}) >= 0) {
  273.    while (&ReadIniFileLine ('SENDSMS_PRO', $chapter, $key, $value) >= 0) {
  274.       if (($chapter ne "") && ($key eq "") && $value eq "") {push (@provider, $chapter);}
  275.    }
  276.    &CloseIniFile ('SENDSMS_PRO');
  277.    if (@provider <= 0) {&Error ("No provider configured!");}
  278. } else {
  279.    if ($ini{'language'} eq "german") {&Error ("Kein Zugriff auf Datei '".$ini{'provider'}."'!");}
  280.    else {&Error ("can't open the file '".$ini{'provider'}."'!");}
  281. }
  282.  
  283. if ($ini{'phonebook'} ne "") {
  284.    if (&OpenIniFile ('SENDSMS_PBK', $ini{'phonebook'}) >= 0) {
  285.       while (&ReadIniFileLine ('SENDSMS_PBK', $chapter, $key, $value) >= 0) {
  286.          if (($chapter ne "") && ($key ne "") && ($value ne "")) {push (@phonebook, {'alias' => $key, 'provider' => $chapter});}
  287.       }
  288.       &CloseIniFile ('SENDSMS_PBK');
  289.    } else {
  290.       if ($ini{'language'} eq "german") {&Error ("Kein Zugriff auf Datei '".$ini{'phonebook'}."'!");}
  291.       else {&Error ("can't open the file '".$ini{'phonebook'}."'!");}
  292.    }
  293. }
  294.  
  295. if (($ENV{'PATH_INFO'} eq "/send") || ($ENV{'PATH_INFO'} eq "$ENV{'SCRIPT_NAME'}/send")) {
  296.    push (@cmd, $ini{'sendsms'});
  297.    if ($ini{'config'} ne "") {push (@cmd, "-c".$ini{'config'});}
  298.    if ($ini{'provider'} ne "") {push (@cmd, "-r".$ini{'provider'});}
  299.    if ($ini{'phonebook'} ne "") {push (@cmd, "-b".$ini{'phonebook'});}
  300.    if ($ini{'userexit'} ne "") {push (@cmd, "-u".$ini{'userexit'});}
  301.    if ($form{'verbose'} eq "1") {push (@cmd, "-v");}
  302.    if ($form{'spool'} eq "spool") {
  303.       push (@cmd, "-s");
  304.    } else {
  305.       if ($form{'spool'} eq "send") {push (@cmd, "-n");}
  306.    }
  307.    if ($form{'originator'} ne "") {push (@cmd, "-o".$form{'originator'});}
  308.    if (($form{'device'} ne "") && ($form{'device'} ne "(auto)")) {push (@cmd, "-d".$form{'device'});}
  309.    if ($form{'addrtype'} eq "phone") {
  310.       if ($form{'phone'} eq "") {
  311.          if ($ini{'language'} eq "german") {&Error ("Kein EmpfΣnger angegeben!!");}
  312.          else {&Error ("No recipient specified!!");}
  313.       }
  314.       if (($form{'provider'} ne "") && ($form{'provider'} ne "(auto)")) {push (@cmd, "-p".$form{'provider'});}
  315.       push (@cmd, $form{'phone'});
  316.    } else {
  317.       if ($form{'addrtype'} eq "phonebook") {
  318.          if ($form{'phonebook'} eq "") {
  319.             if ($ini{'language'} eq "german") {&Error ("Kein EmpfΣnger angegeben!!");}
  320.             else {&Error ("No recipient specified!!");}
  321.          }
  322.          ($key, $value) = split(/;/, $form{'phonebook'}, 2);
  323.          push (@cmd, $key);
  324.          if ($value ne "") {push (@cmd, $value);}
  325.       } else {
  326.          if (($form{'group'} eq "") || ($form{'group'} eq $ini{'path'})) {
  327.             if ($ini{'language'} eq "german") {&Error ("Kein EmpfΣnger angegeben!!");}
  328.             else {&Error ("No recipient specified!!");}
  329.          }
  330.          push (@cmd, "@".$form{'group'});
  331.       }
  332.    }
  333.    if ((!(&ChkLocalClient ())) || ($form{'msgType'} eq "text")) {
  334.       if ($form{'sms'} eq "") {
  335.          if ($ini{'language'} eq "german") {&Error ("Keine Nachricht angegeben!!");}
  336.          else {&Error ("No message specified!!");}
  337.       }
  338.       push (@cmd, "-tiso8859");
  339.       if ($ENV{'WINDIR'}) {
  340.          push (@cmd, "\"".$form{'sms'}."\"");
  341.       } else {
  342.          push (@cmd, $form{'sms'});
  343.       }
  344.    } else {
  345.       if ($form{'file'} eq "") {
  346.          if ($ini{'language'} eq "german") {&Error ("Keine Nachricht angegeben!!");}
  347.          else {&Error ("No message specified!!");}
  348.       }
  349.       if ($form{'charset'} eq "iso8859") {push (@cmd, "-tiso8859");}
  350.       else {if ($form{'charset'} eq "cp850") {push (@cmd, "-tcp850");}}
  351.       push (@cmd, "-f".$form{'file'});
  352.    }
  353.    if ($ini{'language'} eq "german") {
  354.       print "<B><I>SendSMS</I></B> wird aufgerufen, bitte warten...<P>\n";
  355.    } else {
  356.       print "<B><I>SendSMS</I></B> will be executed, please wait...<P>\n";
  357.    }
  358.    print "<listing>\n";
  359.    for ($i = 0; $i < @cmd; $i++) {
  360.       print @cmd[$i]." ";
  361.    }
  362.    print "</listing>\n";
  363.    if (!$ENV{'SERVER_PROTOCOL'}) {$ENV{'SERVER_PROTOCOL'} = "HTTP/1.0";}
  364.    if ($ENV{'WINDIR'}) {
  365.       print `@cmd`;
  366.    } else {
  367.       system (@cmd);
  368.    }
  369.    print "<FORM ACTION=\"$ENV{'SCRIPT_NAME'}\"><CENTER>\n";
  370.    if ($ini{'language'} eq "german") {
  371.       print "<INPUT TYPE=submit VALUE=\"Neue Nachricht\">\n";
  372.    } else {
  373.       print "<INPUT TYPE=submit VALUE=\"new message\">\n";
  374.    }
  375.    print "</CENTER></FORM>\n"
  376. } else {
  377.    print "<script language=\"Javascript\" type=\"text/javascript\">\n";
  378.    if ($ini{'language'} eq "german") {
  379.       print "<!-- -->ACHTUNG!!! Ihr Web-Browser unterstüzt kein JavaScript! Benutzen Sie\n";
  380.       print "<!-- -->einen anderen Browser, um die volle Funktionalität von SendSMS zu erhalten.\n";
  381.    } else {
  382.       print "<!-- -->ATTENTION!!! Your Web browser doesn't support JavaScript! Pleas use another\n";
  383.       print "<!-- -->browser, to use the full functionallity of SendSMS.\n";
  384.    }
  385.    print "<!--\n";
  386.    print "function FileChooser(feld) {\n";
  387.    print "   if (feld == \"group\")\n";
  388.    print "      document.write(\"<input type=button onClick='ifield = document.SendSMS.group; chooser = window.open(\\\"$ENV{'SCRIPT_NAME'}/chooser?type=0&file=\\\"+ifield.value, \\\"chooser\\\", \\\"toolbar=no,menubar=no,scrollbars=no,width=600,height=400\\\"); chooser.ifield = ifield' value=...>\")\n";
  389.    print "   else\n";
  390.    print "      document.write(\"<input type=button onClick='ifield = document.SendSMS.file; chooser = window.open(\\\"$ENV{'SCRIPT_NAME'}/chooser?type=0&file=\\\"+ifield.value, \\\"chooser\\\", \\\"toolbar=no,menubar=no,scrollbars=no,width=600,height=400\\\"); chooser.ifield = ifield' value=...>\")\n";
  391.    print "}\n\n";
  392.    print "function ChkValues() {\n";
  393.    print "   var flag = Boolean;\n";
  394.    print "\n";
  395.    print "   flag = false;\n";
  396.    print "   if ((document.SendSMS.addrtype[0].checked == true) && (document.SendSMS.phone.value.length > 0))\n";
  397.    print "      flag = true;\n";
  398.    print "   if ((document.SendSMS.addrtype[1].checked == true) && (document.SendSMS.phonebook.selectedIndex > 0))\n";
  399.    print "      flag = true;\n";
  400.    if (&ChkLocalClient ()) {
  401.    print "   if ((document.SendSMS.addrtype[2].checked == true) && (document.SendSMS.group.value.length > 0) && (document.SendSMS.group.value != \"".$ini{'path'}."\"))\n";
  402.    print "      flag = true;\n";
  403.    }
  404.    print "   if (flag == false)\n";
  405.    if ($ini{'language'} eq "german") {
  406.       print "      window.alert('Kein EmpfΣnger angegeben!!');\n";
  407.    } else {
  408.       print "      window.alert('No recipient specified!!');\n";
  409.    }
  410.    print "   else {\n";
  411.    print "      flag = false;\n";
  412.    if (&ChkLocalClient ()) {
  413.    print "      if ((document.SendSMS.msgType[0].checked == true) && (document.SendSMS.sms.value.length > 0))\n";
  414.    print "         flag = true;\n";
  415.    print "      if ((document.SendSMS.msgType[1].checked == true) && (document.SendSMS.file.value.length > 0))\n";
  416.    print "         flag = true;\n";
  417.    } else {
  418.    print "      if (document.SendSMS.sms.value.length > 0)\n";
  419.    print "         flag = true;\n";
  420.    }
  421.    print "      if (flag == false)\n";
  422.    if ($ini{'language'} eq "german") {
  423.       print "         window.alert('Keine Nachricht angegeben!!');\n";
  424.    } else {
  425.       print "         window.alert('No message specified!!');\n";
  426.    }
  427.    print "   }\n";
  428.    print "   return (flag);\n";
  429.    print "}\n";
  430.    print "//-->\n";
  431.    print "</script>\n";
  432.    print "\n";
  433.    print "<FORM ID=\"SendSMS\" NAME=\"SendSMS\" METHOD=POST ACTION=\"$ENV{'SCRIPT_NAME'}/send\" onSubmit=\"return(ChkValues())\">\n";
  434.  
  435.    print "<table width=\"100%\">\n";
  436.    print "<tr><td>\n";
  437.    if ($ini{'language'} eq "german") {
  438.       print "<B>Absender: </B>\n";
  439.    } else {
  440.       print "<B>Originator: </B>\n";
  441.    }
  442.    print "<INPUT TYPE=text NAME=originator VALUE=\"";
  443.    if ($ENV{'REMOTE_USER'}) {
  444.       print $ENV{'REMOTE_USER'};
  445.       if ($ENV{'REMOTE_HOST'}) {print "@".$ENV{'REMOTE_HOST'};}
  446.    }
  447.    print "\" SIZE=30>\n";
  448.    print "<P>\n";
  449.    print "</td><td align=right>\n";
  450.    print "<FONT SIZE=\"+3\"><B><I>SendSMS</I></B></FONT>\n";
  451.    print "</td></tr>\n";
  452.    print "</table><p>\n";
  453.    if ($ini{'language'} eq "german") {
  454.       print "<B>Empfänger:</B><BR>\n";
  455.    } else {
  456.       print "<B>Receiver:</B><BR>\n";
  457.    }
  458.    print "<table border=1 width=\"100%\">\n";
  459.    print "<tr><td>\n";
  460.    print "<INPUT TYPE=radio CHECKED NAME=addrtype VALUE=phone>";
  461.    if ($ini{'language'} eq "german") {
  462.       print " Telefonnummer\n";
  463.    } else {
  464.       print " phone number\n";
  465.    }
  466.    print "</td><td>\n";
  467.    print "<INPUT TYPE=text NAME=phone VALUE=\"\" SIZE=30>";
  468.    if ($ini{'language'} eq "german") {
  469.       print " Telefonnummer<BR>\n";
  470.    } else {
  471.       print " phone number<BR>\n";
  472.    }
  473.    print "<SELECT NAME=provider SIZE=1>\n";
  474.    print "<OPTION SELECTED>(auto)</OPTION>\n";
  475.    for ($i = 0; $i < @provider; $i++) {
  476.       print "<OPTION>".$provider[$i]."</OPTION>\n";
  477.    }
  478.    if ($ini{'language'} eq "german") {
  479.       print "</SELECT> Provider<P>\n";
  480.    } else {
  481.       print "</SELECT> provider<P>\n";
  482.    }
  483.    print "</td></tr>\n";
  484.    if (@phonebook > 0) {
  485.       print "<tr><td>\n";
  486.       print "<INPUT TYPE=radio NAME=addrtype VALUE=phonebook>";
  487.       if ($ini{'language'} eq "german") {
  488.          print " Telefonbuch\n";
  489.       } else {
  490.          print " phonebook\n";
  491.       }
  492.       print "</td><td>\n";
  493.       print "<SELECT NAME=phonebook SIZE=1>\n";
  494.       print "<OPTION SELECTED></OPTION>\n";
  495.       for ($i = 0; $i < @phonebook; $i++) {
  496.          print "<OPTION VALUE=\"-p".$phonebook[$i]->{'provider'}.";".$phonebook[$i]->{'alias'}."\">".$phonebook[$i]->{'alias'}." [".$phonebook[$i]->{'provider'}."]</OPTION>\n";
  497.       }
  498.       print "</SELECT>\n";
  499.       print "</td></tr>\n";
  500.    }
  501.    if (&ChkLocalClient ()) {
  502.       print "<tr>\n";
  503.       print "<td><INPUT TYPE=radio NAME=addrtype VALUE=group>";
  504.       if ($ini{'language'} eq "german") {
  505.          print " Gruppe\n";
  506.       } else {
  507.          print " group\n";
  508.       }
  509.       print "</td><td>\n";
  510.       print "<INPUT TYPE=text NAME=group VALUE=\"".$ini{'path'}."\" SIZE=30>\n";
  511.       print "<script language=\"Javascript\" type=\"text/javascript\">\n<!--\n";
  512.       print "FileChooser(\"group\");\n";
  513.       print "//-->\n</script>\n";
  514.       print "</td></tr>\n";
  515.    }
  516.    print "</table>\n";
  517.    print "<P>\n";
  518.    if ($ini{'language'} eq "german") {
  519.       print "<B>Nachricht:</B><BR>\n";
  520.    } else {
  521.       print "<B>Message:</B><BR>\n";
  522.    }
  523.    print "<table border=1 width=\"100%\">\n";
  524.    print "<tr>\n";
  525.    if (&ChkLocalClient ()) {
  526.       print "<td><INPUT TYPE=radio CHECKED NAME=msgType VALUE=text>";
  527.       if ($ini{'language'} eq "german") {
  528.          print " Text\n";
  529.       } else {
  530.          print " text\n";
  531.       }
  532.       print "</td>\n";
  533.    }
  534.    print "<td>\n";
  535.    print "<TEXTAREA NAME=sms ROWS=3 COLS=60></TEXTAREA>\n";
  536.    print "</td></tr>\n";
  537.    if (&ChkLocalClient ()) {
  538.       print "<tr><td>\n";
  539.       print "<INPUT TYPE=radio NAME=msgType VALUE=file>";
  540.       if ($ini{'language'} eq "german") {
  541.          print " Datei\n";
  542.       } else {
  543.          print " file\n";
  544.       }
  545.       print "</td><td>\n";
  546.       print "<INPUT TYPE=text NAME=file VALUE=\"\" SIZE=60>\n";
  547.       print "<script language=\"Javascript\" type=\"text/javascript\">\n<!--\n";
  548.       print "FileChooser(\"file\");\n";
  549.       print "//-->\n</script>\n";
  550.       print "<SELECT NAME=charset SIZE=1>\n";
  551.       print "<OPTION SELECTED VALUE=\"(auto)\">(auto)</OPTION>\n";
  552.       print "<OPTION VALUE=iso8859>ISO 8859-1</OPTION>\n";
  553.       print "<OPTION VALUE=cp850>CP850</OPTION>\n";
  554.       print "</select>\n";
  555.       print "</td></tr>\n";
  556.    }
  557.    print "</table>\n";
  558.    print "<P>\n";
  559.    if ($ini{'language'} eq "german") {
  560.       print "<B>Optionen:</B> (fⁿr Experten)<BR>\n";
  561.    } else {
  562.       print "<B>Options: (for experts)</B><BR>\n";
  563.    }
  564.    print "<table width=\"100%\">\n";
  565.    print "<tr><td>\n";
  566.    print "<INPUT TYPE=checkbox NAME=verbose VALUE=1>verbose -- ";
  567.    print "<SELECT NAME=spool SIZE=1>\n";
  568.    print "<OPTION SELECTED VALUE=\"(auto)\">(auto)</OPTION>\n";
  569.    if ($ini{'language'} eq "german") {
  570.       print "<OPTION VALUE=send>senden</OPTION>\n";
  571.       print "<OPTION VALUE=spool>spoolen</OPTION>\n";
  572.    } else {
  573.       print "<OPTION VALUE=send>send</OPTION>\n";
  574.       print "<OPTION VALUE=spool>spool</OPTION>\n";
  575.    }
  576.    print "</select>\n";
  577.    if (@device > 1) {
  578.       print " -- <SELECT NAME=device SIZE=1>\n";
  579.       print "<OPTION SELECTED>(auto)</OPTION>\n";
  580.       for ($i = 0; $i < @device; $i++) {
  581.          print "<OPTION>".$device[$i]."</OPTION>\n";
  582.       }
  583.       if ($ini{'language'} eq "german") {
  584.          print "</SELECT> Device\n";
  585.       } else {
  586.          print "</SELECT> device\n";
  587.       }
  588.    }
  589.    print "</td><td align=right>\n";
  590.    if ($ini{'language'} eq "german") {
  591.       print "<INPUT TYPE=submit VALUE=\"Ausfⁿhren\">\n";
  592.       print "<INPUT TYPE=reset VALUE=\"L÷schen\">\n";
  593.    } else {
  594.       print "<INPUT TYPE=submit VALUE=\"Execute\">\n";
  595.       print "<INPUT TYPE=reset VALUE=\"Reset\">\n";
  596.    }
  597.    print "</td></tr>\n";
  598.    print "</table>\n";
  599.    print "</FORM>\n";
  600.    print "<script language=\"Javascript\" type=\"text/javascript\">\n<!--\n";
  601.    print "if (document.SendSMS.addrtype[0].checked == true)\n";
  602.    print "   document.SendSMS.phone.focus();\n";
  603.    print "if (document.SendSMS.addrtype[1].checked == true)\n";
  604.    print "   document.SendSMS.phonebook.focus();\n";
  605.    print "if (document.SendSMS.addrtype[2].checked == true)\n";
  606.    print "   document.SendSMS.group.focus();\n";
  607.    print "//-->\n</script>\n";
  608. }
  609. &PrintFooter ();
  610.