"Fossies" - the Fresh Open Source Software Archive

Member "astrocam-2.7.6/astrocam.php" (26 May 2009, 3730 Bytes) of package /linux/www/old/astrocam-2.7.6.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "astrocam.php" see the Fossies "Dox" file reference documentation.

    1 <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
    2 
    3 <!--
    4                /* astrocam.php */
    5 
    6 /* This is the AstroCam Webinterface PHP Code written by
    7  * Steffen Wendzel <cdp_xe (at) gmx.net>
    8  *
    9  * Copyright 2001-2009 by Steffen Wendzel <cdp_xe (at) gmx.net>
   10  */
   11 -->
   12 
   13 <?php
   14     /* init the vars */
   15     $version="2.7.6";
   16     $a = $HTTP_GET_VARS['a'];
   17 
   18     $file=fopen("/etc/astrocam.conf", "r");
   19     if($file==FALSE) {
   20         printf("cannot open astrocam.conf!");
   21         exit(1);
   22     }
   23     while ($data = fscanf($file, "%s\t%s\n"))
   24     {
   25         list ($var, $value) = $data;        
   26         if(strcmp($var, "version")==0){
   27             if(strcmp($value, $version)!=0){
   28                 printf("wrong conf-version!");
   29                 exit(1);
   30             }
   31         /*}else if(strcmp($var, "maxdreh")==0){
   32             $maxdreh=$value;
   33         }else if(strcmp($var, "mindreh")==0){
   34             $mindreh=$value;
   35         }else if(strcmp($var, "maxvdreh")==0){
   36             $maxvdreh=$value;
   37         }else if(strcmp($var, "minvdreh")==0){
   38             $minvdreh=$value;*/
   39         }else if(strcmp($var, "picfile")==0){
   40             $picfile=$value;
   41         }else if(strcmp($var, "refreshtime")==0){
   42             $refreshtime=$value;
   43         }else if(strcmp($var, "design")==0){
   44             $design=$value;
   45         }else if(strcmp($var, "ipckey")==0){
   46             $ipckey=$value;
   47         }else if(strcmp($var, "imagesize-y")==0){
   48             $height=$value;
   49         }else if(strcmp($var, "imagesize-x")==0){
   50             $width=$value;
   51         }else if(strcmp($var, "contenturl")==0){
   52             $contenturl=$value;
   53         }
   54     }
   55     fclose($file);
   56 
   57     if(/*$maxdreh == "" || $mindreh == "" ||*/ $picfile == "" || $refreshtime == "" ||
   58        $ipckey == "" || $design == "" || $version == "" || $height == "" ||
   59        $width == "" || $contenturl == "") {
   60         printf("At least 1 needed variable is not present in astrocam.conf!");
   61         exit(1);
   62     }
   63 
   64     if(isset($a)) {
   65         if (!ereg('^[lLrRdu]$', $a)) {
   66             printf("unexpected character submitted. exiting.\n");
   67             exit(1);
   68         }
   69         if(isset($debug))
   70             printf("%s <b>|</b> ", $a);
   71 
   72         $mq=msg_get_queue($ipckey, 0);
   73         if(!msg_send($mq, 1, $a, true, true, $error)) {
   74             printf("Msg not send (error=$error)\n");
   75             printf("Are you sure that astrocam daemon is running?\n");
   76             exit(1);
   77         } else {
   78             if(isset($debug)) {
   79                 printf("message successfully send.");
   80             }
   81         }
   82     }
   83 ?>
   84 
   85 <!---
   86  ------------------- ------------------- ------------------- -------------------
   87             H T M L    S T U F F    S T A R T
   88  ------------------- ------------------- ------------------- -------------------
   89 -->
   90 
   91 <html>
   92 <head>
   93     <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
   94     <link rel="stylesheet" type="text/css" href="<? echo $contenturl.'/'.$design; ?>.css" title="prim">
   95     <title>AstroCam Webinterface</title>
   96 </head>
   97 <body>
   98 <table align="center">
   99 <tr>
  100     <td colspan="2">
  101         <img src="<?php echo $contenturl; ?>/spacer.gif" height="20px" width="1px" alt=".">
  102     </td>
  103 </tr>
  104 <tr>
  105     <td align="center" valign="top" class="menu">
  106         <img src="<?php echo $contenturl; ?>/spacer.gif" alt="." width="80px" height="1px"><br>
  107         <b>[<a href="?a=l">&lt;</a>]</b>
  108         <b>[<a href="?a=r">&gt;</a>]</b>
  109         <br>
  110         <b>[<a href="?a=L">&lt;&lt;</a>]</b>
  111         <b>[<a href="?a=R">&gt;&gt;</a>]</b>
  112         <p>
  113         <b>[<a href="?a=u">up</a>]</b><br>
  114         <b>[<a href="?a=d">down</a>]</b>        
  115     </td>
  116     <td align="center" valign="center" class="pic"
  117          width="<? echo $width; ?>" height="<? echo $height; ?>">
  118         <iframe border="0" width="<? echo $width; ?>" height="<? echo $height; ?>"
  119            src="pic.php?picfile=<? echo $picfile; ?>&refreshtime=<? echo $refreshtime; ?>"
  120            scrolling="no" marginwidth="0" marginheight="0">
  121         Your browser doesn't support iframes!
  122         </iframe>
  123     </td>
  124 </tr>
  125 <tr>
  126     <td align="right" colspan="2" class="menu">
  127         <div style="font-size:9pt">
  128             <b>astrocam webinterface</b>
  129             [<a href="http://www.wendzel.de/?sub=softw&ssub=acam">info</a>]
  130         </div>
  131     </td>
  132 </tr>
  133 </table>
  134 </body>
  135 </html>