function Action($bookid, $chapterid) { global $basedir; global $task_count; $task_count++; print_r("Action[{$task_count}]: {$bookid}, {$chapterid}\n"); $audio = Download($bookid, $chapterid); if (0 == strlen($audio)) { print_r("Download({$bookid}, {$chapterid}) failed.\n"); return -1; } // write file $dir = "{$basedir}{$bookid}"; if (!is_dir($dir)) { mkdir($dir, 0777, true); } $mb = 200 * 1024 * 1024; // 200MB if (disk_free_space($dir) < $mb) { print_r("disk full({$mb})\n"); die; } $filename = sprintf("{$dir}/%d.mp3", $chapterid); file_put_contents($filename, $audio); return 0; }
function Action($siteid, $bookid, $chapterid) { global $basedir; global $task_count; $task_count++; print_r("Action[{$task_count}]: {$bookid}, {$chapterid}\n"); $images = Download($siteid, $bookid, $chapterid); if (False === $images) { print_r("Download({$bookid}, {$chapterid}) failed.\n"); return -1; } // write file $dir = "{$basedir}{$bookid}/{$chapterid}"; if (!is_dir($dir)) { mkdir($dir, 0777, true); } $mb = 200 * 1024 * 1024; // 200MB if (disk_free_space($dir) < $mb) { print_r("disk full({$mb})\n"); die; } $i = 0; foreach ($images as $image) { $filename = sprintf("{$dir}/%d.jpg", ++$i); file_put_contents($filename, $image); } sleep(10); return 0; }
function InstalledTest() { if (isset($_GET['forcereinstall'])) { Download(); return; } if (file_exists("index.php") && file_exists("System/Template.class.php")) { die("<p align=\"left\" style=\"color:#FF0000; font-weight: bold; font-size:18px; padding-left: 100px;\">Hey, Ferrarezi Web seems to be already installed on this domain.<br />Shoul I <u>REINSTALL</u> it all?<br />Warning: this will overwrite ALL your data, so backup your Configs and Templates before!<br /><br /><a href=\"?forcereinstall\">YES, REINSTALL IT!</a><br /><br /><a href=\"?step=1\">Let's just proceed to configs!</a></p>"); } else { Download(); return; } }
function Action($ip) { global $db; $sql = sprintf("select bookid, chapterid, uri from pingshu8"); $res = $db->query($sql); if (!$res) { print_r("Action failed: " . $db->error); return -1; } $chapters = array(); while ($row = $res->fetch_assoc()) { $bookid = $row["bookid"]; $chapterid = $row["chapterid"]; $uri = $row["uri"]; if (strlen($uri) > 0) { Download($ip, $bookid, $chapterid, $uri); } } $res->free(); return $chapters; }
} if (!function_exists('mime_content_type')) { function mime_content_type($f) { $f = escapeshellarg($f); return trim( `file -bi $f` ); } } if($Path != "") { if(isset($_GET["Zip"]) && $_GET["Zip"] == 1 && $NeedZip) die(ZipDir($lsdir)); if(isset($_GET["Info"]) && $_GET["Info"] == 1) die(FileInfo($Path)); if(isset($_GET["Img"]) && $_GET["Img"] == 1) die(CreateThumbnail($Path)); if(isset($_GET["DownLoad"]) && $_GET["DownLoad"] == 1) die(Download($Path)); } if(isset($_GET['Delete'])) { $file = base64_decode($_GET['Delete']); if(isset($_GET['Confirm']) && $_GET['Confirm']) { unlink($ExploreDir.'/'.$file); die(header('Location: ./?Path='.base64_encode($Path))); } else { die('<a href="?Path='.base64_encode($Path).'&Delete='.$_GET['Delete'].'&Confirm=1">Delete file <b>'.$file.'</b>?</a>'); } }
} $temp_polja .= ")"; $temp_podaci .= ");"; $export .= "REPLACE INTO " . $tabela . " " . $temp_polja . " VALUES " . $temp_podaci . "\n"; } } $DB->close(); $file_url = "backup/" . $filename; $pFile = fopen($file_url, "w"); fwrite($pFile, $export); fclose($pFile); Download($file_url); } else { $filename = $_REQUEST['file'] . ".sql"; $file_url = "backup/" . $filename; Download($file_url); } } function Download($file_url) { global $filename; header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D,d M YH:i:s") . " GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); header("Content-type: aplication/txt"); header("Content-Disposition: attachment; filename=\"{$filename}\""); header("Content-Description: PHP/INTERBASE Generated Data"); readfile($file_url); exit; }
<?php /** * @copyright 2001-2015 Kayako * @license https://www.freebsd.org/copyright/freebsd-license.html * @link https://github.com/kayako/whmcs-integration */ //Include config file require_once __DIR__ . '/config.php'; //Include all necessary classes and helper methods require_once 'API/kyIncludes.php'; //Include common functions require_once 'functions.php'; //Initialize the client kyConfig::set(new kyConfig(API_URL, API_KEY, SECRET_KEY)); $_ticketObject = kyTicket::get($_GET['tid']); $_customField = $_ticketObject->getCustomField($_GET['field']); $_customFieldValue = $_customField->getValue(); Download($_customFieldValue[0], $_customFieldValue[1]);
ob_end_clean(); } header('Expires: 0'); header('Pragma: public'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Content-Type: application/octet-stream'); header('Content-Length: ' . filesize($path)); header('Content-Disposition: attachment; filename="' . basename($path) . '"'); header('Content-Transfer-Encoding: binary'); while (feof($file) !== true) { echo fread($file, $speed); while (ob_get_level() > 0) { ob_end_flush(); } flush(); sleep(1); } fclose($file); } exit; } return false; } $file_to_download = "{$directory}/" . $_GET['file']; if (file_exists($file_to_download) && $files[$file_to_download]) { incrementData("stats/" . $_GET['file']); Download($file_to_download); } else { echo "Error, file not found!"; } }
require_once 'API/kyHelpers.php'; //Include common functions require_once 'functions.php'; require_once 'constants.php'; //Initialize the client kyConfig::set(new kyConfig(API_URL, API_KEY, SECRET_KEY)); $_categoryController = '/Knowledgebase/Category'; $_articalController = '/Knowledgebase/Article'; $_commentController = '/Knowledgebase/Comment'; $_attachmentController = '/Knowledgebase/Attachment'; $_restClient = kyConfig::get()->getRESTClient(); if (isset($_GET['aid'])) { $_searchParameters = ['Get', $_GET['articleid'], $_GET['aid']]; $_attachmentContainer = $_restClient->get($_attachmentController, $_searchParameters); $_attachment = $_attachmentContainer['kbattachment'][0]; Download($_attachment['filename'], base64_decode($_attachment['contents'])); } else { if (isset($_GET['articleid'])) { if ($_GET['action'] == 'savecomment') { $_itemIDKey = 'knowledgebasearticleid'; $_itemID = $_GET['articleid']; $_rootCommentElement = 'kbarticlecomment'; include 'savecomment.php'; } include 'knowledgebasearticle.php'; } else { include 'knowledgebasecategories.php'; } } $smarty->assign('_settings', $_settings); $smarty->assign('_baseURL', WHMCS_URL);
$per = $row['permission']; if (strcmp($per, 'private') == 0) { if ($uid == $oid) { Download($mid, $uid, $ip, $type); echo "<meta http-equiv=\"refresh\" content=\"0;url={$url}\">"; } elseif ($uid != $oid) { $q = mysql_query("SELECT * FROM `Media` natural join `FriendList` WHERE `mid`='{$mid}' and `uid_friend`='{$uid}' and `uid`='{$oid}' and `status`='1'") or die(mysql_error()); $row = mysql_fetch_assoc($q); $check = $row['mid']; if (!is_null($check)) { Download($mid, $uid, $ip, $type); echo "<meta http-equiv=\"refresh\" content=\"0;url={$url}\">"; } else { echo "<meta http-equiv=\"refresh\" content=\"0;url=Private.php\">"; } } else { echo "<meta http-equiv=\"refresh\" content=\"0;url=Private.php\">"; } } else { Download($mid, $uid, $ip, $type); echo "<meta http-equiv=\"refresh\" content=\"0;url={$url}\">"; } } } else { echo "<div class='sform'>"; echo "<p>Sorry only registered users can download!</p>"; echo "<a id=\"signup\" href=\"SignUp.php\" target=\"_self\">Sign Up Now :)</a><br/>"; echo "</div>"; } ?>
AddOption($options, 'download', 'true|false', 'false', false); AddOption($options, 'overwrite', 'true|false', 'true', false); AddOption($options, 'minimal', 'true|false', 'false', false); AddOption($options, 'minimal+', 'true|false', 'false', false); AddOption($options, CONF_FILE_PATH, null, '/bio2rdf-scripts/common/bio2rdf_conf.rdf', false); AddOption($options, USE_CONF_FILE, 'true|false', 'false', false); if (SetCMDlineOptions($argv, $options) == FALSE) { PrintCMDlineOptions($argv, $options); exit; } $include_list = explode(",", $options['files']['value']); $exclude_list = explode(",", $options['exclude']['value']); @mkdir($options['indir']['value'], 0777, true); @mkdir($options['outdir']['value'], 0777, true); if ($options['download']['value'] == 'true') { $files = Download($options['indir']['value'], $include_list, $exclude_list); } // files specified if ($options['files']['value'] != 'all') { foreach ($include_list as $f) { if (file_exists($options['indir']['value'] . $f . ".obo")) { $files[] = $f . ".obo"; } } } else { $files = GetDirFiles($options['indir']['value'], ".obo"); } global $gns; $lns = $gns; // generate the RDF if (isset($files)) {
function GetExtensionMapping() { $MySQL_Result = DB_Query("SELECT Data, Updated FROM cache WHERE Field='ExtensionMapping'"); $Data = mysql_fetch_assoc($MySQL_Result); if ($Data && $Data['Updated'] >= time() - 86400) { // Uses the cache table if available and results are less than one day old... return unserialize($Data['Data']); } else { $URL = "http://www.opengl.org/registry/"; $Page = Download($URL); foreach (explode("\n", $Page) as $Line) { if (strstr($Line, "\">GL")) { $Line = substr(strstr($Line, "<a href=\""), 9); $Return[str_replace(array("&"), array("&"), substr($Line, strpos($Line, "\">") + 2, -4))] = $URL . substr($Line, 0, strpos($Line, "\">")); } } DB_Query("REPLACE INTO cache SET Field='ExtensionMapping', Data='" . mysql_escape_string(serialize($Return)) . "', Updated='" . time() . "'"); return $Return; } }
$_ticketPriorityObjectContainer = kyTicketPriority::getAll()->filterByType(kyDepartment::TYPE_PUBLIC); $_ticketPriorityContainer = []; foreach ($_ticketPriorityObjectContainer as $_ticketPriorityObject) { $_ticketPriority['priorityid'] = $_ticketPriorityObject->getId(); $_ticketPriority['title'] = $_ticketPriorityObject->getTitle(); $_ticketPriority['displayorder'] = $_ticketPriorityObject->getDisplayOrder(); $_ticketPriority['type'] = $_ticketPriorityObject->getType(); $_ticketPriority['frcolorcode'] = $_ticketPriorityObject->getForegroundColor(); $_ticketPriority['bgcolorcode'] = $_ticketPriorityObject->getBackgroundColor(); $_ticketPriority['displayicon'] = $_ticketPriorityObject->getDisplayIcon(); $_ticketPriority['uservisibilitycustom'] = $_ticketPriorityObject->getUserVisibilityCustom(); $_ticketPriorityContainer[$_ticketPriorityObject->getId()] = $_ticketPriority; } if (isset($_GET['aid'])) { $_ticketAttachment = kyTicketAttachment::get($_GET['tid'], $_GET['aid']); Download($_ticketAttachment->getFileName(), $_ticketAttachment->getContents()); } else { if ($_GET['action'] == 'reply') { $_user = kyUser::search($clientsdetails['email']); $_user = $_user[0]; $_ticketObject = kyTicket::get($_GET['ticketid']); $_ticketPost = kyTicketPost::createNew($_ticketObject, $_user, $_POST['replycontents'])->create(); //Save ticket post attachments foreach ($_FILES['ticketattachments']['tmp_name'] as $_key => $_ticketAttachment) { kyTicketAttachment::createNewFromFile($_ticketPost, $_ticketAttachment, $_FILES['ticketattachments']['name'][$_key])->create(); } header('Location: ' . WHMCS_URL . 'viewticket.php?ticketid=' . $_GET['ticketid']); } else { if ($_REQUEST['action'] == 'update') { require_once 'updateticket.php'; header('Location: ' . WHMCS_URL . 'viewticket.php?ticketid=' . $_GET['ticketid']);