Ejemplo n.º 1
0
$importImage = array_key_exists("importimage", $_REQUEST) ? $_REQUEST['importimage'] : false;
$action = array_key_exists("action", $_REQUEST) ? preg_replace("/[^a-z]/", "", $_REQUEST['action']) : '';
if (!$securityKey) {
    exit("ERROR: security key is required and is null ");
}
if (!$uploadType) {
    exit("ERROR: uploadtype is required and is null ");
}
$duManager;
$FILEUPLOAD = 3;
$DWCAUPLOAD = 6;
if ($uploadType == $FILEUPLOAD) {
    $duManager = new SpecUploadFile();
    //if($filePath) ;
} elseif ($uploadType == $DWCAUPLOAD) {
    $duManager = new SpecUploadDwca();
    $duManager->setIncludeIdentificationHistory($importIdent);
    $duManager->setIncludeImages($importImage);
    if ($filePath) {
        $duManager->setPath($filePath);
    }
} else {
    exit('ERROR: illegal upload type = ' . $uploadType . ' (should be 3 = File Upload, 6 = DWCA upload)');
}
if (!$duManager->validateSecurityKey($securityKey)) {
    exit('ERROR: security key validation failed!');
}
$duManager->setVerboseMode(2);
$duManager->loadFieldMap(true);
$ulPath = $duManager->uploadFile();
if (!$ulPath) {
Ejemplo n.º 2
0
<?php

include_once '../../config/symbini.php';
require_once $SERVER_ROOT . '/classes/SpecUploadBase.php';
require_once $SERVER_ROOT . '/classes/SpecUploadDwca.php';
$uspid = array_key_exists("uspid", $_REQUEST) ? $_REQUEST["uspid"] : 0;
$importIdent = true;
$importImage = true;
//Sanitation
if (!$uspid || !preg_match('/^[0-9,]+$/', $uspid)) {
    exit('ERROR: illegal upload profile identifier ');
}
$duManager = new SpecUploadDwca();
$duManager->setVerboseMode(2, 'batchDwcaUpload');
$duManager->setIncludeIdentificationHistory($importIdent);
$duManager->setIncludeImages($importImage);
$uspidArr = explode(',', $uspid);
foreach ($uspidArr as $uploadId) {
    //Initiate parameters
    $duManager->setUspid($uploadId);
    $duManager->readUploadParameters();
    $duManager->setSourceDatabaseType('batchDwcaUpload');
    if ($duManager->getTitle() == '') {
        exit('ERROR: unable to set upload profile data (uspid: ' . $uploadId . ')');
    }
    if ($duManager->getCollInfo('managementtype') != 'Snapshot') {
        exit('ERROR: automatic updates only allowed for Snapshot collections');
    }
    $duManager->loadFieldMap(true);
    $ulPath = $duManager->uploadFile();
    if (!$ulPath) {
Ejemplo n.º 3
0
$duManager = new SpecUploadBase();
if ($uploadType == $DIRECTUPLOAD) {
    $duManager = new SpecUploadDirect();
} elseif ($uploadType == $DIGIRUPLOAD) {
    $duManager = new SpecUploadDigir();
    $duManager->setSearchStart($recStart);
    $duManager->setSearchLimit($recLimit);
} elseif ($uploadType == $FILEUPLOAD) {
    $duManager = new SpecUploadFile();
    $duManager->setUploadFileName($ulPath);
} elseif ($uploadType == $SKELETAL) {
    $duManager = new SpecUploadFile();
    $duManager->setUploadFileName($ulPath);
    $matchCatNum = true;
} elseif ($uploadType == $DWCAUPLOAD) {
    $duManager = new SpecUploadDwca();
    $duManager->setBaseFolderName($ulPath);
    $duManager->setIncludeIdentificationHistory($importIdent);
    $duManager->setIncludeImages($importImage);
}
$duManager->setCollId($collid);
$duManager->setUspid($uspid);
$duManager->setUploadType($uploadType);
$duManager->setMatchCatalogNumber($matchCatNum);
$duManager->setMatchOtherCatalogNumbers($matchOtherCatNum);
if ($action == 'Automap Fields') {
    $autoMap = true;
}
$statusStr = '';
$isEditor = 0;
if ($IS_ADMIN || array_key_exists("CollAdmin", $USER_RIGHTS) && in_array($collid, $USER_RIGHTS["CollAdmin"])) {