本文整理汇总了PHP中sotf_Utils::getFileSafeParameter方法的典型用法代码示例。如果您正苦于以下问题:PHP sotf_Utils::getFileSafeParameter方法的具体用法?PHP sotf_Utils::getFileSafeParameter怎么用?PHP sotf_Utils::getFileSafeParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sotf_Utils
的用法示例。
在下文中一共展示了sotf_Utils::getFileSafeParameter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: raiseError
require "init.inc.php";
$smarty->assign("PAGETITLE", $page->getlocalized("EditorPage"));
$page->forceLogin();
$smarty->assign("OKURL", $_SERVER['PHP_SELF']);
if (!$user->isEditor()) {
raiseError("You have no permission to upload to any station");
exit;
}
if (sotf_Utils::getParameter('upload')) {
move_uploaded_file($_FILES['userfile']['tmp_name'], $user->getUserDir() . '/' . $_FILES['userfile']['name']);
$page->redirect($_SERVER['SCRIPT_NAME']);
exit;
}
if (sotf_Utils::getParameter('addprog')) {
$fname = sotf_Utils::getFileSafeParameter('fname');
$station = sotf_Utils::getFileSafeParameter('station');
if (!sotf_Permission::get('upload', $station)) {
raiseError("no permission to upload to {$station}");
exit;
}
$newPrg = sotf_Programme::create($station);
$newPrg->setAudio($fname);
//$page->redirect("editFiles.php");
$page->redirect($_SERVER['SCRIPT_NAME']);
exit;
}
$userFtpUrl = str_replace('ftp://', "ftp://{$userid}@", "{$userFTP}{$userid}");
$smarty->assign("USERFTPURL", $userFtpUrl);
$stations = sotf_Permission::listStationsWithPermission('upload');
if (!empty($stations)) {
$smarty->assign_by_ref("STATIONS", $stations);
示例2: readfile
require "config.inc.php";
require $classdir . '/sotf_Utils.class.php';
?>
<html>
<head><title><?php
echo $nodeId;
?>
log</title></head>
<body onChange="window.focus()">
<?php
/*** This is for remote view of log file */
$full = sotf_Utils::getParameter("full");
$lines = sotf_Utils::getFileSafeParameter("lines");
if (!$lines || !is_numeric($lines)) {
$lines = 300;
}
if ($full) {
echo "<pre>";
readfile($logFile);
echo "</pre>";
} else {
echo "<pre>";
//echo implode("\n", sotf_Utils::tail($logFile, $lines));
sotf_Utils::tail($logFile, $lines * 80);
//system("tail -$lines $logFile");
echo "</pre>";
}
echo "<a name=\"end\"></a>";