Logo Search packages:      
Sourcecode: dacode version File versions  Download package

submit.php3

<?php
/* daCode _ http://www.dacode.org
 * $Id: submit.php3,v 1.18.2.7 2002/10/12 17:32:29 ruffy Exp $
 */

      $topdir = '..';
      require $topdir.'/dacode.php3';

      $html = LoadClass('Html');
      $user = LoadClass('User');
      $session = LoadClass('Session');

      if (!ereg('^'.$config->baseurl,$HTTP_SERVER_VARS['HTTP_REFERER'])
            && !($session->param & pow(2,3))) {
            $title = lecho("HTTP referer");
            $nobanner = false;
            $utils = LoadClass('Utils');
            $text = $utils->warn_referer();
            $html->parsetemplate('basic.tmpl');
            exit;
      }

      if ($user->checked != 1) {
            echo lecho("Must be logged...")."<br />\n";
            echo $html->footer();
            exit;
      }

      $webcam = LoadClass('Webcam');

      if (!isset ($HTTP_POST_VARS['submit'])) {
            $title = lecho("Submit a picture");
            $text = $webcam->formNewImage();
            $nobanner = false;
            $html->parseTemplate('basic.tmpl');
      } else {
            $row['comment'] = isset ($HTTP_POST_VARS['comment'])?
                  $HTTP_POST_VARS['comment']:'';
            if (!isset($HTTP_POST_FILE['image']) && isset ($image) && !empty ($image)) {
                  $row['image'] = $image;
                  $row['image_type'] = $image_type;
                  $row['image_size'] = $image_size;
                  $row['image_name'] = $image_name;
            } elseif (isset ($HTTP_POST_FILE['image']) 
                  && !empty ($HTTP_POST_FILE['image'])) {
                  $row['image'] = $HTTP_POST_FILE['image'];
                  $row['image_type'] = $HTTP_POST_FILE['image_type'];
                  $row['image_size'] = $HTTP_POST_FILE['image_size'];
                  $row['image_name'] = $HTTP_POST_FILE['image_name'];
            } else {
                  echo lecho("You must propose a file...");
                  echo $html->footer();
            }
            $webcam->addNewImage($row);
      }


?>

Generated by  Doxygen 1.6.0   Back to index