} else { $remember = false; } ($code = $plugins->load('log_login2')) ? eval($code) : null; $log_status = $slog->sid_login($remember); if (!$log_status) { error($lang->phrase('log_wrong_data'), "log.php?action=login&redirect=" . urlencode($loc) . SID2URL_x); } else { ok($lang->phrase('log_msglogin'), $loc); } } elseif ($_GET['action'] == "logout") { if (!$my->vlogin) { viscacha_header('Location: log.php'); } else { $loc = strip_tags($gpc->get('redirect', none, 'index.php' . SID2URL_1)); $file = basefilename($loc); if ($file == 'log.php') { $loc = 'index.php' . SID2URL_1; } ($code = $plugins->load('log_logout')) ? eval($code) : null; $slog->sid_logout(); ok($lang->phrase('log_msglogout'), $loc); } } elseif ($_GET['action'] == "pwremind") { if ($my->vlogin) { error($lang->phrase('log_already_logged')); } $breadcrumb->Add($lang->phrase('log_pwremind_title')); echo $tpl->parse("header"); echo $tpl->parse("menu"); ($code = $plugins->load('log_pwremind_form_start')) ? eval($code) : null;
} @fclose($in); @fclose($out); } else { die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}'); } } // Check if file has been uploaded if (!$chunks || $chunk == $chunks - 1) { // Strip the temp .part suffix off rename("{$filePath}.part", $filePath); $fileNameParts = explode(".", $fileName); $creatableFiletypes = getCreatableFormats(); $iconImage = $targetDir . "icon_" . basefilename($fileName) . ".jpg"; $thumbImage = $targetDir . "thumb_" . basefilename($fileName) . ".jpg"; $sampleImage = $targetDir . "sample_" . basefilename($fileName) . ".jpg"; $filenameExt = strtolower(array_pop($fileNameParts)); # CALCULATE THE MEMORY NEEDED ONLY IF IT IS A CREATABLE FORMAT if (in_array(strtolower($filenameExt), $creatableFiletypes)) { # FIGURE MEMORY NEEDED $mem_needed = figure_memory_needed($targetDir . $fileName); if (ini_get("memory_limit")) { $memory_limit = ini_get("memory_limit"); } else { $memory_limit = $config['DefaultMemory']; } # IF IMAGEMAGICK ALLOW TWEAKED MEMORY LIMIT if (class_exists('Imagick') and $config['settings']['imageproc'] == 2) { $memory_limit = $config['DefaultMemory']; } $autoCreateAvailable = 1;
//$mediaImage->setHCrop($hcrop); $mediaImage->setSize($width); $mediaImage->setWidth($width); $mediaImage->setHeight($height); //$mediaImage->setSharpen($sharpen); $mediaImage->setWatermark($digital['watermark']); $mediaImage->createImage(0, $tmpFilenamePath); } catch (Exception $e) { die(exceptionError($e)); } //$file = "./assets/tmp/{$tmpFilename}"; $ctype = "application/txt"; if (!file_exists($tmpFilenamePath)) { die("Error 3: This file cannot be found on the server."); } $downloadFilename = basefilename($mediaInfo['ofilename']) . ".jpg"; header("Content-Type: {$ctype}"); header("Content-Disposition: attachment; filename=\"" . $downloadFilename . "\""); header("Content-Transfer-Encoding: binary"); header("Content-Length: " . @filesize($tmpFilenamePath)); if (function_exists('set_time_limit')) { set_time_limit(0); } //@readfile($tmpFilenamePath) or die("File not found."); ob_end_clean(); @readfileChunked($tmpFilenamePath); // or die("File not found."); unlink($tmpFilenamePath); // Delete the temp file after it has been downloaded } } else {
$approvalStatus = $_SESSION['member']['membershipDetails']['approval'] ? 1 : 0; // Check the approval status if ($approvalStatus == 0) { @mysqli_query($db, "UPDATE {$dbinfo[pre]}media SET approval_status='0' WHERE media_id = '{$mediaID}'"); } // Update the approval_status in the db $media = new mediaTools($mediaID); $mediaInfo = $media->getMediaInfoFromDB(); $folderInfo = $media->getFolderStorageInfoFromDB($mediaInfo['folder_id']); if ($folderInfo['encrypted']) { $folderName = $folderInfo['enc_name']; } else { $folderName = $folderInfo['name']; } $folderPath = "{$config[settings][library_path]}/{$folderName}/samples/"; $newFilename = basefilename($mediaInfo['filename']); if ($vidSampleInfo = $media->getVidSampleInfoFromDB()) { @unlink($folderPath . $vidSampleInfo['vidsample_filename']); } // It already exists - delete the old one first $temp_filename = strtolower($_FILES['Filedata']['name']); $temp_array = explode(".", $temp_filename); $video_extension = $temp_array[count($temp_array) - 1]; $video_filename = "video_" . $newFilename . "." . $video_extension; move_uploaded_file($_FILES['Filedata']['tmp_name'], $folderPath . $video_filename); if ($vidSampleInfo) { # UPDATE THE DATABASE $sql = "UPDATE {$dbinfo[pre]}media_vidsamples SET \r\n\t\t\t\t\t\t\t\tmedia_id='{$mediaID}',\r\n\t\t\t\t\t\t\t\tvidsampletype='sample',\r\n\t\t\t\t\t\t\t\tvidsample_filename='{$video_filename}',\r\n\t\t\t\t\t\t\t\tvidsample_width='0',\r\n\t\t\t\t\t\t\t\tvidsample_height='0',\r\n\t\t\t\t\t\t\t\tvidsample_filesize='{}',\r\n\t\t\t\t\t\t\t\tvidsample_extension='{$video_extension}'\r\n\t\t\t\t\t\t\t\tWHERE media_id = '{$mediaID}'\r\n\t\t\t\t\t\t\t\tAND vidsampletype = 'sample'"; $result = mysqli_query($db, $sql); } else { # INSERT ICON INFO INTO THE DATABASE