[add] logout link
[add] absolute path for new video add [add] breadcrumb in admin page
This commit is contained in:
parent
f49dec12fa
commit
4b6da04484
|
@ -13,4 +13,38 @@ if (!empty($ci['ac']) && $ci['ac'] === 'clearCache' && $_SESSION['log'] === true
|
|||
} else {
|
||||
echo 'Error on delete cache.';
|
||||
}
|
||||
}
|
||||
}
|
||||
if (empty($ci['bc'])) {
|
||||
$path = $GLOBALS['config']['VIDEODIR'].'/';
|
||||
} else {
|
||||
$splitBc = chunk_split($ci['bc'], 8, '/');
|
||||
$path = $GLOBALS['config']['VIDEODIR'].'/'.$splitBc;
|
||||
$breadcrumb = makeBreadcrumb($ci['bc'], $fullListDir);
|
||||
$nbBread = count($breadcrumb);
|
||||
}
|
||||
|
||||
$listCurrentDir = listCurrentDir($path);
|
||||
$listCurrentFile = listVideo($path);
|
||||
|
||||
if (!empty($listCurrentFile) && count($listCurrentFile) > 1 && $ci['ac'] !== 'view') {
|
||||
echo '<div id="sort">
|
||||
<ul>
|
||||
<li><a href="?bc=', $ci['bc'], '&sort=date">Date</a></li>
|
||||
<li><a href="?bc=', $ci['bc'], '&sort=name">Name</a></li>
|
||||
</ul>
|
||||
</div>';
|
||||
}
|
||||
echo '<div id="breadcrumb">';
|
||||
$i = 1;
|
||||
echo '<a href="?">Home</a> >>';
|
||||
if (!empty($breadcrumb)) {
|
||||
foreach ($breadcrumb as $key => $value) {
|
||||
if ($i === $nbBread) {
|
||||
echo '<a href="?bc=', $key, '">', $value, '</a>';
|
||||
} else {
|
||||
echo '<a href="?bc=', $key, '">', $value, '</a> >> ';
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
echo '</div>';
|
|
@ -4,10 +4,11 @@
|
|||
if ($_SESSION['log'] === true) {
|
||||
echo '
|
||||
<ul class="topMenu">
|
||||
<li><a href="?ac=viewQueue&token=',$token,'">Download queue</a></li>
|
||||
<li><a href="?ac=clearCache&token=',$token,'">Clear cache</a></li>
|
||||
<li><a href="?ac=viewQueue&bc=',$ci['bc'],'&token=',$token,'">Download queue</a></li>
|
||||
<li><a href="?ac=clearCache&bc=',$ci['bc'],'&token=',$token,'">Clear cache</a></li>
|
||||
<li><a href="?ac=export&bc=',$ci['bc'],'&token=',$token,'">Export current dir</a></li>
|
||||
<li><a href="?ac=importDirForm&bc=',$ci['bc'],'&token=',$token,'">Import dir here</a></li>
|
||||
<li><a href="?ac=logout&bc=',$ci['bc'],'&token=',$token,'">Logout</a></li>
|
||||
</ul>
|
||||
<ul class="topMenu">
|
||||
<li><a href="?ac=newDir&bc=', $ci['bc'], '">New directory</a></li>
|
||||
|
|
11
index.php
11
index.php
|
@ -134,6 +134,7 @@ Options -Indexes';
|
|||
}
|
||||
|
||||
function logout() {
|
||||
session_unset();
|
||||
}
|
||||
|
||||
function getCurrentDir($bc) {
|
||||
|
@ -237,7 +238,6 @@ function importDir($bc, $fullListDir, $fullListFile) {
|
|||
'licence' => $value['licence'],
|
||||
'uploadDateSort' => $value['uploadDateSort']
|
||||
);
|
||||
|
||||
$url = escapeshellcmd($value['url']);
|
||||
$data = $key.' '.$url.' '.$_SERVER['DOCUMENT_ROOT'].'/'.$GLOBALS['config']['VIDEODIR'].'/'.$path.$file['hash']."\n";
|
||||
file_put_contents($GLOBALS['config']['TMPDIR'].'/'.$key.'.hash', $data);
|
||||
|
@ -285,9 +285,9 @@ function n_print($data, $name = '') {
|
|||
<fieldset style="border: 1px solid orange; padding: 5px;color:#1E1915; background-color: #fff;">';
|
||||
echo '
|
||||
<legend style="border:1px solid orange;padding: 1px;background-color:#eee;color:orange;">
|
||||
', basename($aBackTrace[0]['file']), ' ligne => ', $aBackTrace[0]['line'], '
|
||||
', basename($aBackTrace[0]['file']), ' ligne => ', $aBackTrace[0]['line'], '
|
||||
</legend>';
|
||||
echo '<pre style="color:#1E1915;">', htmlentities(print_r($data, 1)), '</pre>';
|
||||
echo '<pre style="color:#1E1915;">', htmlentities(print_r($data, 1)), '</pre>';
|
||||
echo '
|
||||
</fieldset>
|
||||
<br />';
|
||||
|
@ -352,7 +352,7 @@ function addVideo($ci, $fullListFile) {
|
|||
$nameHash = substr(sha1($ci['name'].$ci['url']), 0, 10);
|
||||
$url = escapeshellcmd($ci['url']);
|
||||
$path = chunk_split($ci['bc'], 8, '/');
|
||||
$data = $nameHash.' '.$url.' '.$path."\n";
|
||||
$data = $nameHash.' '.$url.' '.$_SERVER['DOCUMENT_ROOT'].'/'.$GLOBALS['config']['VIDEODIR'].'/'.$path."\n";
|
||||
file_put_contents($GLOBALS['config']['TMPDIR'].'/'.$nameHash.'.hash', $data);
|
||||
$fullListFile[$nameHash] = array(
|
||||
'title' => $ci['name'],
|
||||
|
@ -749,6 +749,9 @@ if ($ci['ac'] === 'importDir' && $ci['op'] === '1') {
|
|||
}
|
||||
importDir($ci['bc'], $fullListDir, $fullListFile);
|
||||
}
|
||||
if ($ci['ac'] === 'logout') {
|
||||
logout();
|
||||
}
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="fr">
|
||||
|
|
Loading…
Reference in New Issue