Skip to content
Permalink
Browse files Browse the repository at this point in the history
- files: removed unused code related to "picnik" upload
  • Loading branch information
NavigateCMS committed Sep 22, 2018
1 parent 2bc707c commit 2bdcb8b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 68 deletions.
44 changes: 0 additions & 44 deletions lib/packages/files/files.php
Expand Up @@ -333,50 +333,6 @@ function run()

core_terminate();
break;
/*
case 91: // picnik editing
ob_clean();
// $strPicnikUrl is the URL that we use to launch Picnik.
$strPicnikUrl = "http://www.picnik.com/service";
// $aPicnikParams collects together all the params we'll give Picnik. Start with an API key
$aPicnikParams['_apikey'] = $website->picnik_api_key;
// tell Picnik where to send the exported image
$aPicnikParams['_export'] = NAVIGATE_URL.'/navigate_upload.php?wid='.$website->id.'&engine=picnik&id='.$_REQUEST['id'].'&engine=picnik&session_id='.session_id();
// give the export button a title
$aPicnikParams['_export_title'] = t(34, 'Save');
// turn on the close button, and tell it to come back here
//$aPicnikParams['_close_target'] = $strRoot;
// send in the previous "king" image in case the user feels like decorating it
$aPicnikParams['_import'] = NAVIGATE_DOWNLOAD.'?wid='.$website->id.'&id='.$_REQUEST['id'].'&disposition=attachment&sid='.session_id();
// tell Picnik to redirect the user to the following URL after the HTTP POST instead of just redirecting to _export
$aPicnikParams['_redirect'] = NAVIGATE_DOWNLOAD.'?wid='.$website->id.'&id='.$_REQUEST['id'].'&disposition=inline&ts='.core_time(); //'javascript: return false;';
// tell Picnik our name. It'll use it in a few places as appropriate
$aPicnikParams['_host_name'] = 'Navigate';
// turn off the "Save & Share" tab so users don't get confused
$aPicnikParams['_exclude'] = "out";
echo '<html><head></head><body>';
echo '<form id="picnik_form" method="POST" action="'.$strPicnikUrl.'" style=" visibility: hidden; ">';
// put all the API parameters into the form as hidden inputs
foreach( $aPicnikParams as $key => $value ) {
echo "<input type='hidden' name='$key' value='$value'/>\n";
}
//echo "<input type='text' name='address' value='Your Majesty'/>\n";
echo "<input type='submit' value='Picnik'/>\n";
echo "</form>";
echo '<script language="javascript" type="text/javascript">
document.forms[0].submit();
</script>';
echo '</body></html>';
core_terminate();
break;
*/

case 0: // list / search result
default:
Expand Down
25 changes: 1 addition & 24 deletions navigate_upload.php
Expand Up @@ -83,11 +83,9 @@ function navigate_upload_remove_temporary($targetDir, $maxFileAge=86400)
$targetDir = NAVIGATE_PRIVATE.'/'.$website->id.'/files';
$maxFileAge = 24 * 60 * 60; // Temp file age in seconds (1 day)

// no maximum uploading / execution time
// no maximum uploading/execution time
@set_time_limit(0);

//file_put_contents(NAVIGATE_PRIVATE.'/'.$website->id.'/files/out.txt', print_r($_FILES, true));

// filedrop drag'n'drop engine
if($_REQUEST['engine']=='dropzone')
{
Expand Down Expand Up @@ -136,27 +134,6 @@ function navigate_upload_remove_temporary($targetDir, $maxFileAge=86400)
}
}
}
else if($_REQUEST['engine']=='picnik')
{
// PHP script to receive image data from Picnik via HTTP POST
// retrieve the image's attributes from the $_FILES array
$image_tmp_filename = $_FILES['file']['tmp_name'];
$image_filename = $_FILES['file']['name'];

// Save the image to disk. It'll go into the same directory as
// this script. You'd probably want to put it somewhere else in the
// file system like a "/images" directory, or maybe even into a database.
// Make sure your web server has write access to the destination dir,
// or the call to file_put_contents isn't going to work.
$image_data = file_get_contents( $image_tmp_filename );

if(!empty($_REQUEST['id']) && file_exists($targetDir.'/'.$_REQUEST['id']))
{
file_put_contents( $targetDir.'/'.$_REQUEST['id'], $image_data );
}

core_terminate();
}
else if($_REQUEST['engine']=='pixlr')
{
if(!empty($_REQUEST['id']) && file_exists($targetDir.'/'.$_REQUEST['id']))
Expand Down

0 comments on commit 2bdcb8b

Please sign in to comment.