'; file_put_contents($GLOBALS['config']['CONFIG_FILE'], $data); $page = 'content'; } return $page; } function checkSecure() { } function logout() { } function genToken() { $token = sha1(uniqid(rand(), true).'_'.mt_rand()); $_SESSION['token'] = $token; $_SESSION['tokenTime'] = time(); return $token; } function verifToken($token) { if ($token !== $_SESSION['token'] || $_SESSION['tokenTime'] <= time() - 24000) { ban(); die('So Long, and Thanks for All the Fish.'); } } function checkIfBan() { require 'cache/logs/banUser.php'; $userIp = $_SERVER['REMOTE_ADDR']; if (isset($banList[$userIp]) && $banList[$userIp]['nbBan'] >= $GLOBALS['config']['maxErrorBeforeBan'] && $banList[$userIp]['lastBan'] + $GLOBALS['config']['banTime'] > time()) { return true; } elseif (isset($banList[$userIp]) && $banList[$userIp]['lastBan'] + $GLOBALS['config']['banTime'] < time()) { unban(); return false; } else { return false; } } function ban() { require $GLOBALS['config']['IPBANS_FILENAME']; $userIp = $_SERVER['REMOTE_ADDR']; if (isset($banList[$userIp])) { $banList[$userIp]['lastBan'] = time(); $banList[$userIp]['nbBan']++; } else { $banList[$userIp]['lastBan'] = time(); $banList[$userIp]['nbBan'] = 1; } file_put_contents($GLOBALS['config']['IPBANS_FILENAME'], ""); } function unBan() { require $GLOBALS['config']['IPBANS_FILENAME']; $userIp = $_SERVER['REMOTE_ADDR']; unset($banList[$userIp]); file_put_contents($GLOBALS['config']['IPBANS_FILENAME'], ""); } function n_print($data, $name = '') { $aBackTrace = debug_backtrace(); echo '

', $name, '

'; echo '
'; echo ' ', basename($aBackTrace[0]['file']), ' ligne => ', $aBackTrace[0]['line'], ' '; echo '
',         htmlentities(print_r($data, 1)), '
'; echo '

'; } function addDir($dir, $breadcrumb, $fullListDir) { if (empty($dir)) { return 'error'; } $dirHash = substr(sha1($dir), 0, 8); $fullListDir[$dirHash] = $dir; $path = chunk_split($breadcrumb, 8, '/'); file_put_contents($GLOBALS['config']['LISTDIR'], ""); if (mkdir('videos/'.$path.'/'.$dirHash)) { return 'success'; } else { return 'error'; } } function addVideo($ci, $fullListFile) { $nameHash = substr(sha1($ci['name']), 0, 10); $url = escapeshellcmd($ci['url']); $path = chunk_split($ci['bc'], 8, '/'); $data = $nameHash.' '.$url.' '.$path."\n"; file_put_contents($GLOBALS['config']['TMPDIR'].'/'.$nameHash.'.hash', $data); $fullListFile[$nameHash] = array( 'title' => $ci['name'], 'url' => $ci['url'], 'desc' => $ci['desc'], 'via' => $ci['via'], 'licence' => $ci['licence'] ); file_put_contents($GLOBALS['config']['LISTFILE'], ""); } function listCurrentDir($breadcrumb) { chdir($breadcrumb); return glob("*", GLOB_ONLYDIR); } function makeBreadcrumb($bc, $fullListDir) { $bcToArray = str_split($bc, 8); $nbBc = count($bcToArray); for ($i = 0; $i < $nbBc; $i++) { $hrefBc .= $bcToArray[$i]; $breadcrumb[$hrefBc] = $fullListDir[$bcToArray[$i]]; } return $breadcrumb; } function renameDir() { } function listVideo($breadcrumb) { return glob("*.jpg"); } function parseVideoDescription($file, $fullInfo = false) { $value = json_decode(file_get_contents($file)); } function getVideoInfo($file, $dir, $fullListFile) { $file = substr($file, 0, 10); $postInfo = $fullListFile[$file]; $path = chunk_split($dir, 8, '/'); $descFile = glob("videos/".$path.$file."*.json"); $jsonInfo = json_decode(file_get_contents($descFile[0])); $info = array( 'hash' => $file, 'title' => $postInfo['title'], 'originalTitle' => htmlentities($jsonInfo -> stitle), 'url' => $postInfo['url'], 'desc' => $postInfo['desc'], 'originalDesc' => htmlentities($jsonInfo -> description), 'uploadDate' => htmlentities($jsonInfo -> upload_date), 'format' => htmlentities($jsonInfo -> format), 'ext' => htmlentities($jsonInfo -> ext), 'duration' => htmlentities(round(($jsonInfo -> duration / 60), 2)), 'via' => $postInfo['via'], 'licence' => $postInfo['licence'] ); return $info; } function editVideoDescription() { } function testCache() { } function makeCache() { } function login($ci) { if (hash('sha256', $ci['loginName'].$GLOBALS['loginName']['salt']) === $GLOBALS['loginName']['loginName'] && $GLOBALS['loginName']['password'] === hash('sha256', $ci['loginPass'].$GLOBALS['loginName']['salt'])) { $_SESSION['log'] = true; return true; } else { return false; } } if (!empty($ci['ac']) && $ci['ac'] === 'login' && !empty($ci['op']) && (int)$ci['op'] === 2) { verifToken($ci['token']); if (login($ci) === true) { unset($ci['op'], $ci['ac']); } } ?> Please find a fucking apps name Exec time : '.round((microtime(TRUE) - $startTime), 5).'

'; ?>