Esempio n. 1
0
     }
     if (($_POST['imageclass'][$key] == 'Other' || empty($_POST['imageclass'][$key])) && !empty($_POST['imageclassother'][$key])) {
         $imageclass = stripslashes($_POST['imageclassother'][$key]);
     } else {
         if ($_POST['imageclass'] != 'Other') {
             $imageclass = stripslashes($_POST['imageclass'][$key]);
         }
     }
     $uploadmanager->setClass($imageclass);
     if ($_POST['pattrib'] == 'other') {
         $uploadmanager->setCredit(stripslashes($_POST['pattrib_name']));
         $smarty->assign('credit_realname', $_POST['pattrib_name']);
     } elseif ($_POST['pattrib'] == 'self') {
         $uploadmanager->setCredit('');
     }
     $ok = $uploadmanager->setUploadId($_POST['upload_id'][$key]);
     if ($ok) {
         $err = $uploadmanager->commit(isset($_GET['nofrills']) ? 'nofrills' : 'submit2');
         if (empty($err)) {
             $status[$key] = "ok:" . $uploadmanager->gridimage_id;
         } else {
             $status[$key] = $err;
         }
     } else {
         $status[$key] = $uploadmanager->errormsg;
     }
 } else {
     $status[$key] = "Subject Grid Reference: " . $square->errormsg;
 }
 if ($_POST['imagetaken'][$key] != '0000-00-00') {
     $_SESSION['last_imagetaken'] = $_POST['imagetaken'][$key];
Esempio n. 2
0
         $smarty->assign('title', stripslashes($_POST['title']));
         $smarty->assign('title2', stripslashes($_POST['title2']));
         $smarty->assign('comment', stripslashes($_POST['comment']));
         $smarty->assign('comment2', stripslashes($_POST['comment2']));
         $smarty->assign('imagetaken', stripslashes($_POST['imagetaken']));
         $smarty->assign('imageclass', stripslashes($_POST['imageclass']));
         $smarty->assign('user_status', stripslashes($_POST['user_status']));
     }
     $step = 2;
 } elseif (isset($_POST['goback'])) {
     $step = 1;
 } elseif (isset($_POST['transfer_id'])) {
     //preserve the upload id
     if ($uploadmanager->validUploadId($_POST['transfer_id'])) {
         $smarty->assign('upload_id', $_POST['transfer_id']);
         $uploadmanager->setUploadId($_POST['transfer_id']);
         $uploadmanager->reReadExifFile();
         //we ok to continue
         if (isset($_POST['photographer_gridref'])) {
             $step = 3;
         } else {
             $step = 2;
         }
     } else {
         $step = 1;
     }
 } elseif (isset($_POST['jpeg_url'])) {
     //Submit Step 2..
     $step = 2;
     if ($uploadmanager->processURL($_POST['jpeg_url'])) {
         $smarty->assign('upload_id', $uploadmanager->upload_id);
Esempio n. 3
0
$cacheid = '';
$image = new GridImage();
if (isset($_REQUEST['id'])) {
    $image->loadFromId($_REQUEST['id']);
    $isowner = $image->user_id == $USER->user_id ? 1 : 0;
    $isadmin = $USER->hasPerm('ticketmod') ? 1 : 0;
    if ($image->isValid()) {
        if ($isowner || $isadmin) {
            //ok, we'll let it lie...
        } else {
            header("Location: /photo/{$_REQUEST['id']}");
            exit;
        }
        $smarty->assign_by_ref('image', $image);
        if (isset($_POST['finalise'])) {
            if ($uploadmanager->setUploadId($_POST['upload_id'])) {
                $uploadmanager->setLargestSize($_POST['largestsize']);
                $uploadmanager->setClearExif($_POST['clearexif']);
                $uploadmanager->addOriginal($image);
                $smarty->assign('step', 4);
            } else {
                $smarty->assign('step', -1);
            }
        } elseif (isset($_POST['abandon'])) {
            if ($uploadmanager->setUploadId($_POST['upload_id'])) {
                $uploadmanager->cleanUp();
            }
            $smarty->assign('step', -1);
        } elseif (isset($_POST['next'])) {
            if (!filesize($_FILES['jpeg']['tmp_name'])) {
                $smarty->assign('error', 'Sorry, no file was received - please try again');