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);
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>";