Change file path

This commit is contained in:
nemunaire 2014-01-20 16:52:44 +01:00
parent 4304d7125d
commit ebb0cabf9a
3 changed files with 8 additions and 7 deletions

View File

@ -37,8 +37,9 @@ class Exercice
foreach($this->files as &$f)
{
$f["path_orig"] = $f["path"];
$f["path_hash"] = hash("sha384", $f["path"])."/".basename($f["path"]);
if (isset($VAR["files_dir"]))
$f["path"] = $VAR["files_dir"].$f["path"];
$f["path"] = $VAR["files_dir"].$f["path_hash"];
$f["basename"] = basename($f["path"]);
$f["sha1"] = strhex($f["sha1"]);
}

View File

@ -32,7 +32,7 @@
{if file_exists($file['path'])}
<tr>
<td>
<a href="/files/{$file['path_orig']}">
<a href="/files/{$file['path_hash']}">
<span class="glyphicon glyphicon-download"></span>
</a>
</td>

View File

@ -15,11 +15,11 @@ then
OPTS="$OPTS --delete"
fi
rsync -e ssh -av $OPTS out/errors phobos:~/
rsync -e ssh -av $OPTS out/htdocs phobos:~/
rsync -e ssh -av $OPTS out/teams phobos:~/
rsync -e ssh -av $OPTS files phobos:~/
rsync -e ssh -av $OPTS misc phobos:~/
rsync -e ssh -av $OPTS out/errors phobos:~/
rsync -e ssh -av $OPTS out/htdocs phobos:~/
rsync -e ssh -av $OPTS out/teams phobos:~/
rsync -e ssh -avL $OPTS files phobos:~/
rsync -e ssh -av $OPTS misc phobos:~/
scp nginx.conf submission.php phobos:~/
rsync -e ssh -av phobos:~/submission/ submission/